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.
Quickstart
- 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.
- Set the base URL to
https://api.tessovix.com/v1and the API key to your key. - 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>.
| Endpoint | What it does |
|---|---|
POST /v1/chat/completions | Chat completion. Set "stream": true to receive server-sent events, as with OpenAI. |
GET /v1/models | Lists the models your key can use. |
GET /v1/tessovix/usage | Network hours used this week, your weekly limit and bonus hours, plus today's request counts and contribution points. |
Models
| Model | Notes |
|---|---|
tessovix-mini | General 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
| Plan | Network hours per week | Requests per minute, per key |
|---|---|---|
| Free (Community), beta | 160 | 600 |
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"}}
| Status | Type | Meaning |
|---|---|---|
| 401 | authentication_error | Missing, revoked or unknown API key. |
| 403 | permission_error | Not allowed. On the dashboard this means your email address is not verified. |
| 409 | limit_error | A limit was reached, for example 20 active keys per account. |
| 429 | rate_limit_error | Too many requests per minute. Wait the number of seconds in the Retry-After header. |
| 429 | insufficient_quota | Your weekly network hours are used up. |
| 503 | service_unavailable_error | No machine is available right now. Retry shortly. |