Sidzedze ƒe gɔmeɖoanyi Dɔwɔlawo
Dɔƒomeɖeɖe, Ŋɔŋlɔɖeɖe kple Ŋɔŋlɔɖeɖewo
Three ways to ask a model something, in the three formats clients already speak, all running on the same models and billed the same way.
Woɖe axa sia gɔme to mɔ̃ dzi be wòanɔ bɔbɔe. Eŋlisigbe me gbãtɔae nye gɔmeɖeɖe si sɔ.
Chat Akpalaɖeɖe
The OpenAI chat format, and the one almost every tool supports. Send the conversation so far and get the next message back.
POST https://nymbot.ai/api/v1/chat/completions — ƒe API key ɖeka ƒe kpɔɖeŋu le dɔme.
ɖe ɖe model kple messages are required. A sampling parameter the chosen
model does not take is dropped without an error, so one request body works across models. The
model list gives each model's supported_parametersNu siɖeɖe si wogblẽna ɖe nu si wofɔ ɖe asi gbeɖe ŋu o la nye nu siameɖeɖe si model la medoa nu gbeɖe o: viɖeɖe na model si meɖoa nu ɖe vidiviwo me o, agbalẽwo na model si meɖoa agbalẽwo ɖe edzi o.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
model | nuɖeɖe | Ɛ̃ | nymbot/auto (ɖo auto) Nymbot ƒe routing mɔnu ƒe balance dzi gbɔ, alo katalog model id be... anthropic/claude-sonnet-5 Pro balance dzi. App ƒe nya gbaɖeɖe kple nyatakpewowo ɖe nya ɖe wowɔna. Ewɔna be eɖo a gbã. ɖokpɔkpɔ. |
messages | kplɔ̃ | Ɛ̃ | Nuƒoƒo la.
Dɔwɔwɔwo system, developer (ʋeɖe ɖeka si wowɔ ɖe dɔ kple nɔnɔme siwo le nuɖeɖi me ta), user, assistant kple tool. Content nye ƒeɖeɖe alo ƒeɖeɖe ƒetɔɖeŋu nye text kple image_url ŋkpɔkpɔwo; emetata ɖekae만 le ɖekaɖeka ƒe taɖiwo me. input_audio eyeɖeɖe ƒe ƒeɖeɖewo wɔɖu. |
stream | boolean | Ɖeɖe ŋutɔ | Va eŋlɔ ɖeɖe si wogblɔ ɖe. Le ɖe ɖe. dɔwɔwɔ le mɔ̃meɖe dzi. |
stream_options | nukɔnu | Ɖeɖe ŋutɔ | {"include_usage": true} ɖoa dzesi ɖeka ɖeka eye wòɖoa ɖeka si kple token ƒe ƒeɖeɖe kple tɔtrɔ ƒe dɔwɔwɔ. |
max_tokensmax_completion_tokens | ŋkɔɖeŋkɔ | Ɖeɖe ŋutɔ | Ŋkɔwɔwo si wanyɔ le gbãtɔ. Èɖo eɖe ɖe model ƒe ɖeka si me la gbã, ne eɖo ɖe nu wu la. Eɖoa nu si wofia ɖe wòãkpɔ ɖe wòƒe balãsi (balance) me fɔ, ne nu si wòɖo la nye nu si ƒo la, eɖo nu si wònye kpɔ ɖe dɔwɔnu tso gɔme la gbã. |
temperaturetop_p | kakpapla | Ɖeɖe ŋutɔ | Nɔamesi ɖeɖe ƒe dɔwɔwɔwo: temperature 0 ɖa 2, top_p 0 ɖetɔ 0̃ 1. |
stop | ŋuta alo bɔblɔɖi | Ɖeɖe ŋutɔ | Text that ends the answer: a string or at most 4 strings, each at most 256 characters. Not used by nymbot/auto. |
seed | ŋkɔɖeŋkɔ | Ɖeɖe ŋutɔ | Beɖe ŋutikɔnu si wòɖuɖu ɖeka ɖeɖe la, ne model la nya eŋu. |
presence_penaltyfrequency_penalty | kakpapla | Ɖeɖe ŋutɔ | Repetition controls, each from -2 to 2. |
response_format | nukɔnu | Ɖeɖe ŋutɔ | {"type": "json_object"} eve {"type": "json_schema", "json_schema": {…}}, ne model la ɖeɖe ɖe, si wònye ɖe. Wonye ɖe nya me o le nymbot/auto. |
toolstool_choiceparallel_tool_calls | array, string alo object, boolean | Ɖeɖe ŋutɔ | Ŋkuƒome ɖeke ɖeka. Hia. nusitsitɔ kpeɖeɖeɖewo. A web_search mɔƒunɔ bubu ɖe ɖu ɖe awu net hãƒe ɖeɖeɖe. Dzotsi 128 tɔʋu kple 512 KB ƒe dzesiwo, siwo wogblẽ ɖe dzi ɖe tɔʋu 64 me ɖe ɖe; eye si wu la nye a 400. |
reasoning_effortreasoning | kpɔkpɔ, nukpɔkpɔ | Ɖeɖe ŋutɔ | "minimal", "low", "medium" eve "high", alo {"effort": "high"}. "none" eve {"enabled": false} eɖu eya ɖe. Hia nuxlẽɖeɖe. |
plugins | kplɔ̃ | Ɖeɖe ŋutɔ | [{"id": "web", "max_results": 5}] ɣeɖe ɖea ɖekaɖeka ɖe web dzi gbãtɔ. Blɔ̃ ɖeka ɖo 10. |
n | ŋkɔɖeŋkɔ | Ɖeɖe ŋutɔ | ɖeka ko. Any de la ɖeɖe ƒe ɖeɖe wòɖo gbɔ 400. |
logit_biasusermetadata | ɖe, ƒeɖeɖe, ɖeɖe | Ɖeɖe ŋutɔ | Wokpɔkpɔ ɖe ɖu eye wode dze ɖe kpeɖeti me o. logit_bias token ids ɖeka ɖeka si ɖo 300 gbɔ ɖe xɔ ɖe ƒe ƒe ɖeka siwo le -100 ɖo 100 gbâ ɖe; user nye ƒe kpɔkpɔ kpɔ ɖe nu si gbɔ nu kple kpɔkpɔ 256 characters; metadata holds at most 16 string values, keys up to 64 characters and values up to 512. |
The reply is an ordinary chat.completion, ɖe taɖi si le eme la usage.cost
(dɔlã me) eye le... nymbot dɔwɔɖodzi. model eƒe resolved model id ye nye,
etɔ̃ be ɖeɖe ƒe ŋkɔ gɔme yi ɖe nuɖeɖe ŋkɔ me. Ne model ƒe ɖetɔ̃ɖetɔ̃ ƒe dɔwɔwɔwo ɖe eƒe ɖeɖeɖe me be eɖe nuɖeɖe megbe la, eƒe
ɖeɖeɖe nye... message.reasoning_content, ede eya ƒe ɖeɖe me.
Gbɔbɔɖeɖe
{
"id": "chatcmpl-5f1c0a9e27d84b3c",
"object": "chat.completion",
"created": 1790726400,
"model": "anthropic/claude-sonnet-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "A Lightning invoice is a one-time payment request..."
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 1240,
"completion_tokens": 380,
"total_tokens": 1620,
"prompt_tokens_details": { "cached_tokens": 0 },
"completion_tokens_details": { "reasoning_tokens": 0 },
"cost": 0.01895
},
"nymbot": {
"balance": "pro",
"charged_credits": 0.162,
"charged_sats": 16.2,
"balance_credits": 412.425,
"balance_sats": 41242.5
}
}
finish_reason eɖe edzi le nu si ɖoɖo ɖe le eŋu, ɖe be nuɖadawo ɖe dzesi ɖe nya sia dzi ɖekae la la: tool_calls ɣeɖeɖe si model la ɖe kuku ɖe kplɔ̃wo la, length ɣeɖe
ŋutikɔkpɔɖe si ɖe dzo ɖe kɔm ɖe kɔm nu (alo model la ɖe eƒe kɔm kplɔ̃ ɖe dzo ɖe dzo nu eye wòɖo nuɖowo ɖeɖe), content_filter ɣeɖe ɖeɖeɖe na ɖeɖe, eye stop
egaɖeɖe. usage.completion_tokens_details.reasoning_tokens is always 0: hidden
reasoning tokens are counted, and charged, in completion_tokens.
| Nystatʋe | Fiee? |
|---|---|
400 | Ɖeɖe ŋutɔ model eve messages (missing_required_parameter); ŋuti alo fiaƒe ƒe aksɔ, alo nuãlaɖeɖewo na nuãlaɖeɖe si meɖeaɖe ɖe wo la (unsupported_content); ƒe nuɖiɖi 20 wu (too_many_images); lɔlɔ̃ si wòkpɔ ɖe lɔlɔ̃ƒeɖeŋu alo si mele nuŋutɔɖe me (invalid_value); foto ƒe link si menye kɔkɔe o (invalid_image_url); nusi mɔƒowɔwɔwo le nuɖuɖu dzi si mɔƒowɔwɔwo meɖe nya wɔm le (unsupported_tool); n 1 ɖeɖe ɖidi gbɔ; a :thinking nuɖasi si nye nuɖegã si meɖe nuɖoyaɖeaɖe ɖe o (model_not_found); alo ɖekʋɖe ɖemãɖemã lɔliã si dzi kɔɖeɖe (upstream_rejected). |
402 | Mɔɖodzi si model la ɖe ɖe la me la me kpe ɖe nu si wogblɔ ɖe ɖe ɖe ŋu la ŋu aɖe. |
403 | Nu siɖeɖe la ɖo key ƒe cap ŋu o (key_limit_reached). Tsitsɔ max_tokens alo ɖo nu tɔŋtɔ la ɖe ɖi. |
404 | Mɔƒo si ƒe dzɔdzɔe nye ɖeyi (model_not_found). |
429 | Kadi ƒe limit, alo eƒe ɖokui ƒe limit (upstream_rate_limited). |
502, 503 | Dɔwɔla la ɖeɖe ɖe (upstream_error) alo ɖe nu si le dzi ɖe nu wu (upstream_overloaded, ɖe nya me Retry-After). Menye nu ɖeka si wɔ nu ɖi o, menye ame si ɖe afɔɖe la ɖe afɔɖe ɖe ɖeɖe ko o. |
Status kɔɖuɖu si endpoint ɖekaɖeka ɖagbe ɖe lawo le asubu me errors.
cURL
curl https://nymbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [
{"role": "system", "content": "Answer in one short paragraph."},
{"role": "user", "content": "What is a Lightning invoice?"}
],
"max_tokens": 400
}'
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[
{"role": "system", "content": "Answer in one short paragraph."},
{"role": "user", "content": "What is a Lightning invoice?"},
],
max_tokens=400,
)
print(reply.choices[0].message.content)
print(reply.usage.cost)
JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const reply = await client.chat.completions.create({
model: "anthropic/claude-sonnet-5",
messages: [
{ role: "system", content: "Answer in one short paragraph." },
{ role: "user", content: "What is a Lightning invoice?" },
],
max_tokens: 400,
});
console.log(reply.choices[0].message.content);
console.log(reply.usage.cost);
Nuklɔ̃ɖeɖe
ɖe "stream": true ŋutinya la va beɖe ƒe ɖeɖewo (server-sent events) ne model la ɖe eɖe. Ðeɖe ɖesiaɖe nye... chat.completion.chunk do data: ɖeka, eye nuɖeɖe la
nye ɖeka si ɖu ɖa data: [DONE]. Reasoning arrives in
delta.reasoning_content, eƒe bububu le delta.content.
Ŋwɔŋu ɖeka si ɖo 100 sea ɖeka gbã, abe nuɖuɖu gã alo ɖeɖe ƒe nuŋɔŋlɔ gã aɖe menye wu la, ɖe anyi ɖe nuŋɔŋlɔ me.
max_tokens or a reasoning model. A request that is not streamed sends nothing until
the answer is complete, and the network between you and Nymbot may close an idle connection
after about 100 seconds; the model still finishes and what it wrote is charged, but the answer
is lost. A stream sends keep-alives, so it stays open for as long as the model writes.
Tsoɖi
data: {"id":"chatcmpl-5f1c0a9e27d84b3c","object":"chat.completion.chunk","created":1790726400,"model":"anthropic/claude-sonnet-5","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}
data: {"id":"chatcmpl-5f1c0a9e27d84b3c","object":"chat.completion.chunk","created":1790726400,"model":"anthropic/claude-sonnet-5","choices":[{"index":0,"delta":{"content":"A Lightning invoice"},"finish_reason":null}]}
: keep-alive
data: {"id":"chatcmpl-5f1c0a9e27d84b3c","object":"chat.completion.chunk","created":1790726400,"model":"anthropic/claude-sonnet-5","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"id":"chatcmpl-5f1c0a9e27d84b3c","object":"chat.completion.chunk","created":1790726400,"model":"anthropic/claude-sonnet-5","choices":[],"usage":{"prompt_tokens":1240,"completion_tokens":380,"total_tokens":1620,"cost":0.01895},"nymbot":{"balance":"pro","charged_credits":0.162,"charged_sats":16.2,"balance_credits":412.425,"balance_sats":41242.5}}
data: [DONE]
- Ŋkɔsi siwo ɖo ɖe aloɖe me la
:keep-alive nuãnuãnuwo, woɖoa ɖea ɖe dzigbe ɖeka ɖeka ɖeka 15 seconds ɖea ɣe be model la le nuƒoƒo wɔm le. SSE clients woɖoa wo. - Kpɔ
"stream_options": {"include_usage": true}ɖe si meɖeɖe bubui la le anyi, ɖe si meɖeɖe bubui la le anyichoices, token ƒowoawo, tɔŋɔ ƒe dzesi siwo le eme eye wònymbotdɔwɔɖodzi. - The charge settles after the stream ends. If you close the connection early, the model is not stopped: Nymbot reads the rest of the provider's stream, for up to 25 seconds, to get its token count, and you pay what the provider reports. Without that count the charge is estimated from your input and what was written, plus the whole output allowance for a model that reasons.
- Ŋkla si le gbãtɔ gbãtɔ gbeɖe, bevi nye
401eve402, ɖea ɖeka eye wòɖoa ɖo adzoe JSON si ƒe dzesi (status code) ɖo, mate ŋu aɖo ɖe dzesi (stream) me o. Nusi bubu si nye kuɖea (error) si ɖeka ɖe dzesi (stream) la megbe la ɖea ɖeka eye wòɖoa ɖo ɖeka gbãtɔgbãtɔdata: {"error": {…}}event, and the stream ends without[DONE]. - Requests with tools, and models on OpenAI's Responses transport, do not stream from the provider. They still answer with a valid stream, sent once the answer is complete.
cURL
curl -N https://nymbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nymbot/auto",
"stream": true,
"stream_options": {"include_usage": true},
"messages": [{"role": "user", "content": "Write a haiku about sats."}]
}'
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
stream = client.chat.completions.create(
model="nymbot/auto",
stream=True,
stream_options={"include_usage": True},
messages=[{"role": "user", "content": "Write a haiku about sats."}],
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="", flush=True)
elif chunk.usage:
print("\ncost:", chunk.usage.cost)
JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const stream = await client.chat.completions.create({
model: "nymbot/auto",
stream: true,
stream_options: { include_usage: true },
messages: [{ role: "user", content: "Write a haiku about sats." }],
});
for await (const chunk of stream) {
if (chunk.choices.length) process.stdout.write(chunk.choices[0].delta.content || "");
else if (chunk.usage) console.log("\ncost:", chunk.usage.cost);
}
Tɔƒome kɔƒomewo
ɖokunuwo ƒe tɔtrɔwo ɖe... tools and the model can ask for one to be called instead of
answering. You run the function, add its result as a tool ɖeka ƒe xɔxɔ me ɖeka siwo le eme la gbɔ ɖe nya la me
tool_call_id, eye ɖe nuɖeɖe la gbɔ hã. Nymbot menye wòƒe dɔwɔwɔwo laa;
eɖoa eŋu si model la ɖe la ɖo wò gbɔ.
tool_choice ʋor ɖe ɖi "auto", "none",
"required" eve {"type": "function", "function": {"name": "…"}}.
The model list marks which models can call tools (capabilities.tools). Meɖe nuatsɔsɔwo ɖe nya nu be 400 unsupported_tool ɖa nymbot/auto eyeɖe model siwo ɖe gbɔ de gbɔ le catalog me siwo ɖi ɖe OpenAI ƒe Responses transport dzi, si Nymbot menle be wò ada dzesiwo ɖe eŋu o.
ɖe "stream": true, dɔwɔnuwo ƒe kplɔʋu si le ɖeɖe la le ɖeka me eye wòɖoa ɖe dzesi siwo le ɖeɖe me la be: eƒe gbɔgbɔ, dzesi ɖeka si kɔ dɔwɔnu ɖeka ɖeka ƒe kplɔʋu si ɖe eƒe nɔnɔme, eƒe nubabla, eƒe ŋkɔ kple eƒe dɔwɔnuwo, eye wòɖoa ɖe dzesi si nye ɖopɔkpɔpɔ la. Klient siwo ɖea dzesi siwo ƒo dɔwɔnuwo ɖe le ɖeɖe me la ɖoa ɖe wo ɖe dzesi siwo le ɖeɖe me la be be nɔa dɔwɔwɔ ƒe ɖekae me.
Ŋutɔ, ɖeɖe la me la
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_7d2e",
"type": "function",
"function": { "name": "get_invoice_status", "arguments": "{\"invoice_id\":\"a41f\"}" }
}
]
},
"finish_reason": "tool_calls"
}
]
cURL
curl https://nymbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [{"role": "user", "content": "Has invoice a41f been paid?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_invoice_status",
"description": "Look up whether an invoice is paid.",
"parameters": {
"type": "object",
"properties": {"invoice_id": {"type": "string"}},
"required": ["invoice_id"]
}
}
}]
}'
Python
import json, os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
tools = [{
"type": "function",
"function": {
"name": "get_invoice_status",
"description": "Look up whether an invoice is paid.",
"parameters": {
"type": "object",
"properties": {"invoice_id": {"type": "string"}},
"required": ["invoice_id"],
},
},
}]
messages = [{"role": "user", "content": "Has invoice a41f been paid?"}]
reply = client.chat.completions.create(model="anthropic/claude-sonnet-5", messages=messages, tools=tools)
call = reply.choices[0].message.tool_calls[0]
args = json.loads(call.function.arguments)
messages.append(reply.choices[0].message)
messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps({"paid": True})})
final = client.chat.completions.create(model="anthropic/claude-sonnet-5", messages=messages, tools=tools)
print(final.choices[0].message.content)
JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const tools = [{
type: "function",
function: {
name: "get_invoice_status",
description: "Look up whether an invoice is paid.",
parameters: {
type: "object",
properties: { invoice_id: { type: "string" } },
required: ["invoice_id"],
},
},
}];
const messages = [{ role: "user", content: "Has invoice a41f been paid?" }];
const reply = await client.chat.completions.create({ model: "anthropic/claude-sonnet-5", messages, tools });
const call = reply.choices[0].message.tool_calls[0];
const args = JSON.parse(call.function.arguments);
messages.push(reply.choices[0].message);
messages.push({ role: "tool", tool_call_id: call.id, content: JSON.stringify({ paid: true }) });
const final = await client.chat.completions.create({ model: "anthropic/claude-sonnet-5", messages, tools });
console.log(final.choices[0].message.content);
Enyɔnyatɔwo le kplɔ̃ɖeɖe me
Mɔ̃lẽwo ɖe ŋkuãnye me gbã capabilities.vision ŋuta ŋuɖe emetɔ. Tsɔ ɖe ɖeka le eŋu image_url
ɖeka si wònye ɖe ame ɖeka ƒe mesaj me la, eye wònye ɖe ame vɔʋɔ̃me alo... https:// link alo a
data:image/…;base64, URL. Wɔ ŋutikɔkɔ̃ 20 ɖeɖe ɖe kpeɖemeke ɖeka me.
Womaxɔa SVG ŋutikɔkɔ̃wo, eye womaxɔa link si ƒe ƒeɖeɖe ɖe ɖe 4,096 characters wu alo si me ame ƒe ŋkɔ alo password le o
(400 invalid_image_url). Nu si wòle nyanyaɖe detail e nya
auto, low eve high.
ɖe nymbot/auto, mɔɖeɖe si ƒe ɖokui me ɖe nuɖiɖi ɖeɖe ɖe la yi nuɖiɖiɖi si ƒe dɔwɔwɔ la ɖo nu si le agbe me la gbãtɔ me. Nuɖiɖiɖi dzesi si me nuɖiɖiɖi ɖeɖe ɖeɖe me o capabilities.vision wɔ nuɖugã siwo kple 📸 ɖeɖe ɖi nya
400 unsupported_content. Nuãɖeɖewo menle be woɖe ɖe ɖeka ɖe dɔwɔlawo ƒe nyawo me ko o.
Link ɖeka nàɖe ɖe nuŋuti ɖe ame katã ƒe nɔƒe; Nymbot ɖoa nuãɖeɖe la ɖe model ƒe provider ƒe asi me eye wòanya ɖe eŋu o.
A picture is charged as the input tokens the provider counts for it, like the rest of the request.
cURL
curl https://nymbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What is in this picture?"},
{"type": "image_url", "image_url": {"url": "https://example.com/receipt.jpg"}}
]
}]
}'
Python
import base64, os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
with open("receipt.jpg", "rb") as f:
data_url = "data:image/jpeg;base64," + base64.b64encode(f.read()).decode()
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What is in this picture?"},
{"type": "image_url", "image_url": {"url": data_url}},
],
}],
)
print(reply.choices[0].message.content)
JavaScript
import { readFile } from "node:fs/promises";
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const dataUrl = "data:image/jpeg;base64," + (await readFile("receipt.jpg")).toString("base64");
const reply = await client.chat.completions.create({
model: "anthropic/claude-sonnet-5",
messages: [{
role: "user",
content: [
{ type: "text", text: "What is in this picture?" },
{ type: "image_url", image_url: { url: dataUrl } },
],
}],
});
console.log(reply.choices[0].message.content);
Nuxlɔɖeɖeɖe
Mɔ̃lẽwo ɖe ŋkuãnye me gbã capabilities.reasoning woƒeɖeɖe ɖeɖe bubu alo bubu ɖe ɖeɖe kple reasoning_effort ("minimal", "low",
"medium" eve "high") alo "reasoning": {"effort": "high"}, alo
ɖe ɖe :thinking nuɖugã ƒe ŋkɔ si, emenya eɖe dɔ be dɔwɔnu gã aɖe wònye. Ne dɔwɔnu si melɔ nuɖeɖe o la, woɖe nya sia ɖe ɖe ŋu o. Viʋla nymbot/auto, :thinking ɖoa eɖe ɖeka si gbɔ ɖo
standard reasoning route la dzi.
Anthropic model-wo nu me la, dɔwɔnu la le nuxlẽnu ƒe ƒomeɖiɖi si nye token 1,000, 2,000, 8,000 alo 16,000 ƒe ɖokpe, eye wòado nu wu nu gɔme o. max_tokens ɖoa. Atsia ɖe nuɖuɖu ƒe lɔlɔ̃ me ne nuɖuɖu ƒe lɔlɔ̃ ɖe nuɖuɖu ƒe lɔlɔ̃ le eme ʋe
tool_choice ɖo edzi dzesi ƒe tɔlɔtɔ, eye wòɖo edzi dzesi ƒe tɔlɔtɔ ƒe ɖekamemedi (eƒe nubabla ƒetsɔ gbãtɔ nye tɔlɔtɔ ƒe nyaɖuɖu), ɖe be Anthropic ƒe ŋutinya si ɖe ɖi gbãtɔ la ɖo edzi be wòatsɔ ɖe edzi la menye eme.
Eƒe dɔwɔwɔ ƒe ɖekamemedi la ɖo edzi ɖekae le Responses kple Messages endpoints lɛ me.
Nukpɔkpɔ la ɖoɖo ɖoɖo le ɖi ɖi ɣi me message.reasoning_content, alo
delta.reasoning_content ɣeyiɖe ɖeʋlaɖeɖe le streaming me la, nàɖe nàmesɔ ɖe ɖeka me o. Ŋɔŋlɔ si wòɖo ƒe dzesi alo dzesi si ƒe nɔnɔme wònye nye xɔxɔ si wòɖoa ɖe dzesi me la, eye wòfɔ ɖe xɔxɔ me la, ɖe nu si le eme la. completion_tokens. Some providers do not
return the reasoning text at all, and it is still charged.
cURL
curl https://nymbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"reasoning_effort": "high",
"messages": [{"role": "user", "content": "Is 2^61 - 1 prime? Show why."}]
}'
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
reasoning_effort="high",
messages=[{"role": "user", "content": "Is 2^61 - 1 prime? Show why."}],
)
message = reply.choices[0].message
print(getattr(message, "reasoning_content", None))
print(message.content)
JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const reply = await client.chat.completions.create({
model: "anthropic/claude-sonnet-5",
reasoning_effort: "high",
messages: [{ role: "user", content: "Is 2^61 - 1 prime? Show why." }],
});
console.log(reply.choices[0].message.reasoning_content);
console.log(reply.choices[0].message.content);
Model ɖekawo ƒe nuɖeɖeɖewo
Model ƒe ŋkɔ ƒe ŋkɔɖo ɖeka si le eŋu la ɖe nu si wowɔna le dɔme la ɖe nu, eye wòɖoa dze nu ɖe dɔwɔnu bubu ɖeka me la o.
Wòwɔ dɔ le ŋkɔ ɖekaɖekawo ƒe kpeɖeŋkɔ (full ids) kple ŋkɔ gbaɖegbawo (short names) dzi ɖeka ɖeka, be eɖo be anthropic/claude-sonnet-5:online.
| Ŋkɔƒomeɖeɖe | Nukpɔkpɔ |
|---|---|
:online | Web ƒe ta ɖe ɖa gbã, ʋeye... plugins: [{"id": "web"}]. Hia net hãƒe ɖeɖeɖe. |
:thinking | Nuɖododo dɔwɔwɔ gã; le eme nymbot/auto, nuɖometatã ƒe ƒeƒe. Modèl si menya nuɖometatã la dzi, 400 model_not_found “endpoints wuɖeɖe alo ɖeɖe la gblẽ” ɖe. |
:nitro, :floor, :exacto, :extended | Woɖo eŋu eye woɖokpe. Model katã ƒe nuɖowo ɖe nuɖowo ɖeka ko, ɖe nye nu si ƒo wu, si ƒo mɔ̃ wu, alo si ƒo ɖaɖa wu ɖe ve vie; wòɖoa nuɖeɖeɖewo ɖe eŋu be model ƒe ŋkɔ siwo woɖokpe ɖetɔ lɛ ƒe xɔxɔme la nàɖe nu ɖe dɔ gɔme o. |
Any other suffix is ignored. The whole name is tried first, so a model whose id really contains a
colon still works; failing that, suffixes are taken off the end one at a time until a model
matches. A model name may be at most 200 characters long with at most 4 suffixes; a longer
one is refused with 400 invalid_value.
cURL
curl https://nymbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5:thinking",
"messages": [{"role": "user", "content": "Plan a three-day trip to Lisbon."}]
}'
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5:thinking",
messages=[{"role": "user", "content": "Plan a three-day trip to Lisbon."}],
)
print(reply.choices[0].message.content)
JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const reply = await client.chat.completions.create({
model: "anthropic/claude-sonnet-5:thinking",
messages: [{ role: "user", content: "Plan a three-day trip to Lisbon." }],
});
console.log(reply.choices[0].message.content);
Wɔtaƒe ɖeɖe me ɖeɖe
Any chat model ɖe ŋutɔ me la ate ⁶ɖe eƒe ŋɔɣi ƒe neti ƒe taɖi ɖe nuŋɔŋlɔ siwo le internet dzi la me la. Nymbot ɖe nu ɖe nuŋɔŋlɔ si dɔwɔla ƒe nya si gbãtɔ la (eƒe nya ƒetɔ 2,000 la) me, ɖoa ta ɖe nuŋɔŋlɔ siwo nya wu la me eye ɖoa nya siawo ɖe model la ƒe ƒo ƒe ta, eye wòɖoa nuŋɔŋlɔ siawo ɖe eƒe ta be eƒe dɔwɔnu la meɖe nuŋɔŋlɔ siawo ƒe taɖi ɖe dɔ me la. Dɔwɔnu ƒe nɔnɔme ɖekaɖeɖe eve le:
- ɣeɣe ʋɔ̃:
"plugins": [{"id": "web", "max_results": 5}], ɖe a:onlinemɔɖiɖe si le nuɖeɖe gbɔ la. - Dofɔɖe ɖe nu si kpe ɖe wò gbɔ le ɣeyiɣi si wòɖe kpe ɖe wò gbɔ le.:
"tools": [{"type": "web_search", "parameters": {"max_results": 5}}], eye nuɖeɖeɖe siwo wo ɖo ɖe nu ame beweb_search_previeweveopenrouter:web_search. Nymbot searches only when the question looks like it needs current information, the same test the app uses.
max_results 5 nye ɖokui gbãtɔe eye eyawo menye 10 gbã o. Źɔɖodziwo va ɖo ɖe...
nymbot.web_search.sources, ɖeka ɖeka kple a title, snippet kple
url, eye beɖeɖeɖe url_citation meseɖemenuwo ƒe nɔnɔmeɖeɖewo.
Each search that runs costs $0.008, converted to sats, on top of the tokens, and it is part of the hold. The pages it read are input tokens too, so an answer from the web costs more than the same question asked cold, sometimes several times more.
Ŋutɔ, ɖeɖe la me la
"nymbot": {
"balance": "pro",
"charged_credits": 0.431,
"charged_sats": 43.1,
"balance_credits": 411.994,
"balance_sats": 41199.4,
"web_search": {
"sources": [
{ "title": "Lightning Network - Wikipedia", "snippet": "The Lightning Network is a payment protocol...", "url": "https://en.wikipedia.org/wiki/Lightning_Network" }
]
}
}
cURL
curl https://nymbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"plugins": [{"id": "web", "max_results": 5}],
"messages": [{"role": "user", "content": "What changed in the latest Bitcoin Core release?"}]
}'
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "What changed in the latest Bitcoin Core release?"}],
extra_body={"plugins": [{"id": "web", "max_results": 5}]},
)
print(reply.choices[0].message.content)
for source in reply.model_extra["nymbot"]["web_search"]["sources"]:
print(source["url"])
JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const reply = await client.chat.completions.create({
model: "anthropic/claude-sonnet-5",
plugins: [{ id: "web", max_results: 5 }],
messages: [{ role: "user", content: "What changed in the latest Bitcoin Core release?" }],
});
console.log(reply.choices[0].message.content);
for (const source of reply.nymbot.web_search.sources) console.log(source.url);
ɖeɖeewo API
OpenAI's newer format, used by the OpenAI Agents SDK and by Codex. It runs on the same models, billing and features as Chat Completions.
POST https://nymbot.ai/api/v1/responses — ƒe API key ɖeka ƒe kpɔɖeŋu le dɔme.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
model | nuɖeɖe | Ɛ̃ | Eya kpɔɖeɖe ɖe... Chat Akpalaɖeɖe, ɖekawo ƒe ɖekawo wɔnaɖekawo ɖeɖe me. |
input | ŋuta alo bɔblɔɖi | Ɛ̃ | Ŋkɔ si ƒe dzesi ɖi, alo nuwo ƒe dzesi ƒe nɔnɔme: messages (roles user, assistant, system, developer) kple input_text, input_image kple output_text ƒeɖeɖewo, eye ɖeɖe function_call kple function_call_output dɔwɔnuwo ƒe nuɖuɖuwo. input_image ɖua nya ɖeɖe le image_url link alo data URL, menye file id menye o. reasoning kple web_search_call nye nuɖeɖewo ƒe dɔwɔwɔwo ɖo dzesi ɖe dzesi; item_reference e ɖo edem. |
instructions | nuɖeɖe | Ɖeɖe ŋutɔ | Sistɛm ƒe aɖeɖeɖe. |
max_output_tokens | ŋkɔɖeŋkɔ | Ɖeɖe ŋutɔ | Tokens siwo gbɔ ɖeɖe si woaxɔna. |
temperaturetop_p | kakpapla | Ɖeɖe ŋutɔ | Xɔna fiaɖuɖuwo, ne model la ɖo nyawo le woŋuti. |
toolstool_choiceparallel_tool_calls | array, string alo object, boolean | Ɖeɖe ŋutɔ | Dɔwɔnuwo ƒe tɔtrɔwo, Responses ƒe nɔnɔme me ({"type": "function", "name": …, "parameters": …}). A web_search eve web_search_preview mɔƒunɔ bubu ɖe ɖu ɖe awu net hãƒe ɖeɖeɖe ɣeɖe nɔa ɖe nya me la. Woɖo tɔŋgbui tɔŋgbui ƒe dɔwɔnu siwo le eme me ɖeɖe. |
reasoning | nukɔnu | Ɖeɖe ŋutɔ | {"effort": "minimal" | "low" | "medium" | "high"}. xhigh kple max agbeɖeɖe gbɔgbɔ high; none eɖu e ɖe. |
text.formatresponse_format | nukɔnu | Ɖeɖe ŋutɔ | Ŋɔŋlɔ siwo ɖo ɖeka me, be JSON schema alo json_object. |
metadata | nukɔnu | Ɖeɖe ŋutɔ | Response la meɖeɖe ɖeɖe o. String ƒe nya ɖeka ɖe ɖeka ɖe 16 gbɔ, keys ƒe dzesiwo ɖo gbãtɔ 64 gbɔ eye nyawo ɖo gbãtɔ 512 gbɔ. |
stream | boolean | Ɖeɖe ŋutɔ | ʋe ɖekʋenye dzesiwo siwo ɖo esia le aɖome me. |
store | boolean | Ɖeɖe ŋutɔ | Ignored. Nothing is stored, and the response always says "store": false. |
previous_response_idconversationbackground | ŋutã, nudɔwɔnu, ɖeɖee | Ɖeɖe ŋutɔ | Enye kpeɖeŋu o: 400 unsupported_parameter. Aɖeɖewo ƒe nyawo nàɖu ɖe nyawo me o, ɖe èɖe dzesi ƒetɔ gbɔna nya la ɖo gbɔna input ɣesia ɖekaɖeka. |
Gbɔbɔɖeɖe
{
"id": "resp_8c1e4b0f9a2d4e61",
"object": "response",
"created_at": 1790726400,
"status": "completed",
"model": "anthropic/claude-sonnet-5",
"output": [
{
"type": "message",
"id": "msg_2b7f",
"role": "assistant",
"status": "completed",
"content": [{ "type": "output_text", "text": "A Lightning invoice is...", "annotations": [] }]
}
],
"output_text": "A Lightning invoice is...",
"usage": {
"input_tokens": 1240,
"input_tokens_details": { "cached_tokens": 0 },
"output_tokens": 380,
"output_tokens_details": { "reasoning_tokens": 0 },
"total_tokens": 1620
},
"incomplete_details": null,
"error": null,
"instructions": null,
"store": false,
"previous_response_id": null,
"metadata": {},
"nymbot": { "balance": "pro", "charged_credits": 0.162, "charged_sats": 16.2, "balance_credits": 412.425, "balance_sats": 41242.5 }
}
Agbalẽ dɔwɔnu ƒe dzɔɖodzi ɖe asi ɖe... output gbeɖeɖe ɖe ŋku ɖe ŋku function_call dɔwɔwɔ si ƒe...
call_id, name kple arguments; tsɔ nea ɖe megbe gbe
function_call_output nu si ƒo ɖeka call_id. Nuxɔnuɖeɖe, ne
model la ɖo eɖe ɖe, nye nu ʋeyẽ aɖe reasoning dɔwɔwɔ si ƒe... reasoning_text ŋutefia,
nye siwo ɖo gbãtɔ. status e nya incomplete ɣeɖe ɖea nuɖuɖu fia la
max_output_tokens alo ne nyaɖeɖeɖe, kple
incomplete_details.reason ɖo ɖe... max_output_tokens eve
content_filter. Ŋɔŋlɔ si la ɖe nu siwo wòɖoɖo la (temperature, dɔwɔnuwo, dɔwɔnu ɖeɖe nu ɖeɖe nu eye nu bubuwo) beɖe OpenAI ɖeɖe me, eye wòɖu... nymbot dɔmẽ nu
Blaɖeɖe, nu ɖeka ɖeka nye nu... event: line kple a data: a ƒe taɖi ɖea
sequence_number, le sia ƒe dzesi me: response.created,
response.in_progress, response.output_item.added,
response.content_part.added, ɖeka ɖeka o vɔ le eŋu response.output_text.delta,
response.output_text.done, response.content_part.done,
response.output_item.done, eye nuɖasiɖeɖe response.completed ɖe nuɖuɖu kple dɔwɔwɔ ƒe tawo la. Ŋɔŋlɔ si ƒe ɖeka tsi ɖe ɖeŋu la, eƒe ƒeŋu ƒe ɖeka la ɖe... response.incomplete ɖekɔ, eye nuɖegbe
nuɖeɖe si megbe ɖe ɖaka si wòɖo ɖe asi gbɔ la response.failed. Eŋɔŋlɔ ƒe kɔƒeɖeɖe ɖea ɖe eɖokui ɖe eɖokui kple response.reasoning_text.delta kple .done. Dzogbe dzeawo
ɖoa xɔ ɖe nya la egbɔ, ɖeka ɖeka ɖe dzesi siwo ɖe nye response.function_call_arguments.delta
kple .done.
| Nystatʋe | Fiee? |
|---|---|
400 | Ɖeɖe ŋutɔ model eve input; previous_response_id, conversation, background alo si item_reference (unsupported_parameter); awoɖeɖe dzesi alo nuɖuɖu ƒe dzesi si meɖeɖe wu. |
402, 403, 404, 429, 502, 503 | Chat Completions ƒe ŋutinya la gbɔ. |
cURL
curl https://nymbot.ai/api/v1/responses \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"instructions": "Answer in one short paragraph.",
"input": "What is a Lightning invoice?"
}'
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
response = client.responses.create(
model="anthropic/claude-sonnet-5",
instructions="Answer in one short paragraph.",
input="What is a Lightning invoice?",
)
print(response.output_text)
JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const response = await client.responses.create({
model: "anthropic/claude-sonnet-5",
instructions: "Answer in one short paragraph.",
input: "What is a Lightning invoice?",
});
console.log(response.output_text);
Anthropic Woŋuɖuɖuɖuwo
Anthropic ƒe dɔwɔnuɖɔɖɔ, beɖe wòɖɔna Anthropic SDKs kple Claude Code la. Eƒe dɔwɔwɔna dɔwɔnuɖɔɖɔɖɔ kplesiɖeɖe le katãa nu siwo le katalog la me, mate ŋu be Claude ɖeka ko o: eɖe eƒe asɔme ɖe nuɖe, eɖoa nya la ɖe dɔwɔwɔɖɔɖɔ la me, eye eɖea nya la ɖe asɔme ɖe ɖeɖewo me hã.
POST https://nymbot.ai/api/v1/messages — xɔ API key, ɖeɖe nye x-api-key eve Authorization: Bearer.
La anthropic-version kple anthropic-beta headerswo la va ɖe ɖe, eye wogbeɖu ɖe wo dzi. Anthropic model ƒe ŋkɔwo ɖo catalog ƒe ŋkɔwo ŋu, ɖeɖe la Claude Code kple SDKwo la le dɔ me kple ŋkɔwo siwo woɖo ɖe wo ɖe la ŋu:
- Ŋkɔ si kǎtalo la xɔla, be ɖe ɖe nya wu nya si nya be
claude-sonnet-5eveanthropic/claude-opus-5, ɖea ɖeɖe ɖe nya la gbɔ ta la gbɔ wotsɔ ɖe ɖeɖe ɖe. - Ɖeɖe nye ŋkeke (
-20260514),-latest, nu nɔnɔme ƒe dzesi si nye be-v1, bɔpɔkpɔ ɖe ɖeka si ƒe nuŋɔŋlɔ ƒe ƒeɖeɖe nye be[1m]ɖe eye naanthropic/eveanthropic.ɖaɖasiwo ɖo eŋu, eye nuɖeɖe kple dãɖãwo le nuɖeaɖeɖea me la, wotsɔ ɖe dɔm kple ɖeke kple ɖeke (claude-haiku-4-5woɖuɖuwoclaude-haiku-4.5). - Ne eƒeɖeɖe bubu ɖe nuɖeɖeɖe nu, ƒome (Opus, Sonnet alo Haiku) va ɖe dzesi, ne katalɔgbɔ ƒe ƒeɖeɖe ɖo nu si wotsɔ ɖe ɖe ɖe alo nɔa nu si wotsɔ ɖe ɖe ƒeɖeɖe gbãtɔ wu la.
- Ŋkɔ si meɖeɖe ɖe nu siaɖe o la ƒo
404not_found_error.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
model | nuɖeɖe | Ɛ̃ | Katalog model id, alo Anthropic model ŋkɔ. |
max_tokens | ŋkɔɖeŋkɔ | Ɛ̃ | Tokens siwo gbɔ ɖeɖe si woaxɔna. |
messages | kplɔ̃ | Ɛ̃ | user kple assistant ŋkɔkpɔ, kple text, image (base64 alo URL gɔme ƒe dzesi), tool_use kple tool_result ŋkekewo. thinking ɣeɖeɖe ƒe dzesiwo siwo le gbãtɔ ƒe dɔwɔwɔwo me la, wowɔna be woɖo ɖe eme eye wowɔna be woɖu ɖe eme. |
system | ŋuta alo bɔblɔɖi | Ɖeɖe ŋutɔ | System prompt, beɖe ŋuta alo ƒeɖeɖe nyawo. |
temperaturetop_p | kakpapla | Ɖeɖe ŋutɔ | Xɔna fiaɖuɖuwo, ne model la ɖo nyawo le woŋuti. top_k e kpɔkpɔ ɖe eŋu eye wotsɔ ɖe anyi. |
stop_sequences | ŋutawo ƒe afɔ | Ɖeɖe ŋutɔ | Text that ends the answer. At most 4 strings, each at most 256 characters. |
toolstool_choice | array, object | Ɖeɖe ŋutɔ | Duwo kple name, description kple input_schema. A web_search Server didiamɛ ɖu ɖa net hãƒe ɖeɖeɖe; Anthropic ƒe nuɖuɖu siwo le eme yaɖo ɖeɖe (bash, text editor, computer ƒe dɔwɔwɔ) woɖeɖe ɖe gbɔ unsupported_tool. tool_choice ʋor ɖe ɖi auto, any, tool eve none, eye si disable_parallel_tool_use. |
thinking | nukɔnu | Ɖeɖe ŋutɔ | {"type": "enabled", "budget_tokens": 8192}, {"type": "adaptive"} eve {"type": "disabled"}. Budget la ɖe dɔwɔwɔ nuatlɔɖe ɖe: eye sɔ̃ 2,048 nyaɖeɖe, eye 2,048 ɖe ɖevɔ, eye 8,192 ɖe gbɔɖe, eye 16,384 ɖe ɖiɖi. Adaptive ɖe nyaɖeɖeƉeɖe ɖe output_config.effort, alo ɖi ɖi. |
stream | boolean | Ɖeɖe ŋutɔ | Anthropic ƒeɖeɖe ƒe dɔwɔwɔ ƒe dɔme ɖeɖe. |
metadata | nukɔnu | Ɖeɖe ŋutɔ | Ɖe ɖe ɖokui kple ɖe ɖokui mɔ. |
Gbɔbɔɖeɖe
{
"id": "msg_01c7a2f93e5b4d08",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-sonnet-5",
"content": [{ "type": "text", "text": "A Lightning invoice is..." }],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 1240,
"output_tokens": 380,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0
},
"nymbot": { "balance": "pro", "charged_credits": 0.162, "charged_sats": 16.2, "balance_credits": 412.425, "balance_sats": 41242.5 }
}
content eɖe ɖeɖe le eŋu o tool_use blocks kple a thinking
kɔ, nye xɔ̃ŋɔ̃na signature eƒe ɖeka ɖe. stop_reason e nya
end_turn, max_tokens, tool_use eve refusal,
worked out the same way as finish_reason ɖa
Chat Akpalaɖeɖe; stop_sequence is always
null, to gbɔ ɖe dzesi si ɖu ɖe alo nu si ɖu ɖe dzesi si ɖu ɖe la me o. input_tokens nɔna nuto ƒe nuto wo ɖeɖe; nu siwo lɔ̃ ɖe nu ɖi le nu lɔ̃ɖi ƒe kplenɔ ɖua me. Dɔmeɖeɖe le...
nymbot ɖuɖu kple nu si X-Nymbot-Cost-Sats ɖeesi.
Wɔkpɔ̃ ɖe dzesi me, dɔwɔwɔwo nye Anthropic ƒe: message_start,
content_block_start, ping, content_block_delta
(text_delta, input_json_delta eve thinking_delta),
content_block_stop, message_delta ɖe dzesi ɖeɖe tso vuvu ɖeɖe la ƒe nɔnɔme la me, eye nuʋɔ̃ kple
ɖeɖe la nymbot utsɔɖeɖe ƒe dɔwɔwɔ ƒe taɖi, eye na message_stop. A ping is also
sent every 15 seconds while the model is working. Tool calls arrive after the text, each as a
tool_use ɖe e ɖe ɖeka me eye eƒe nuɖuɖu katã le eme ɖeka me input_json_delta.
Errorwo si ɖe sia endpoint dzi la ɖe Anthropic ƒe dɔwɔwɔ ƒe nɔnɔme dzi:
{"type": "error", "error": {"type": "not_found_error", "message": "…"}}. A
ɣiewegbe nɔnɔe nye 402 billing_error, eye si gbɔgbɔɖi eye wòɖe dɔ gã ɣe
503 overloaded_error. Nuɖugbe si meɖoɖo le nɔnɔme si wòɖoɖo la ɖeɖe la laɖe
se ɖe nuɖugbe si ɖeɖeɖe error ŋutikɔ.
cURL
curl https://nymbot.ai/api/v1/messages \
-H "x-api-key: $NYMBOT_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "What is a Lightning invoice?"}]
}'
Python
import os
import anthropic
client = anthropic.Anthropic(base_url="https://nymbot.ai/api", api_key=os.environ["NYMBOT_API_KEY"])
message = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[{"role": "user", "content": "What is a Lightning invoice?"}],
)
print(message.content[0].text)
JavaScript
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ baseURL: "https://nymbot.ai/api", apiKey: process.env.NYMBOT_API_KEY });
const message = await client.messages.create({
model: "claude-sonnet-5",
max_tokens: 1024,
messages: [{ role: "user", content: "What is a Lightning invoice?" }],
});
console.log(message.content[0].text);
Counting tokens
An estimate of how many input tokens a Messages request would use, so a client can check before it sends. It is free, but still needs a key.
POST https://nymbot.ai/api/v1/messages/count_tokens — ƒe API key. Ŋusẽ.
ɖeka ɖe ɖeka gɔme le Ŋutawo, ɖeesi max_tokens;
the model name has to resolve. The count is an estimate: the characters of the system prompt,
messages, tool calls and tool definitions divided by four, plus 1,600 for each picture. It is
not the provider's own tokenizer, so the real count can differ. A key that has reached its cap
can still use it.
Gbɔbɔɖeɖe
{ "input_tokens": 318 }
cURL
curl https://nymbot.ai/api/v1/messages/count_tokens \
-H "x-api-key: $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"messages": [{"role": "user", "content": "What is a Lightning invoice?"}]
}'
Python
import os
import anthropic
client = anthropic.Anthropic(base_url="https://nymbot.ai/api", api_key=os.environ["NYMBOT_API_KEY"])
count = client.messages.count_tokens(
model="claude-sonnet-5",
messages=[{"role": "user", "content": "What is a Lightning invoice?"}],
)
print(count.input_tokens)
JavaScript
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ baseURL: "https://nymbot.ai/api", apiKey: process.env.NYMBOT_API_KEY });
const count = await client.messages.countTokens({
model: "claude-sonnet-5",
messages: [{ role: "user", content: "What is a Lightning invoice?" }],
});
console.log(count.input_tokens);
Mɔ̃ɖeɖeɖe mɔ̃ɖeɖeɖewo
API si wòɖoa ɖe xɔ nusi ɖe xɔna, kple nusi wòɖo ɖe eŋu. Wòŋlɔɖi sia ƒe nɔnɔme si wòɖoa ƒo ɖe xɔna nye ɖeka ko si app ƒe xɔxɔ nuɖeɖe ƒe nɔnɔme la ɖe, ɖe ènye nusi server la ayi awurɔ̃na la gbãtɔ.
GET https://nymbot.ai/api/v1/models — kadi menye ɖeɖe. Eɖo kɔɖe me minitɔ atɔ̃ me.
GET /api/v1/models/{id} ɖekea ɖea ɖeɖe ɖeɖe ɖe.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
type | ŋkɔ (nanya) | Ɖeɖe ŋutɔ | chat (eƒe nuɖoligbe), image, video, audio, embedding eve all. Ɖekaɖekawo woaɖe nya ɖe, le nu si image,video. |
Ɖeƒewo nye nu si wòɖoa, eye fee kple margin ɖe eŋu ɣleti, ɖe dɔlɔ kple sats me le Bitcoin ƒe Ɖeƒeƒe si le egbe me. balance eɖe nuɖeɖe si modele la ɖe ɖea le nya la me.
nymbot_key nuƒome si melɔ̃ la ƒe ɖeŋuƒome ɖea app la me o. created ɣeyiɖe nye
0, ɖe be lisi ƒe ɖeka bubuwo me la me ɖo nuɖeɖe si me aɖe model vi aɖe ɖe ɖɔ ɖe kaku la me o ɖeɖe. Model si ƒe token
dzɔɖzɔ ƒe ƒeɖeɖewo le eme o la ƒe ƒeɖeɖe nye per_request ɖe eteƒe.
nymbot/auto nye ɖekawoɖeka ɖe nye katã gbãtɔ, woɖo ta nye variable, ɖe nu vevi aɖe me
routes ɖeke ɖe nuɖeɖe ɖeka ɖeka ƒe nɔnɔmewo ƒe dzesiwo ɖe ɖe. Eɖe nukuɖekeɖeke kple nuxlẽɖekeɖeke ɖe ɖe, gake eɖe dzesiwo meɖe o.
GET /api/v1/models/{id} accepts the same names and aliases as a request, and returns
the entry for the model they resolve to.
Gbɔbɔɖeɖe
{
"object": "list",
"data": [
{
"id": "anthropic/claude-sonnet-5",
"object": "model",
"type": "chat",
"owned_by": "anthropic",
"name": "Claude Sonnet 5",
"created": 0,
"context_length": 1000000,
"max_output_tokens": 64000,
"architecture": { "input_modalities": ["text", "image"], "output_modalities": ["text"] },
"supported_parameters": ["max_tokens", "temperature", "tools", "tool_choice", "reasoning", "response_format", "stop"],
"capabilities": { "vision": true, "video": false, "tools": true, "reasoning": true, "web_search": true },
"balance": "pro",
"pricing": {
"type": "per_token",
"currency": "USD",
"input_per_1M_tokens": 4.725,
"output_per_1M_tokens": 23.625,
"cache_read_per_1M_tokens": 0.4725,
"sats_input_per_1M_tokens": 4038,
"sats_output_per_1M_tokens": 20192
},
"description": "...",
"nymbot_key": "claude-sonnet"
}
]
}
Ebiawo bubuwo:
- Nukpɔkpɔ ŋutikpɔkpɔwo ɖe
capabilities(accepts_image_url,requires_image_url,edit) ɖe ame aɖe tɔmatsɔtɔmper_generation. - Videwo ŋutikpɔkpɔwo ɖe
max_duration_secondskpleresolutions, eye tɔ ƒe ƒeper_secondnye ɖeka ɖeka ƒe nuɖame ɖeɖe la ƒe nu ɖeɖe ɖe. - Ŋɔɖodzi ŋutikpɔkpɔwo ɖe
audio_typespeechevetranscription, ɖokuivi nuƒometɔ́per_1k_charseveper_minute. - Ɖo ɖe eme ŋutikpɔkpɔwo ɖe
dimensions,context_length,max_inputsand a price per million input tokens.
Dziɖuɖuwo ɖo ɖi ŋu ŋuɖeɖi ŋu "estimated": true nye app ƒe dzesi si nye generator si ƒe taƒoƒo
ɖeɖe ɖeɖe le eme o. Nu si nu ɖeɖe le eme ŋu ŋu ɖeɖe ŋu type ɖuɖomenuwo 400.
cURL
curl "https://nymbot.ai/api/v1/models?type=chat"
Python
import requests
models = requests.get("https://nymbot.ai/api/v1/models", params={"type": "chat"}).json()["data"]
for m in models:
print(m["id"], m["balance"], m["pricing"].get("input_per_1M_tokens"))
JavaScript
const res = await fetch("https://nymbot.ai/api/v1/models?type=chat");
const { data } = await res.json();
for (const m of data) console.log(m.id, m.balance, m.pricing.input_per_1M_tokens);