Tlolela ho litaba
Ho khutlela ho Nymbot

Motheo oa tsebo Baetsi ba lenaneo

Lipuisano, Likarabello le Melaetsa

Litsela tse tharo tsa ho botsa mohlala ntho e itseng, ka mofuta o mong le o mong oo bareki ba seng ba o sebelisa, tsohle li sebetsa ka mahlale a mang le a mang mme li lefelloa ka tsela e le ’ngoe.

Katloho ea Lipuisano

Mohlao oa puisano oa OpenAI, le o tšoanang le o amehang ke lisebelisoa tsohle hoo e kenyelletsang. Romela puisano e tsamaeang hona joale mme u fumane molaetsa o latelang.

POST https://nymbot.ai/api/v1/chat/completions — e hloka API key.

Feelo model le messages li hlokahala. Parameter ea sampling eo mofuta o khethiloeng o sa e nkeleng e lahloa ntle le phoso, kahoo mofuta o le mong oa mofuta oa kopo o sebetsa ka mofuta o mong le o mong. Lenneo la mofuta le fana ka ea mofuta ka mong supported_parametersTseo li hanetsoeng ho e-na le ho lahleloa ke ntho efe kapa efe eo mofuta (model) o sa khoneng ho e etsa le le: lifoto bakeng sa mofuta o sa kgoneng ho bona, lisebelisoa bakeng sa mofuta o sa kgoneng ho di bitsa.

NahaNgolaE hlokahalangTlhaloso
modellehalaEenymbot/auto (kapa auto) bakeng sa tsamaiso ea tsela ea Nymbot holim'a lekano e tloaelehileng, kapa id ea mofuta oa katalogo joalo ka anthropic/claude-sonnet-5 ho se le balance ea Pro. Mabitso a khutšoanyane le a mofuta o mong a app a amoheloa le bona. A ka qetella ka a moka.
messagesletšoloEePuisano. Maemo system, developer (tšoaroa joalo ka tsamaiso), user, assistant le tool. Ntho ke molaetsa kapa lenane la text le image_url likarolo; litšoantšo feela litšupanong tsa bareki. input_audio mme karolo tsa mofuta oa khomphutha li hana.
streambooleanCheRomela karabo ka tsela eo e ngotsweng ka yona. Bona ho phalla.
stream_optionsseloChe{"include_usage": true} ho eketsa karolo e qetellang e nang le palo ea li-token le molato.
max_tokens
max_completion_tokens
nomoro eohleCheToken tse ngata ka ho fetisisa ho ngola. Li fokotsoele ho mophetho o moholo oa mofuta (model) ha li le moholo. Hape li beha hore na li tlo tšoaretsoe le amount e kae ho tsoa ho sejo la hau, kahoo palo e nnyane e hloka chelete e nnyane ho qala.
temperature
top_p
nomoroCheLekotlo la mofuta wa mohlala: temperature ho tloha ho 0 ho fihla ho 2, top_p ho tloha ho 0 ho ea ho 1.
stopstring kapa arrayCheMongolo o qetellang karabo: molaetsa kapa mela e mehlano e, molaetsa e mong le e mong o le 256 characters. Ha e sebelisetsoe ke nymbot/auto.
seednomoro eohleCheBakeng kapa ho nka mohlala o phelang, moo mohlala o se nang bokhoni ba sona.
presence_penalty
frequency_penalty
nomoroCheLikhontrole tsa phetapelo, e nngwe le e nngwe ho tloha ho -2 ho isa ho 2.
response_formatseloChe{"type": "json_object"} kapa {"type": "json_schema", "json_schema": {…}}, moo mohlala o o se tšeletsang. Ha e sebelisetsoe ke nymbot/auto.
tools
tool_choice
parallel_tool_calls
array, string kapa object, booleanCheHo bitsa mosebetsi. Bona ho bitsa lisebelisoa. A web_search Sesebelisoa se tšehla batla ho batla marang-rang. Sesifa se fihlang ka lisebelisoana tse 128 le mehlala ea 512 KB, e hloelometseng ka matla a 64 a level; ho feta moo ke a 400.
reasoning_effort
reasoning
karolo ea mongolo, sesebetsiChe"minimal", "low", "medium" kapa "high", kapa {"effort": "high"}. "none" kapa {"enabled": false} o se tima. Bona tlhaloso.
pluginsletšoloChe[{"id": "web", "max_results": 5}] hangata e batla marang-rang pele. Ho fihla liphetho tse 10.
nnomoro eohleCheHo le 1 feela. Seng le mang se khutlisetsa 400.
logit_bias
user
metadata
object, string, objectCheE amohetsoe empa ha e romiloe pele. logit_bias e hlahisa token id tse fetang 300 ho di nomoro ho tloha ho -100 ho ho 100; user ke makhutloanyana a 256 feela; metadata E boloka mehlala ea litemana e fetisisa e 16, lintlha tse fihlang ho litakhasi tse 64 le mehlala e fihlang ho 512.

