Viber API
Use Viber's AI models from your own scripts and programs. You get an API key that starts with vb_. Answers count against your credits, like in the app and the chat.
Authentication
Send the key in the Authorization header. Please don't put keys or passwords in the URL: URLs end up in server logs and browser history.
Authorization: Bearer vb_your_key_herePOST /api/v4/chat
Send a prompt or a conversation, get the answer. JSON body (everything except model and the prompt is optional):
model | required. A model id from GET /api/v4/models. |
prompt | the question as text. Use this or messages. |
messages | a conversation, ending with a user or tool message (see below). |
system | instructions for the AI. |
effort | one of the model's efforts. Default: default_effort (the fastest). A level the model doesn't list gives 400. |
stream | default true: live, one JSON per line. false: one JSON at the end. |
max_tokens | limit for the answer length (at most the model's max_output_tokens). |
tools | up to 60 tools: {"name","description","input_schema"} (JSON Schema). |
tool_choice | "auto" (default), "none", or {"name":"Read"}. |
curl -N https://viberai.de/api/v4/chat \
-H "Authorization: Bearer vb_your_key_here" \
-H "Content-Type: application/json" \
-d '{"model":"antigravity/gemini-3.8-flash","effort":"low","prompt":"Say hello"}'The live stream
One JSON object per line, while the AI works:
{"t":"thinking","text":"The user wants a greeting…"}
{"t":"delta","text":"Hel"}
{"t":"delta","text":"lo!"}
{"t":"tool_call","id":"call_1","name":"Read","input":{"file_path":"a.txt"}}
{"t":"ping"}
{"t":"done","tokens":612,"input_tokens":540,"output_tokens":72,"cached_tokens":0,"stop_reason":"tool_use","state":"…"}thinking: the AI's reasoning (not every model shows it).delta: the answer.tool_call: sent once the call is complete;inputis a full JSON object. Several can come in one answer (parallel calls).ping: a sign of life every ~15 s during long thinking. Ignore it.donecomes last.stop_reason:end_turn,tool_use,max_tokensorrefusal.input_tokensshows how full the context is.error:{"t":"error","code":"provider_error","error":"…"}(thendone).
With "stream": false you get one JSON:
{ "ok": true, "model": "…", "effort": "low", "text": "…", "thinking": "…",
"tool_calls": [ { "id": "call_1", "name": "Read", "input": { "file_path": "a.txt" } } ],
"stop_reason": "tool_use", "tokens": 612, "input_tokens": 540, "output_tokens": 72, "cached_tokens": 0, "state": "…" }Tools
The AI never runs anything itself: it asks for a tool call, you run it and send the result back.
{
"model": "cc/claude-sonnet-5-5",
"tools": [ { "name": "Read", "description": "Reads a file", "input_schema": { "type": "object", "properties": { "file_path": { "type": "string" } }, "required": ["file_path"] } } ],
"messages": [
{ "role": "user", "content": "Read a.txt" },
{ "role": "assistant", "content": "I read the file.",
"tool_calls": [ { "id": "call_1", "name": "Read", "input": { "file_path": "a.txt" } } ],
"state": "<the state from the last done event, unchanged>" },
{ "role": "tool", "tool_call_id": "call_1", "content": "hello world", "is_error": false }
]
}Several tool messages in a row are fine (parallel calls). state is an opaque string from the done event: send it back unchanged in the matching assistant message (it carries what the provider needs to continue after thinking). If there is none, leave it out.
Images
content of a user or tool message may be a list instead of text:
"content": [
{ "type": "text", "text": "What is on the screenshot?" },
{ "type": "image", "media_type": "image/png", "data": "<base64>" }
]A model that can't read images answers 400 with images_not_supported.
Models
Use the id as model. Which of these you may use depends on your account (the admin can limit it): ask GET /api/v4/models for your own list.
| Name | id (for "model") | effort |
|---|---|---|
| auto/best-free | auto/best-free | – |
| Baidu: ERNIE-5.5-Flash-Preview | openrouter/baidu/ernie-5.5-flash-preview:free | – |
| baytout3/qwen3.5-uncensored:35b | baytout3/qwen3.5-uncensored:35b | – |
| Claude Fable 5.1 | cc/claude-fable-5-1 | low, medium, high, xhigh, max |
| Claude Haiku 4.5 | kr/claude-haiku-4.5 | – |
| Claude Haiku 5.5 | cc/claude-haiku-5-5 | low, medium, high, xhigh |
| Claude Opus 4.6 | cc/claude-opus-4-6 | low, medium, high, max |
| Claude Opus 4.7 | cc/claude-opus-4-7 | low, medium, high, xhigh, max |
| Claude Opus 4.8 | cc/claude-opus-4-8 | low, medium, high, xhigh, max |
| Claude Opus 5.5 | cc/claude-opus-5-5 | low, medium, high, xhigh, max |
| Claude Sonnet 4.5 | kr/claude-sonnet-4.5 | – |
| Claude Sonnet 5 | cc/claude-sonnet-5 | low, medium, high, xhigh |
| Claude Sonnet 5.5 | cc/claude-sonnet-5-5 | low, medium, high, xhigh |
| DeepSeek V3.2 | kr/deepseek-3.2 | – |
| Free Models Router | openrouter/openrouter/free | – |
| gc/Grok 4.5 | gc/grok-4.5 | – |
| gc/Grok 4.6 | gc/grok-4.6 | – |
| gc/Grok 4.7 | gc/grok-4.7 | – |
| gc/Grok Code Fast 1 | gc/grok-code-fast-1 | – |
| Gemini 3 Flash | antigravity/gemini-3-flash | – |
| Gemini 3.1 Flash Lite | antigravity/gemini-3.1-flash-lite | – |
| Gemini 3.5 Flash Lite | antigravity/gemini-3.5-flash-lite | – |
| Gemini 3.8 Flash | antigravity/gemini-3.8-flash | low, medium, high |
| GLM-5 | kr/glm-5 | – |
| Google: Gemma 4 26B A4B | openrouter/google/gemma-4-26b-a4b-it:free | – |
| Google: Gemma 4 31B | openrouter/google/gemma-4-31b-it:free | – |
| GPT-6 Astra | chatgpt/gpt-6-astra | low, medium, high, xhigh, max, ultra |
| GPT-6 Luna | chatgpt/gpt-6-luna | low, medium, high, xhigh, max |
| GPT-6.1 Sol | chatgpt/gpt-6.1-sol | low, medium, high, xhigh, max, ultra |
| GPT-6.1 Terra | chatgpt/gpt-6.1-terra | low, medium, high, xhigh, max, ultra |
| inclusionAI: Ling 3.2 Flash | openrouter/inclusionai/ling-3.2-flash:free | – |
| LiquidAI: LFM3-1.7B | openrouter/liquid/lfm-3-1.7b:free | – |
| MiniMax M2.1 | kr/minimax-m2.1 | – |
| MiniMax M2.5 | kr/minimax-m2.5 | – |
| NVIDIA: Nemotron 3 Nano Omni | openrouter/nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free | – |
| NVIDIA: Nemotron 3 Ultra | openrouter/nvidia/nemotron-3-ultra-550b-a55b:free | – |
| NVIDIA: Nemotron 3.5 Lightning | openrouter/nvidia/nemotron-3.5-lightning:free | – |
| NVIDIA: Nemotron 3.5 Super VL | openrouter/nvidia/nemotron-3.5-super-vl:free | – |
| Particle AI: Particle-1 | openrouter/particle-ai/particle-1:free | – |
| Qwen3 Coder Next | kr/qwen3-coder-next | – |
| Recursive: Flint | openrouter/recursive/flint-v1.0:free | – |
| SWE-1.7 Max | dva/swe-1-7 | – |
GET /api/v4/models
The models you may use, with everything a client needs to know about them: effort levels (lowest first), the default effort, context size, maximum answer length and what they can do.
curl https://viberai.de/api/v4/models -H "Authorization: Bearer vb_your_key_here"{ "ok": true, "models": [ {
"id": "cc/claude-opus-5-5", "name": "Claude Opus 5.5",
"efforts": ["low","medium","high"], "default_effort": "low",
"context_window": 1000000, "max_output_tokens": 128000,
"tools": true, "images": true, "thinking": true } ] }Python example
import requests
import json, requests
r = requests.post("https://viberai.de/api/v4/chat", stream=True,
headers={"Authorization": "Bearer vb_your_key_here"},
json={"model": "antigravity/gemini-3.8-flash", "prompt": "Explain recursion in one sentence."})
for line in r.iter_lines():
if not line: continue
ev = json.loads(line)
if ev["t"] in ("thinking", "delta"):
print(ev["text"], end="", flush=True)Errors and limits
Errors have a fixed code: {"ok": false, "code": "rate_limited", "error": "…"} (in a stream: {"t":"error","code":…}).
invalid_key401 ·access_off403 (API off, banned or locked)model_not_allowed400 ·images_not_supported400 ·bad_request400context_too_long400: shorten the history and try againbudget_exhausted402 ·maintenance503 ·provider_error502rate_limited429 with aRetry-Afterheader (seconds)
Limits are per key: 300 requests per minute and 4 answers at the same time by default (the admin can change both). If you close the connection, the AI stops right away.