Viber AI

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.

Who can use the API: members on the Pro+ and Max plans (Pro+: 60 requests per minute, 2 answers at once; Max: 300 per minute, 4 at once). Create your key in the dashboard. See the plans.

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_here

POST /api/v4/chat

Send a prompt or a conversation, get the answer. JSON body (everything except model and the prompt is optional):

modelrequired. A model id from GET /api/v4/models.
promptthe question as text. Use this or messages.
messagesa conversation, ending with a user or tool message (see below).
systeminstructions for the AI.
effortone of the model's efforts. Default: default_effort (the fastest). A level the model doesn't list gives 400.
streamdefault true: live, one JSON per line. false: one JSON at the end.
max_tokenslimit for the answer length (at most the model's max_output_tokens).
toolsup 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":"…"}

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.

Nameid (for "model")effort
auto/best-freeauto/best-free–
Baidu: ERNIE-5.5-Flash-Previewopenrouter/baidu/ernie-5.5-flash-preview:free–
baytout3/qwen3.5-uncensored:35bbaytout3/qwen3.5-uncensored:35b–
Claude Fable 5.1cc/claude-fable-5-1low, medium, high, xhigh, max
Claude Haiku 4.5kr/claude-haiku-4.5–
Claude Haiku 5.5cc/claude-haiku-5-5low, medium, high, xhigh
Claude Opus 4.6cc/claude-opus-4-6low, medium, high, max
Claude Opus 4.7cc/claude-opus-4-7low, medium, high, xhigh, max
Claude Opus 4.8cc/claude-opus-4-8low, medium, high, xhigh, max
Claude Opus 5.5cc/claude-opus-5-5low, medium, high, xhigh, max
Claude Sonnet 4.5kr/claude-sonnet-4.5–
Claude Sonnet 5cc/claude-sonnet-5low, medium, high, xhigh
Claude Sonnet 5.5cc/claude-sonnet-5-5low, medium, high, xhigh
DeepSeek V3.2kr/deepseek-3.2–
Free Models Routeropenrouter/openrouter/free–
gc/Grok 4.5gc/grok-4.5–
gc/Grok 4.6gc/grok-4.6–
gc/Grok 4.7gc/grok-4.7–
gc/Grok Code Fast 1gc/grok-code-fast-1–
Gemini 3 Flashantigravity/gemini-3-flash–
Gemini 3.1 Flash Liteantigravity/gemini-3.1-flash-lite–
Gemini 3.5 Flash Liteantigravity/gemini-3.5-flash-lite–
Gemini 3.8 Flashantigravity/gemini-3.8-flashlow, medium, high
GLM-5kr/glm-5–
Google: Gemma 4 26B A4Bopenrouter/google/gemma-4-26b-a4b-it:free–
Google: Gemma 4 31Bopenrouter/google/gemma-4-31b-it:free–
GPT-6 Astrachatgpt/gpt-6-astralow, medium, high, xhigh, max, ultra
GPT-6 Lunachatgpt/gpt-6-lunalow, medium, high, xhigh, max
GPT-6.1 Solchatgpt/gpt-6.1-sollow, medium, high, xhigh, max, ultra
GPT-6.1 Terrachatgpt/gpt-6.1-terralow, medium, high, xhigh, max, ultra
inclusionAI: Ling 3.2 Flashopenrouter/inclusionai/ling-3.2-flash:free–
LiquidAI: LFM3-1.7Bopenrouter/liquid/lfm-3-1.7b:free–
MiniMax M2.1kr/minimax-m2.1–
MiniMax M2.5kr/minimax-m2.5–
NVIDIA: Nemotron 3 Nano Omniopenrouter/nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free–
NVIDIA: Nemotron 3 Ultraopenrouter/nvidia/nemotron-3-ultra-550b-a55b:free–
NVIDIA: Nemotron 3.5 Lightningopenrouter/nvidia/nemotron-3.5-lightning:free–
NVIDIA: Nemotron 3.5 Super VLopenrouter/nvidia/nemotron-3.5-super-vl:free–
Particle AI: Particle-1openrouter/particle-ai/particle-1:free–
Qwen3 Coder Nextkr/qwen3-coder-next–
Recursive: Flintopenrouter/recursive/flint-v1.0:free–
SWE-1.7 Maxdva/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":…}).

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.