Karabo ke e tlwaelegileng chat.completion, le litšenyehelo ka usage.cost (ka dinara) le ho nymbot thetho. model na ke id ea mofuta o rarollotsoeng, ka hona lebitso le khutšoanyane le khutloela morao e le lebitso le feletseng. Haeba mofuta o ne o nahanisisa pele o araba, pampano ea hae ea ho nahana e ka har'a message.reasoning_content, a kgaohane ho karabo.

Karabo

{
  "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 ho baloa ho tsoa ho seo se khutlileng, hobane bapalisi ba kaela ka sona ka mokhoa o fapaneng: tool_calls ha mohlala o kopa lisebelisoa, length ha karabo e sebelisitse mofuta o mong le o mong oa mantsoe a lumelletsoeng (kapa mohlala o aamahisitse tsohle a sebelisang ho nahana mme ha a ka a ngola karabo), content_filter ha mofahi a hana, le stop ngapana. usage.completion_tokens_details.reasoning_tokens is always 0: thunyeletso tokens tsa ho nahana li abaloa, ebile li lefishoa, ho completion_tokens.

BoemoNeng
400Che model kapa messages (missing_required_parameter); karolo ea lentswe kapa ea file, kapa litšoantšo bakeng sa mohlala oo o ke keng oa li bona (unsupported_content); litšoantšo tse fetang 20 (too_many_images); parameter ea ho nka mohlala e le mofuta o fosahetseng kapa e ka ntle ho seemo (invalid_value); konnekolo ea seswantšo e sa bulehahaleng (invalid_image_url); lisebelisoa holim'a model e sa khoneng ho li bitsa (unsupported_tool); n ho feta 1; a :thinking sehlakuane se reng ke mofuta oa mohlala o ke keng oa ho nahana (model_not_found); kapa mofahali o lahlehile kopo (upstream_rejected).
402Chelete e setseng eo mohlala o e sebelisang e ke ke ea khona ho lefa ntho e ntseng e tšoaretsoe.
403Boemo bo bobe ka ho fetisisa bo ke bo sa tsamaelane le kapo ea senotlolo (key_limit_reached). Ts'oantšetsa tlase max_tokens kapa o phahamise taipa.
404Ha ho na mofuta ka lebitso leo (model_not_found).
429Bothranoka ea limit ea senotlolo, kapa ea mofahishi (upstream_rate_limited).
502, 503Mofahali o hlolehile (upstream_error) kapa e tletse (upstream_overloaded, le Retry-After). Ha ho ntho e bokelloang ntle le ha mofahi a ka lefisa bakeng sa mofofolo oo.

Lintlha tsa boemo tseo endpoint e nngoe le e nngoe e li abelaneng li ngotsoe ka tlase ho liphoello.

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);

Ho phalla

Le ka "stream": true karabo e fihla e le lisebelisoa tse tsoang sefubeng sa seva (server-sent events) ha mofuta o ntse o e ngola. Mokhoa o monyeti o mong le o mong ke a chat.completion.chunk ka ho a data: mola, mme monyetla o fella ka data: [DONE]. Maikutlo a fihla ka delta.reasoning_content, karabo ka delta.content.

