Beaver Network API / beta

Beaver Network API

The Beaver Network API is the hosted part of Beaver that you can use today. It speaks the OpenAI API: point any OpenAI client at one base URL and use your key. The local beaver app is in development; see the Beaver home page.

Base URL: https://api.tessovix.com/v1

Quickstart

  1. Get a key. Sign in on the dashboard and create an API key. It is shown once; new keys can take about 5 seconds to start working.
  2. Set the base URL to https://api.tessovix.com/v1 and the API key to your key.
  3. Call the API. Examples below.

curl

curl https://api.tessovix.com/v1/chat/completions \
  -H "Authorization: Bearer $TESSOVIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"tessovix-mini","messages":[{"role":"user","content":"Say hello"}]}'

Python

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.tessovix.com/v1",
    api_key=os.environ["TESSOVIX_API_KEY"],
)
reply = client.chat.completions.create(
    model="tessovix-mini",
    messages=[{"role": "user", "content": "Say hello"}],
)
print(reply.choices[0].message.content)

Node

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.tessovix.com/v1",
  apiKey: process.env.TESSOVIX_API_KEY,
});
const reply = await client.chat.completions.create({
  model: "tessovix-mini",
  messages: [{ role: "user", content: "Say hello" }],
});
console.log(reply.choices[0].message.content);

Endpoints

Every request needs Authorization: Bearer <your key>.

EndpointWhat it does
POST /v1/chat/completionsChat completion. Set "stream": true to receive server-sent events, as with OpenAI.
GET /v1/modelsLists the models your key can use.
GET /v1/tessovix/usageNetwork hours used this week, your weekly limit and bonus hours, plus today's request counts and contribution points.

Models

ModelNotes
tessovix-miniGeneral chat and coding model, available to every key.

The catalog grows as nodes join. Call GET /v1/models with your key for the current list.

Rate limits

PlanNetwork hours per weekRequests per minute, per key
Free (Community), beta160600

A network hour is a 60-minute window that opens with a request served by another owner's machine. Running a node adds bonus hours; see contribution points. These are relaxed beta limits and may be lowered later with notice. Paid plans are not open yet.

Errors

Errors use the OpenAI format with the matching HTTP status:

{"error": {"message": "missing or invalid API key", "type": "authentication_error"}}
StatusTypeMeaning
401authentication_errorMissing, revoked or unknown API key.
403permission_errorNot allowed. On the dashboard this means your email address is not verified.
409limit_errorA limit was reached, for example 20 active keys per account.
429rate_limit_errorToo many requests per minute. Wait the number of seconds in the Retry-After header.
429insufficient_quotaYour weekly network hours are used up.
503service_unavailable_errorNo machine is available right now. Retry shortly.

Get an API key