La documentation est disponible en anglais et en russe. Les exemples de code sont identiques dans toutes les langues.

Documentation

Harvanera gives you one API key and one balance for every model in the catalog. The API is OpenAI-compatible: any SDK or tool that works with OpenAI works with Harvanera — change the base URL and the key.

Quick start

  1. Create an API key in your dashboard. New accounts get a welcome credit to try things out.
  2. Pick a model in the catalog and copy its ID, for example deepseek/deepseek-v3.1.
  3. Send a request:
curl https://harvanera.com/v1/chat/completions \
  -H "Authorization: Bearer sk-harvanera-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek/deepseek-v3.1",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

The same with the official OpenAI SDK:

from openai import OpenAI

client = OpenAI(base_url="https://harvanera.com/v1", api_key="sk-harvanera-YOUR_KEY")
response = client.chat.completions.create(
    model="deepseek/deepseek-v3.1",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://harvanera.com/v1", apiKey: "sk-harvanera-YOUR_KEY" });
const response = await client.chat.completions.create({
  model: "deepseek/deepseek-v3.1",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);

Prefer to try first? Use the chat in your dashboard — it runs on the same balance and shows the cost of every reply.

Models and keys

You don't buy models separately. One key works with every available model: the model is chosen per request with the model field, and you pay only for the tokens of the model you called.

Streaming

Set "stream": true to receive the reply as Server-Sent Events, exactly as with OpenAI. To get token usage in the last chunk, add "stream_options": {"include_usage": true}.

stream = client.chat.completions.create(
    model="qwen/qwen3-coder",
    messages=[{"role": "user", "content": "Write a haiku about APIs"}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

If you stop reading a stream midway, you are charged only for the tokens generated before the disconnect.

Pricing and balance

Errors

Errors use the OpenAI format: {"error": {"message": "...", "type": "...", "code": "..."}}.

StatusCodeWhat to do
400invalid_requestFix the request body: it must be JSON with a non-empty messages array.
401invalid_api_keyThe key is wrong, revoked or paused.
402insufficient_balanceTop up the balance or lower max_tokens.
402key_limit_exceededThe key reached its monthly limit — raise it on the API keys page.
403model_not_allowedThe key is restricted to other models.
404model_not_foundCheck the model ID against GET /v1/models.
429rate_limitedToo many requests — retry after the Retry-After header.
429key_pausedThe key is paused after many failed requests in a row; wait and fix the requests.
502upstream_errorThe model provider failed. Retry — we already tried the backup providers.
503model_unavailableThe model is temporarily unavailable.

Limits

Integrations

Anything that supports an OpenAI-compatible provider works. You always need three things: the base URL https://harvanera.com/v1, your key and the model ID.

Menu names in third-party tools change between versions; if something doesn't match, look for "OpenAI-compatible" or "custom base URL" in the tool's settings.