Phallisa ntho efe kapa efe e ka neng ea nka sekondi tse fetang 100, joalo ka karabo e telele, e kholo max_tokens kapa mofuta oa tlhahlobo. Pitso e sa romeloeng ka mokhoa oa stream ha e romele letho ho fihlela karabo e phethehile, 'me sesuri se pakeng tsa u le Nymbot se ka koala tšebelisano e sa sebelisoeng ka mor'a metsotso e ka bang 100; mofuta o sa phethe oa ho ngola o tla qeta 'me seo o se ngotseng se tla lefelloa, empa karabo e lahlehile. Stream e romela litsela tsa ho lula e le tsoeng, kahoo e lula e bulehile nako eohle eo mofuta o ngolang ka eona.

Akama

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]
  • Mela e qalang ka : ke likommense tsa ho boloka tšebetso e ntse e le teng, tse romeloang metsotso e 15 ka lengata ha model e ntse e nahanisisa. Baetsi ba SSE ba li tlolohela.
  • Kopa "stream_options": {"include_usage": true} ho fumana sehlopha se qetellang se ka holimo, ka se sefahloeng se sefela choices, palo ea lere e leng, cost le o nymbot thetho.
  • Tefo e nkuoa ha nōkō e fela. Haeba u koala tlamisano nako e sa le nako, mohlala o ke ke oa emisoa: Nymbot e bala karolo e setseng ea nōkō ea mofahloletsi, ka metsotso e fihlang ka 25, ho fumana palo ea litemana tsa\(t\)s\(a\), mme u lefa seo mofahloletsi a reketisang\(t\)s\(a\). Ntle le palo eo, tefo e akaretsoa ka ho rala ho tsoa ho tsoetso\(t\)s\(a\) ea hau le se se ngotsoeng, e eketsehi\(t\)s\(a\) bohle ba thoho ea mohlala o nahanang.
  • Phoso pele karolo ea pele, joalo ka 401 kapa 402, e khutla e le JSON e tloaelehileng le khoutu ea boemo ba eona, eseng joalo ka ak'hlakofi. Phoso ka mor'a hore ak'hlakofi e qale e fihla e le ea ho qetela data: {"error": {…}} mokhoa, mme mahlale a fela ntle le [DONE].
  • Lipitisetso tse nang le lisebelisoa, le mohlala (models) ka mokhoa oa mofuta oa Responses oa OpenAI, ha li tsoele pele ka mokhoa oa ho rala (stream) ho tsoa ho mofahisi. Li ntse li araba ka mokhoa o nepahetseng oa ho rala, o romeloang ha karabo e phethehile.

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);
}

Dipitso tsa lisebelisoa

Hlalosa mesebetsi ka tools mme mofuta o ka kopa hore ho bitsoe e mong ho e-na le ho araba. O tsamaisa function, o eketsa sephetho sa eona e le a tool molaetsa o le mong le o ne tool_call_id, mme o romele puisano hape. Nymbot ha e tsamaye functions tsa hau; e fetisetsa kopo ea mohlala ho uena hape.

tool_choice tsaya "auto", "none", "required" kapa {"type": "function", "function": {"name": "…"}}Lenaneo la mohlala le a bontša hore ke mehlala efe e ka sebelisang lisebelisoa (capabilities.tools). Lisebelisoa li hanngoa ka 400 unsupported_tool pele nymbot/auto le ho tse nngoe sa mofuta wa katalog o se nang ba bangata o sebetsang ka OpenAI's Responses transport, moo Nymbot e ke keng ya fetisetsa lisebelisoa ho tsona.

Le ka "stream": true, pitso e nang le lisebelisoa e tsamaea ka karolo e le 'ngoe ebe e rometsoa e le lekhetho la likarolo tse tloaelehileng: role, karolo e le 'ngoe e ntseng e tšoere pitso e nngwe le e nngwe ea lisebelisoa e nang le index, id, lebitso le lintlha (arguments), le karolo ea phethelo (finish chunk). Baetsi ba balang litlhophiso tsa lisebelisoa tse rometsoeng ka tsela e tsoelang pele ba li sebetsa joalo ka tloaeli.

Karabo, ka karolo

"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);

Litšoantšo ka har'a kopo

Dimodelo ka capabilities.vision ho ka bala litšoantšo. Kenya image_url karolo ea molaetsa oa moelebi, le e 'ngoe ea e sechaba https:// link kapa a data:image/…;base64, URL. Ho fihlla litšoantšo tse 20 ka kopo. Litšoantšo tsa SVG li hana, ha hona joalo le konokono e fetang litakhahlo tsa 4,096 kapa e nang le lebitso la mochini kapa lenaneo la ho kena (400 invalid_image_url). E u khethahamang detail ke auto, low kapa high.

Le ka nymbot/auto, kopo e nang le setšoantšo e romeloa ho mofuta oa motheo o ona o khonang ho bona. Mofuta oa katala o se nang capabilities.vision o hana litšoantšo ka 400 unsupported_content. Litšoantšo li ka ba litabeng tsa mosebelisi feela. Lintlha (link) li tlameha ho nka mohloli oa sechaba; Nymbot e fetisetsa foto ho mofumahali oa mofuta (model's provider) 'me ha e e boloke.

Setšoantšo se lefelloa joalo ka token tsa mosebetsi tseo mofaki a li balang bakeng sa sona, joalo ka karolo e ling tsa phetiso.

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);

Ho nahanisisa

Dimodelo ka capabilities.reasoning ba ka nahanisisa pele ba araba. Kopa ho ba ngata kapa ho ba hanyane ka tsona ka reasoning_effort ("minimal", "low", "medium" kapa "high") kapa "reasoning": {"effort": "high"}, kapa kenya :thinking lebitso la mohlala, le bolelang boitlamo bo boholo. Ho mohlala o se nang teloishoano (reasoning) tatiso ena e hlokomolohloa. Ka nymbot/auto, :thinking ea romela pampiri ea kopo tshelong ea tloaelehileng ea bohlale.

Ho mahlale a Anthropic boitelo bo fetoha lenaneo la ho nahana la hoo e ka bang 1,000, 2,000, 8,000 kapa 16,000 tokens, eseng ho feta hoo ho ka bang max_tokens ea lumella. Ho nahanisisa ho saloa morao ha... tool_choice ho tlatsa sebelisoa, 'me ha kopo e tsoela pele ka mofuta oa sebelisoa o phelang (tool loop) (molaetsa oa oa morao ke sephetho sa sebelisoa), hobane Anthropic e hloka ho nahana (thinking) ho sa le kapele ho tsoela pele ka tsona. Taba e tšoana e sebetsa le mekha (endpoints) ea Responses le Messages.

Ho nahana ho kena hape message.reasoning_content, kapa delta.reasoning_content ha u romela, u se ke ua kopanya le karabo. Ho hlalosa ke sebetselwa mme ho lefishwa joalo, ka hare completion_tokens. Litšebeletso tse ling ha li khutlise text ea lintlha leha e le letho, empa ho ntse ho lekolloa.

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);

Lihlelo tsa qetello tsa mofuta

Sebopeho se se eketsoang qetellong ea lebitso la mohlala se fetola mokhoa oo kopo e sebetswang ka oona, ntle le sebaka se seng se se nngwe. Sebetša lintlha tse feletseng le mabitso a mafutifuti, joalo ka anthropic/claude-sonnet-5:online.

Sefela-qetelloPhello
:onlineBatla marang-rang pele, jwaloka plugins: [{"id": "web"}]. Bona batla ho batla marang-rang.
:thinkingBoitlamo bo bo phahameng ba ho nahana; on nymbot/auto, tsela ea ho nahana. Holim'a mofuta o ke keng oa ho nahana, 400 model_not_found ka “ha ho fumaneheng liphetho letho”.
:nitro, :floor, :exacto, :extendedHo amoletsoe ebile ho hlokohlelitsoe. Mofuta o mong le o mong oa katala o na le tsela e le 'ngoe, kahoo ha ho na e neng e le potlakile, e fokolang kapa e telele ho e khetha; litšoantšiso li lumelloa e le hore mabitso a mofuta a kopitsoeng litšebeletso tse ling a ntse a sebetsa.

Litlhaku tse ling tseo ho tloaelletsoeng ka tsona li hlokomolohoa. Lebitso kaofela le leketsoa pele, kahoo mofuta oo id ea hae e nang le khonoloni (:) e sebetsa; haeba seo se hloleha, litlhaku tse eketsehileng li khetloa ho tloha qetellong ka nako e le nngwe ho fihlela mofuta o lekana. Lebitso la mofuta le ka ba le litlhaku tse eketsehileng tse ngata ho feta litlhaku tse 200 le tse eketsehileng tse 4; le le leng le le telele le hana ka 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);

Mofuta ofe kapa ofe oa puisano o ka araba ho tsoa marang-rang a phelang. Nymbot e batlisisa molaetsa oa ho qetela oa moetsi (karolo ea pele ea litakhahiso tse 2,000), e bala liphepha tse molemo haholo mme e li fa mofuta oo le potso, e li laetsa e le litaba tsa kantle tseo mofuta oo a ke keng a amohela litaelo ho tsoa ho tsona. Ho na le mefuta e 'meli:

  • Nako le nako batla: "plugins": [{"id": "web", "max_results": 5}], kapa a :online sebeluo se se hlahang qetellong ea mofuta.
  • Batlisisa ha se thusa: "tools": [{"type": "web_search", "parameters": {"max_results": 5}}], hape etelleloa e le web_search_preview kapa openrouter:web_search. Nymbot e batla feela ha potso e shebahala e hloka tlhahisoleseding ea hona joale, tlhahlobo e tšoanang eo app e e sebelisang.

max_results ke 5 ka tlhophiso mme e le ho se fetisise ho 10. Mehloli e tla khutla ka nymbot.web_search.sources, e nngwe le e nngwe ka a title, snippet le url, le ha url_citation litlhaloso holim'a molaetsa.

Lipatlisiso tsohle tse tsamaeang li qeta $0.008, tse fetolethileng ho sats, ho eketseha litoken, mme ke karolo ea hold. Liphepha tseo e li balileng ke litoken tsa mosebetsi le tsona, kahoo karabo e tsoang web e qeta ka holimo ho potso e tšoanang e botsitsoeng ntle le ho batlisisa, hangata e qeta ka makgetlo a mangata ho feta.

Karabo, ka karolo

"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);

API ea Litaba tsa Karabo

Sebopeho se secha sa OpenAI, se sebelisoang ke OpenAI Agents SDK le ke Codex. Se sebetsa ka mofuta o tšoanang oa mehlala, telo le litšebeletso joalo ka Chat Completions.

POST https://nymbot.ai/api/v1/responses — e hloka API key.

NahaNgolaE hlokahalangTlhaloso
modellehalaEeHa e le ka Katloho ea Lipuisano, liponafatso li kenyelletsoe.
inputstring kapa arrayEeMolaetsa, kapa lenaneo la lintho: melaetsa (mosebetsi user, assistant, system, developer) le input_text, input_image le output_text karolo, le function_call le function_call_output lintho bakeng sa lisebelisoa input_image o nka image_url link kapa data URL, eseng file id. reasoning le web_search_call lintho li itšoarelitsoe; item_reference ho hana.
instructionslehalaCheDitaelo tsa tsamaiso.
max_output_tokensnomoro eohleCheLintlha tse ngata ka ho fetisisa tsa ho ngola.
temperature
top_p
nomoroCheDikontrole tsa ho nka mohlala, moo mohlala o li nkelang.
tools
tool_choice
parallel_tool_calls
array, string kapa object, booleanCheLisebelisoa tsa function, ka sebopeho sa Likhangetso ({"type": "function", "name": …, "parameters": …}). A web_search kapa web_search_preview Sesebelisoa se tšehla batla ho batla marang-rang ha e thusa. Lisebelisoa tse ling tse kenngiloeng ha li amoheloa.
reasoningseloChe{"effort": "minimal" | "low" | "medium" | "high"}. xhigh le max ho bolela high; none o e tima.
text.format
response_format
seloCheSephetho se hlophisitsoeng, jwaloka JSON schema kapa json_object.
metadataseloCheE khutlisitsoe ntle le phetoho karabong. Liphetolelo tsa mantsoe tse ngata ka tlase ho 16, lintlha (keys) tse fihlang ho 64 tsa litlhaku le liphetolelo (values) tse fihlang ho 512.
streambooleanCheFetolisa liketsahalo joalo ka ha ho hlalositsoe ka tlase.
storebooleanCheHo hlokomolositsoe. Ha ho motho ea bolokehileng, 'me karabo e lula e re "store": false.
previous_response_id
conversation
background
morao, ntho, nnete/fokoloCheHa e tšehetsoe: 400 unsupported_parameterLikarakisi ha li bolokoe, kahoo romela puisano kaofela e le teng input ka nako le nako.

Karabo

{
  "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 }
}

Ho bonahala pitso ea sesebelisoa ho output joaloka a function_call thetho le call_id, name le arguments; romela sephetho morao e le function_call_output thetho e tšoanang le eona call_id. Tlhahlobo, ha modeli e e fana ka eona, ke reasoning thetho le reasoning_text foset, e ntseng e le ea pele. status ke incomplete ha karabo e fihla max_output_tokens kapa mofahisitseluo a hana, le incomplete_details.reason be kiba ho max_output_tokens kapa content_filterKarabo e boetse e hlahisisa litlhophiso tsa kopo (temperature, tools, tool choice le tseo!) jwaloka ha OpenAI e etsang, hape e na le nymbot Selo sa tšehiso

E tsamaisitsoeng, sebaka se seng le se seng ke event: mola le a data: lekhala le nang le a sequence_number, ka tlhophiso ena: response.created, response.in_progress, response.output_item.added, response.content_part.added, palo efe kapa efe ea response.output_text.delta, response.output_text.done, response.content_part.done, response.output_item.done, mme qetellong response.completed ka tšebeliso le moralo. Karabo e kgaotseng e fella ka response.incomplete ho e-na le, le ho ho hloleha ha morao ho qalo ea phlooquetso ka response.failed. HoNahisetsa mereriso e le thepa ea eona ka response.reasoning_text.delta le .done. Litšebetso tsa sesebelisoa li tla ka mor'a molaetsa, e ’ngoe le e ’ngoe e le ntho e nang le response.function_call_arguments.delta le .done.

BoemoNeng
400Che model kapa input; previous_response_id, conversation, background kapa item_reference (unsupported_parameter); sehlahiswa kapa mofuta wa litaba o sa tšehetsoeng.
402, 403, 404, 429, 502, 503Ha re bua ka Chat Completions.

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);

Melaetsa ea Anthropic

Sebopeho sa Anthropic, bakeng sa SDK tsa Anthropic le Claude Code. Se sebetsa le mofuta o mong le o mong o ka katala, eseng feela Claude: kopo e fetoleloa, e tsamaisoa ka mosebetsi o le mong, ebe e fetoleloa morao.

POST https://nymbot.ai/api/v1/messages — e hloka API key, jwalokaha x-api-key kapa Authorization: Bearer.

Ha ho na lentsoe le le kang "the" ka Sesotho. anthropic-version le anthropic-beta lisebelisoa tsa hlooho (headers) li amoheloa hape li hlokomolohloa. Mabitso a mohlala oa Anthropic a kopanyoloa le katalaogo, kahoo Claude Code le SDKs li sebetsa ka mabitso ao ba se ba li sebelisa:

  • Lebitso leo katalao e le tsebang, joalo ka claude-sonnet-5 kapa anthropic/claude-opus-5, e sebelisoa joalo ka ha e le jalo.
  • Ntle le letsatsi (-20260514), -latest, letšoantšo la sesebelisoa sa version joalo ka -v1, leiketso e khetiloeng joalo ka [1m] le le anthropic/ kapa anthropic. ho tlosa matšoao a mathomo, 'me lintlha le mela ka har'a mofuta e lebeloa ka litsela tsohle (claude-haiku-4-5 liphoofolo claude-haiku-4.5).
  • Haeba seo se sa ts'wanele letho, lelapa (Opus, Sonnet kapa Haiku) le sebelisoa, haeba feela version ea catalog e le e le keng kapa e ncha ho e bontšitsoeng.
  • Lebitso le se lekanang le letho le khutla. 404 not_found_error.
NahaNgolaE hlokahalangTlhaloso
modellehalaEeID ea mohlala oa cathalo, kapa lebitso la mohlala oa Anthropic.
max_tokensnomoro eohleEeLintlha tse ngata ka ho fetisisa tsa ho ngola.
messagesletšoloEeuser le assistant mehlala, le text, image (base64 kapa mohlala oa URL), tool_use le tool_result liboto. thinking libolo tsa likhetho tsa pele li amohelwa mme li lahleloa.
systemstring kapa arrayCheLenaneo la tsamaiso, jwaloka molaetsa kapa bloktara tsa mongolo.
temperature
top_p
nomoroCheDikontrole tsa ho nka mohlala, moo mohlala o li nkelang. top_k e amoletsoe mme ea lahlooa.
stop_sequenceslehlakorela la lipoleloCheMongolo o qetellang karabo. Sebapali se le 4, e ’ngoe le e ’ngoe e le tse max 256 tsa litlhaku.
tools
tool_choice
array, objectCheLisebelisoa le name, description le input_schema. A web_search sebelisoa sa sekhoutu se tsoha batla ho batla marang-rang; Lisebelisoana tse ling tse kenngotsoeng tsa Anthropic (bash, text editor, computer use) li hana ka unsupported_tool. tool_choice tsaya auto, any, tool kapa none, le disable_parallel_tool_use.
thinkingseloChe{"type": "enabled", "budget_tokens": 8192}, {"type": "adaptive"} kapa {"type": "disabled"}. Tekolotso e khetha boemo ba boikemisetso: ka tlas'a 2,048 e nyenyane, ho tloha 2,048 e tlase, ho tloha 8,192 e sejoale, ho tloha 16,384 e phahameng. Adaptive e sebelisa output_config.effort, kapa e phahameng.
streambooleanCheStream ka mokhoa oa ketsahalo ea Anthropic.
metadataseloCheE amoletsoe hape ea tloloa.

Karabo

{
  "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 ka nna ea tšoara hape tool_use libalke le a thinking blok, ea nang le signature ke se se se nang letho. stop_reason ke end_turn, max_tokens, tool_use kapa refusal, ho rarollotsoe ka tsela e le 'ngoe joalo ka finish_reason pele Katloho ea Lipuisano; stop_sequence ho lula ho le jwalo null, leha e le ha mokhoa oa ho emisa o felisitse karabo. input_tokens eba mosebelo o mocha feela; mosebelo o bolokiloeng o lifelong tse peli tsa boloko. Tlaelo e le ho... nymbot selo le... X-Nymbot-Cost-Sats hlooho

Ha ho tsamaisoa ka ho phalla, lintlha ke tsa Anthropic: message_start, content_block_start, ping, content_block_delta (text_delta, input_json_delta kapa thinking_delta), content_block_stop, message_delta ka lebaka la ho emisa, tšebeliso le le nymbot sebaka sa mello, le message_stop. A ping e rometsoa hang le li sekondi tse 15 ha mofuta o sebetsa. Litlhophiso tsa sesebelisoa li fihla ka mor'a mongolo, e 'ngoe le e 'ngoe e le a tool_use blok ka mofuta oohle oa lona oa kenyo ka nngwe input_json_delta.

Liphoello ho endpoint ena li sebelisa mokhoa oa Anthropic: {"type": "error", "error": {"type": "not_found_error", "message": "…"}}. A baepeli ba fokolang ke 402 billing_error, mofahisi ea tlamehileng haholo 503 overloaded_errorHo hloleha ka mor'a hore phephetso e qale e rometsoe joaloka an error mohlala.

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);

Ho bala litorrente

Karakatisi ea hore na lipheto e ka sebelisa li-input token hakae, e le hore mosebelisi a khone ho hlahloba pele a romela. Ke mahala, empa e hloka 'key'.

POST https://nymbot.ai/api/v1/messages/count_tokens — e hloka API key. Mahala.

Mmele o tshwana le oa Melaetsa, ntle le max_tokens; lebitso la mofuta le tlameha ho hlalosoa. Palo ke qaleho: litlhaku tsa mokhoa oa tsamaiso, lipuisano, litlhophiso tsa lisebelisoa le litlhaloso tsa lisebelisoa tse arolitsoeng ka mane, ho eketseletsoa 1,600 bakeng sa seswantsho ka Sesanti. Hase tokenizer ea mofumahali ka boyona, kahoo palo ea nnete e ka fapana. Sefate se fihleng qetellong ea sona se tsoela pele ho se sebelisa.

Karabo

{ "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);

Ho bapatsa mofuta o mong le o mong

Mofuta o mong le o mong le generator eo API e e amohelang, hammoho le hore na li lefelloa hoo. Lenane le baloa ho kataloge e phelang e le ngo le e le ngo e sebelisoang ke sekopanya sa app, kahoo hangata ke seo se tla se sebetsa sekhobolo.

GET https://nymbot.ai/api/v1/models — ha ho hlokahale senotlolo. E bolokehiloe ka metsotso e hlano.

GET /api/v1/models/{id} e hlahisa rekoto e le 'ngoe.

NahaNgolaE hlokahalangTlhaloso
typemola oa litlhaku (potso)Chechat (ea tloaelehileng), image, video, audio, embedding kapa all. Ho ka fanoa tse supileng, jwalokaha image,video.

Litlhahlo e ke tseo o lefelang tsona, ka tefo le margin e seng e le teng, ka dintja le ka sats ka taelo ea Bitcoin ea hona joale. balance ho bolela hore ke leketla lefe le mohlala o chelileng. nymbot_key na lebitso le khutšoanyane la mohlala le ka har'a app. created is always 0, hobane katala ha e ralele nako eo mofuta o ile o eketsehileng ka yona. Mofuta o se nang litekanyo tsa token tse bontšitsoeng ke litheko ea per_request ho e-na le hoo.

nymbot/auto hangata ke oa pele, litheko li joalo ka variable, le ho routes Lenane le fanang ka litlhahloebo tsa tsela e nngwe le e nngwe ea tloaelehileng. Le bontša pono le nahanong, empa ha le bontše lisebelisoa.

GET /api/v1/models/{id} o amogela lebitso le le felang le lebitso la sephiri le tšoanang le kopo, eaba o kenya taelo ea sehlopha seo li eamogelang ka sona.

Karabo

{
  "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"
    }
  ]
}

Mefuta e meng:

  • Setšoantšo linotlolo li na le capabilities (accepts_image_url, requires_image_url, edit) le tlhaho per_generation.
  • Video linotlolo li na le max_duration_seconds le resolutions, le leemo per_second bakeng sa qeto eዧng le eዧng.
  • Molumo linotlolo li na le audio_type speech kapa transcription, ke ka tlhaho ea tlhaho per_1k_chars kapa per_minute.
  • Ho kenngoa linotlolo li na le dimensions, context_length, max_inputs le leihlohloko la tšhelete bakeng sa input tokens tse melione e le 'ngoe.

Litlhahlo li bontšitsoe "estimated": true ke akanyo ea app ea generator e leyo e sa bontšoe haholo. E sa tsebahaleng type liphoilo 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);