Te turanga matauranga Kaiwhakawhanake
Kōrerorero, Ngā whakautu me ngā karere
E toru ngā huarahi hei pātai ai i tētahi kōpato i tētahi mea, i roto i ngā tauira e toru e kōrerotia ana e ngā kaiwhakamahi anō, e rere ana katoa i runga i ngā kōpato e rite ana, ā, e utu ana i te huarahi kotahi.
He mihini tenei wharangi kia pai ai. Ko te reo Ingarihi taketake te putanga e tika ana.
Whakaputa Kōrero Atāwhai
Te hanganga kōrerorero a OpenAI, me te hanganga e tautoko ana e ia taputapu tata kō atu. Tuku te kōrerorero i tēnei wā, ka hoki mai te kaupapa kōrero kei muri ake.
POST https://nymbot.ai/api/v1/chat/completions — me he kupu raihirangi API.
Anakei model a messages he hia ana. He tauira parameter kaore i mau e te
model i kōwhiria ka riro atu me te kore he hapa, kia mahi ai he rerekē te kaha o te rerekētanga o te rerekē i roto i ngā model katoa. Ko te
rārangi model e whakaatu ana i te mea ia model supported_parametersKo te mea e whakahētia ana, kaua ko te tukuna noa, ko ia he mea kāore e taea e te mahere e mahi i te mea katoa: ngā pikitia mō tētahi mahere e kore e taea te kite, ngā taputapu mō tētahi mahere e kore e taea te karanga i a rātou.
| Papa | Mahere | Kia hiahiatia ana | Whakaahua |
|---|---|---|---|
model | kōpaka | Ae | nymbot/auto (or auto) mō te rārangi tūnga a Nymbot i te taurite matua, me he ID tauira pukaihono pēnei i te anthropic/claude-sonnet-5 i te tauira Pro. Ka whakaaeatia hoki ngā ingoa poto me ngā ingoa kē o te app. Ka taea te mutu i te a tāpiritanga. |
messages | papa whakarite | Ae | Te kōrerorero. Ngā tuarua. system, developer (whakaatahia hei pūnaha), user, assistant a tool. Ko te He o Waituhi he rārangi rānei o text a image_url ngā waahanga; ngā whakaahua anake i roto i ngā karere a te kaiwhakamahi. input_audio e whakahētia ana ngā wāhanga o te horopaki. |
stream | tūponotanga | Kāore | Tukuna te whakautu kia rite tonu ki te tūruhi i tuhia ai. Titiro tuku mahi. |
stream_options | whakawhitiwhiti | Kāore | {"include_usage": true} tāpiri he wāhanga whakamutunga me ngā tau o te token me te utu. |
max_tokensmax_completion_tokens | tau kōpaka | Kāore | Ko te maha rawa o ngā tāpae hei tuhituhi. Ka whakaiti ki te rongoa nui rawa o te tauira ki te heke ake i taua. Ka whakarite hoki i te nui o te mea e tūturu ana i tō tauira, nō reira he iti ake te tau ka hiahiatia he iti ake te pūtea hei tīmata. |
temperaturetop_p | tau | Kāore | Ngā tohu tauira: temperature mai i te 0 ki te 2, top_p mā te 0 ki te 1. |
stop | kōrero rānei he rārangi? | Kāore | He kupu ka mutu ai te whakautu: he rārangi kupu rānei he rārangi kupu e toru neke atu i te mea, he rārangi katoa e kore i oti i te 256 ngā karata. Kāore e whakamahia e nymbot/auto. |
seed | tau kōpaka | Kāore | Mō te sampling e taea te whakakāinga nei, i te wā e tautoko ana te tauira i tēnā. |
presence_penaltyfrequency_penalty | tau | Kāore | Ngā whakamātau whakakāinga, tētahi i ia rā mai i -2 ki te 2. |
response_format | whakawhitiwhiti | Kāore | {"type": "json_object"} kei te mea anō {"type": "json_schema", "json_schema": {…}}, i te mea e tautoko ana te tauira. Kāore e whakamahia e nymbot/auto. |
toolstool_choiceparallel_tool_calls | raraunga, kōrero, rārangi rānei, tūmatatenga, tūturu | Kāore | Whakarite mahi. Tirohia pātai taputapu. A web_search ka whakakā te taputapu rapu web. He mea nui rawa ko te 128 ngā taputaki me te 512 KB o ngā whakamārama, e pupuri ana i te 64 ngā taumata ki roto; he nui ake ko tētahi a 400. |
reasoning_effortreasoning | tātai, mea | Kāore | "minimal", "low", "medium" kei te mea anō "high", ki te mea ko {"effort": "high"}. "none" kei te mea anō {"enabled": false} whakakore ia. Tirohia whakaaro. |
plugins | papa whakarite | Kāore | [{"id": "web", "max_results": 5}] he aha tonu te tūmatatari i te ipurangi i mua atu. Ka tae ki te 10 ngā huarahi. |
n | tau kōpaka | Kāore | Ko te 1 anake. He mea kē atu ka hoki mai 400. |
logit_biasusermetadata | whakaahua, kōrero, whakaahua | Kāore | Tāuptohia, kāore hoki i tuku atu. logit_bias ka whakarite i te nui o 300 token ids ki ngā tau mai i -100 ki te 100; user he 256 ngā tohu i te mea nui atu; metadata e pupuri ana i te nui rawa ko te 16 ngā uara string, ngā kaupapa ki te 64 ngā pūtake reta me ngā uara ki te 512. |
He whakautu noa iho te āhua o te whakautu chat.completion, me te utu i roto i usage.cost
(ki ngā tārau) me i roto i te nymbot whakaaturanga. model ko te id o te mahere kua whakatau,
nā reira he ingoa iti te hoki mai hei ingoa tino katoa. Ki te whai i te mahere te mahere i mua i te whakautu, ko tōna
whakaaro kei roto message.reasoning_content, whakarerekē i te whakautu.
Whakaaronga
{
"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 he whakatau i te mea i hoki mai, nō te mea ka pūrongo rerekē ngā kaiwhakarato: tool_calls i te wā i pātai ai te tauira mō ngā taputaki, length i te wā
i whakamahia ai ngā toku katoa e taea ana te whakautu (peka rānei i whakamahi katoa te tauira mō te whakaaro ka kore he
whakautu), content_filter i te wā i whakakore ai te kaiwhakarato, ā stop
tēnā rā anō. usage.completion_tokens_details.reasoning_tokens he 항상 0: huna
ngā tohu whakaaro e tauria ana, ā, ka whakataunga, ki roto i completion_tokens.
| Tikanga Matua | Ahihi |
|---|---|
400 | Kāore model kei te mea anō messages (missing_required_parameter); he wāhanga rongo, he wāhi rānei hāngai ki te tuhi, he whakaahua rānei mō tētahi tauira e kore e taea te kite i a rātou (unsupported_content); nui ake i te 20 ngā whakaahua (too_many_images); he whakamātau tauira hapa te momo, he kei waho hoki i te wātea (invalid_value); he hono whakaahua kāore e nohohia i te ao tūroa (invalid_image_url); ngā taputapu ki runga i tētahi tauira kāore e taea te karanga i a rātou (unsupported_tool); n ahi ake i te 1; a :thinking tohu i muri ki runga i tētahi tauira e kore e taea te whai whakaaro (model_not_found); i te kore a te whakahokia a te tono e te kaiwhakahaere (upstream_rejected). |
402 | Kaore e taea te tau o te moni ka whakamahi a te tauira te rāhui e whai ake ana. |
403 | Kāore te mea kino rawa e hāngai ana ki te kapu o te tīki (key_limit_reached). Whakamāmā iho max_tokens ranei me whakawhānui te rāhui. |
404 | Kāore he tauira i tēnei ingoa (model_not_found). |
429 | Ko te rātea whakahimititanga o te tuakiri, i te mea o te kaiwhakarato rānei (upstream_rate_limited). |
502, 503 | Kua pakaru te kaiwhakahaere (upstream_error) rānei he kī pū (upstream_overloaded, me Retry-After). Kāore he utu kia oti rawa te whakatutuki a te kaiwhakahaere mō te ngana. |
Kei raro i te rārangi ngā kōti kōtuhi i tō katoa ngā pae mutunga ngā hapa.
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);
Whakaata mai noa atu
me "stream": true ka puta te whakautu hei ngā rārangi whakapuaki mai i te tūāpapa i te wā e tuhituhi ana te tauira i te mea. Ko ia rārangi he a chat.completion.chunk ki runga i a data: tātai, ā te
mutunga o te wai o te awa me data: [DONE]. Ka tae mai te whaiwhakaaro ki roto i
delta.reasoning_content, te whakautu i roto i delta.content.
Whakamāramatia he mea katoa ka taea e te wā e neke ake ana i te 100 iho i te hātea, pēnei i tētahi whakautu roa, he nui rānei
max_tokens nā rānei he mahara whakaaro. Ko te tono kāore e rere (streamed) e kore e tuku i tētahi mea mō te wā e oti ai te whakatau, ā, ka huri te hononga waimea i waenga i a koe me Nymbot i muri i te 100 sekona; ka mutu tonu te mahara, ā, ka utu te mea i tuhia, engari ka ngaro te whakatau. Ko te rere e tuku ana i ngā 'keep-alive', kia noho pai ai te hononga i te wā katoa e tuhia ana e te mahara.
Awa
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]
- Ngā rārangi e tīmata ana ki
:he whakamāramatanga keep-alive ēnei, ka tuku ia 15 hāora i te wā e whakaaro ana te tauira. Ka whakahokia e ngā kaipono SSE ēnei. - Pātai atu mō
"stream_options": {"include_usage": true}kia tae atu ki te waahanga whakamutunga i runga, me te kore hechoices, ngā tauira token, te utu me tenymbotwhakaaturanga. - Ka whakatūngia te utu i muri i te mutunga o te rerenga. Ki te kati koe i te hononga i mua i te mutunga, kaore te tauira e mutu: ka pānui a Nymbot i te tohu o te rerenga o te whakarato, mō te rārangi atu i te 25 hētanga, kia whiwhi ai i te tauhenga token, ā, ka utu koe i te mea i arotakehia e te whakarato. Ki te kore i te tauhenga, ka whakarite te utu i runga i tō kōrero me te mea i tuhia, me te katoa o te whakaaetanga whakakī mō tētahi tauira e whai whakaaro ana.
- He hapa i mua i te wāhanga tuatahi, pēnei i a
401kei te mea anō402, hoki mai ana hei JSON noa iho me tōna status code, ehara i te stream. He hapa i muri i te tīmata o te stream ka tae mai hei te whakamutungadata: {"error": {…}}tūnga, ā, ka mutu te rere me te kore[DONE]. - Ngā tono me ngā taputapu, me ngā tauira i runga i te Responses transport a OpenAI, e kore e rere mai i te kaiwhakarato. Ka whakautu tonu rātou ki te rere tika, e tuku ana i te wā ka oti te whakautu.
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);
}
Ngā pango taputai
Whakaritea ngā mahi ki roto i tools ā, ā, ka taea e te tauira te pātai kia whakatinatia tētahi i te mea
he whakautu. Ka whakahaere koe i te mahi, ka tāpiri i tōna hua hei a tool kaupapa pēnei tonu
tool_call_id, ā, tuku anō te kōrerorero. Kāore e whakahaere i ō ngā mahi a Nymbot; ka hoki te tono a te tauira ki a koe.
tool_choice mātau "auto", "none",
"required" kei te mea anō {"type": "function", "function": {"name": "…"}}.
E tohu ana te rārangi tauira i ngā tauira e taea ana te karanga i ngā taputapu (capabilities.tools). He taputapu kei te
whakakorehia me te 400 unsupported_tool i runga nymbot/auto ā me
ngā tauira katalog iti e rere ana i te pae tūhono Responses a OpenAI, e kore e taea e Nymbot te tuku i ngā taputaki
ki a ia.
me "stream": true, he tono me ngā taputaki e rere ana hei kotahi waahanga, ā, ka tuku kia rite ki te
rārangi tūpono noa: te kaupapa, he waahanga e whakawhiti ana i ngā karere taputaki katoa me ā rānei index, id, ingoa me ngā
whakawhitiwhiti, me te waahanga whakamutunga. Ngā kaipono e pānui ana i ngā karere taputaki e rere ana ka whakahaere i te mea hei noa iho.
Whakautu, i roto i tētahi wāhanga
"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);
Ngā whakaahua i roto i tētahi tono
Ngā tauira me capabilities.vision ka taea te pānui i ngā pikitia. Tāpirihia he an image_url
wāhanga ki tētahi rongoako a te kaiwhakamahi, me tētahi i te tūmatanui https:// hononga rānei he
data:image/…;base64, URL. Ka taea te tuku whakaahua e upu 20 i ia tono. Ka kore e whakaae ngā whakaahua SVG, me te hono e nui ake i te 4,096 ngā tohu, mō te rārangi hono e whai ana i tētahi ingoa pānga rānei he kōrero huna rānei i roto (400 invalid_image_url). He kōwhiringa detail he
auto, low kei te mea anō high.
me nymbot/auto, he tono kei roto he pikitia e haere ana ki tētahi tauira tere ki te kite. He tauira katalogā kore... capabilities.vision whakakore i ngā whakaahua me
400 unsupported_content. Ka taea tonu te puta i roto i ngā karere a te kaiwhakamahi anake. Ko te hono me e whakaatu ana ki tētahi tūmatanui; ka tuku a Nymbot i te pikitia ki te kaiwhakahaere o te tauira, ā, kāore ia e noho mō ia.
Ka whakataunga he pikitia hei ianga tōku, pēnei i ngā tōtika rānei o te tono katoa e taupua ana te kaiwhakarite.
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);
Whakaaroaro
Ngā tauira me capabilities.reasoning ka taea te whakaaro i mua i te whakatapu iho. Pātai atu mō te nui ake, te iti rānei o ia mea me reasoning_effort ("minimal", "low",
"medium" kei te mea anō "high") nekehe "reasoning": {"effort": "high"}, rānei
tāpiri :thinking ki te ingoa o te tauira, e tohu ana he mahi nui. Ki runga i tētahi tauira kāore e whai whakaaro, ka kore e whai take te whakamahinga. Me nymbot/auto, :thinking tuku te
tono ki te huarahi whaiwhakaaro tapatahi.
Ki ngā tauira a Anthropic, ka huri te mahi hei tahua whakaaro e tata ana ki te 1,000, 2,000, 8,000 rānei 16,000
tokens, e kore e nui ake i tēnā max_tokens āhei. Ka whakarerea te whakaaro i te wā
tool_choice ka whakahau i tētahi taputapu, ā, ina haere tonu te tono ki te huringa taputapu (ko te tuओंa i muri iti rānei te huarahi whakamutunga he tukunga taputapu), no te mea me te whakaaro whāiti i whakamākatia i mua kia taea te whakaoho anō e Anthropic.
E pēnei tonu hoki i ngā mutunga Responses me Messages.
Ka hoki mai te whaiaro matapaki message.reasoning_content, ki te mea ko
delta.reasoning_content i te takatū streaming, kaua e whakauria ki te whakautu. Ko te whakaaroaro he
hua ake i te tukuna ā, ā, ka whai utu hei mea pēnei, i roto completion_tokens. He kaiwhakahaere kē kāore e
tukuna i te mea katoa te tuhinga whaiwhakaaro, ā, ka whai utu tonu.
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);
Ngā tūmomo whakaoti tauira
Ko te suffix ki te ingoa tauira e huri ana i te huarahi e whaihua ai te tono, me te kore tētahi ingoa hou.
He mahi tahi rāua ki ngā id katoa me ngā ingoa iti, pēnei i anthropic/claude-sonnet-5:online.
| Takiū | Hua |
|---|---|
:online | Tirohia i te pae ipurangi i mua, pēnei plugins: [{"id": "web"}]. Tirohia rapu web. |
:thinking | Ngākau nui ki te whai mātauranga; kei te whakaoho nymbot/auto, te huarahi whai whakaaro. Ki runga i tētahi tauira kāore e taea te whai whakaaro, 400 model_not_found me “kāore he mutunga e kitea ana”. |
:nitro, :floor, :exacto, :extended | Whakaaeatia, ā, kore e whai take. He huarahi kotahi tā ia tauira katāloga, nā |
Ka kore tētahi tae i muri atu i te ingoa. Ka whakamātau i te katoa i te tīmatanga, nō reira he tautoko tonu te tauira e heke ana i te id he tae kei roto; ki te kore e taea, ka tango i ngā tae i te mutunga kotahi kotahi i te wā kia kitea te tauira e hāngai ana. He nui rawa te 200 ngā tūrua i te ingoa tauira me te mea he nui rawa te 4 ngā tae; ka whakakorehia te mea roa ake ki te 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);
Rapu web
Ka taea e tētahi kaupapa kōrero noa atu te whakataki mai i te pūrerehua o te ao mārama. Ka rapu a Nymbot i te kōrero whakamutunga a te kaiwhakauru (ngā 2,000 o ngā tohu tuatahi), ka pānui i ngā whārangi pai rawa, ā ka tukuna ki te kaupapa kōrero me te pātai, e tohu ana hei wāhanga i waho o te mahi kia kaua e whai i ngā tohutohu. He rerenga rua kei te mea:
- Rapu i ngā wā katoa:
"plugins": [{"id": "web", "max_results": 5}], kei te a:onlinehe suffix i runga i te tauira. - Whakamātua i te wā e āwhina ana:
"tools": [{"type": "web_search", "parameters": {"max_results": 5}}], hoki kia whakaaea hoki heiweb_search_previewkei te mea anōopenrouter:web_search. Nymbot te rapu anake i te wā e rite ana te pātai ki te hiahia i ngā raraunga o te wā nei, te tirotiro rānei e whakamahia ana e te app.
max_results he 5 tēnei i te tīmatanga, ā, he 10 te nui rawa. Ka hoki mai ngā puna ki roto i
nymbot.web_search.sources, kia tētahi me te title, snippet a
url, ā ko url_citation Ngā whakamāramatanga ki te karere.
Ko ia rapu e rere ana e utu ana i te $0.008, ka huri ki te sats, i runga i ngā token, ā, he waahanga o te hold. Ko ngā rāpagei i pānuitia he token input hoki, nō reira he utu nui ake te whakautu mai i te ipurangi kia kei te pātai anō i te kore, i ētahi wā he maha atu i te utu noa.
Whakautu, i roto i tētahi wāhanga
"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 o ngā whakautu
Te āhua hou ake a OpenAI, e whakamahia ana e te OpenAI Agents SDK me te Codex. E rere ana i runga i ngā tauira, i ngā utu, me ngā āhua katoa e rite ana ki te Chat Completions.
POST https://nymbot.ai/api/v1/responses — me he kupu raihirangi API.
| Papa | Mahere | Kia hiahiatia ana | Whakaahua |
|---|---|---|---|
model | kōpaka | Ae | Hei whakawhiti atu ki a Whakaputa Kōrero Atāwhai, tae atu ki ngā tūmomo tūmomo uira. |
input | kōrero rānei he rārangi? | Ae | He kōrero, he rārangi rānei o ngā mea: ngā karere (ngā kaupapa user, assistant, system, developer) me input_text, input_image a output_text ngā wāhanga, me te function_call a function_call_output ngā mea mō ngā taputapu. input_image kawe mai he image_url hononga rānei URL raraunga, ehara i te tohu mahi. reasoning a web_search_call ka whakarerekētia ngā mea; item_reference e whakahētia ana. |
instructions | kōpaka | Kāore | Ngā aronga pūnaha |
max_output_tokens | tau kōpaka | Kāore | Ko ngā tōkena nui katoa hei tuhi. |
temperaturetop_p | tau | Kāore | Ngā whakamahinga tauira, kei hea te tauira e mau ana i a rātou. |
toolstool_choiceparallel_tool_calls | raraunga, kōrero, rārangi rānei, tūmatatenga, tūturu | Kāore | Ngā taputapu mahi, i roto i te āhua o ngā Whakautu ({"type": "function", "name": …, "parameters": …}). A web_search kei te mea anō web_search_preview ka whakakā te taputapu rapu web inā āwhina ana. Ka whakakorehia ngā taputapu atu kua whakahohea. |
reasoning | whakawhitiwhiti | Kāore | {"effort": "minimal" | "low" | "medium" | "high"}. xhigh a max mārie high; none ka whakakore i tēnā. |
text.formatresponse_format | whakawhitiwhiti | Kāore | Whakaritea te tuarua, hei JSON schema rānei json_object. |
metadata | whakawhitiwhiti | Kāore | Kāore i huri i roto i te whakautu. He rerekētanga taura 16 i te mea nui atu, he kaupapa ki te 64 characters me ngā uara ki te 512. |
stream | tūponotanga | Kāore | Tuku i ngā tūpono pēnei i te whakamāramatanga i raro. |
store | tūponotanga | Kāore | Kāore i whakarongoatia. Kāore he mea tiakina, ā, ka kī tonu te whakautu i te "store": false. |
previous_response_idconversationbackground | kōrero, whārangi, tūturu | Kāore | Kāore e tautokohia: 400 unsupported_parameter. Kāore e tiakena ngā whakautu, nō reira tukuna te kōrero katoa ki roto input i ngā wā katoa. |
Whakaaronga
{
"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 }
}
He tono taputapu ka puta mai i output hei function_call item me te
call_id, name a arguments; tuku te hua whakawhiti atu hei a
function_call_output mea me te mea e rite ana call_id. Whakaaroaro, ki te hoki mai e te
te ao mārama, he reasoning item me te reasoning_text tāmata,
tāia tuatahi. status he incomplete i te wā i tae te whaiwhaiwhai
max_output_tokens nā te kaiwhakahaere i whakatūpato, me te
incomplete_details.reason whakatū ki te max_output_tokens kei te mea anō
content_filter. E whakahao ana te whakautu hoki i ngā tautuhinga o te tono (temperature,
ngā taputapu, te kōwhiringa taputapu me etahi atu) pēnei i te mahi a OpenAI, ā, ka whai i te nymbot utunga
whāinga.
Whakamaherehia, he taha tētahi iwi 🌊 event: tārewa me a data: tātai me te a
sequence_number, i tenei rārangi: response.created,
response.in_progress, response.output_item.added,
response.content_part.added, he nui atu i te aha tonu o response.output_text.delta,
response.output_text.done, response.content_part.done,
response.output_item.done, ā, i te whakamutunga response.completed me te
whakamahi me te utu. Ka mutu te whakautu i te hiku response.incomplete nā reira, me he
whakamutunga i muri i te tīmata o te rerenga me response.failed. Ko ngā mātāpono whakaaro he mea motuhake katoa me response.reasoning_text.delta a .done. Ngā karanga taputapu
ka whai muri i te kaupapa, hei taumata takitahi me te response.function_call_arguments.delta
a .done.
| Tikanga Matua | Ahihi |
|---|---|
400 | Kāore model kei te mea anō input; previous_response_id, conversation, background rānei he item_reference (unsupported_parameter); he taputapu kāore e tautoko ana, te momo ihirangi rānei. |
402, 403, 404, 429, 502, 503 | Mā te 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);
Ngā Karere a Anthropic
Te hanganga a Anthropic, mō ngā Anthropic SDKs me te Claude Code. Ka mahi tahi me ngā tauira katoa i roto i te catalog, ehara i te Claude anake: ka whakamāoritia te tono, ka whakahaerehia mā te rārangi mahi pēnei, ā, ka whakamāoritia anō ki te hoki mai.
POST https://nymbot.ai/api/v1/messages — he hiahia ana ki tētahi API key, nā mea x-api-key kei te mea anō Authorization: Bearer.
Te anthropic-version a anthropic-beta e whakatauhia ana, e
whakaheke ana hoki ngā headers. Ka whakarite ngā ingoa tauira a Anthropic ki te katalog, nō reira ka mahi a Claude Code me ngā SDK ki
ngā ingoa kua rongoia atu ana:
- He ingoa e mōhio ana te kātālohi, pēnei i
claude-sonnet-5kei te mea anōanthropic/claude-opus-5, ka whakamahia hei te mea kei te ai. - Ahau rānei he rā (
-20260514),-latest, he tohu whakamutunga pēnei i te-v1, he tae i roto i te pūtake pēnei i[1m]me heanthropic/kei te mea anōanthropic.ka tangoia ngā tīpako, me ngā tohu pūtake me ngā tohu kōpaka i roto i te whakapāinga ka whakamātaua i ngā huarahi e rua (claude-haiku-4-5ngā mea kua kiteaclaude-haiku-4.5). - Ki te kore tonu e hāngai ki tētahi mea, ka whakamahia te whānau (Opus, Sonnet rānei Haiku), kia noho pea te putanga o te rārangi kōrero e rite ana ki te putanga i pātaiā rānei he hou ake.
- He ingoa e kore e hāngai ki tētahi mea ka hoki mai
404not_found_error.
| Papa | Mahere | Kia hiahiatia ana | Whakaahua |
|---|---|---|---|
model | kōpaka | Ae | He huarangi tauira katalog, he ingoa tauira Anthropic rānei. |
max_tokens | tau kōpaka | Ae | Ko ngā tōkena nui katoa hei tuhi. |
messages | papa whakarite | Ae | user a assistant huringa, me text, image (base64 or URL puna), tool_use a tool_result ngā waahanga. thinking Ka whakataetia, ka tūmuri hoki ngā waahanga i ngā huringa i mua. |
system | kōrero rānei he rārangi? | Kāore | Tūtohu pūnaha, hei taupā rānei hei rārangi tuhinga rānei. |
temperaturetop_p | tau | Kāore | Ngā whakamahinga tauira, kei hea te tauira e mau ana i a rātou. top_k e whakaaeatia ana, ā, e tūpāhia ana. |
stop_sequences | papa tūhono kōrero | Kāore | He kupu whakamutunga i te whakautu. He tae noa ki ngā kōrero e whā, he tae noa ki ngā kōrero e 256. |
toolstool_choice | rārangelengitanga, taunakitanga | Kāore | Ngā taputapu me name, description a input_schema. A web_search ka whakakā te taputapu tapono rapu web; He kura atu a Anthropic (bash, text editor, computer use) e whakahētia ana me unsupported_tool. tool_choice mātau auto, any, tool kei te mea anō none, ā disable_parallel_tool_use. |
thinking | whakawhitiwhiti | Kāore | {"type": "enabled", "budget_tokens": 8192}, {"type": "adaptive"} kei te mea anō {"type": "disabled"}. Ka kōwhiri te utu i te taumata mahi: i raro i te 2,048 iti noa, mai i te 2,048 iti, mai i te 8,192 waenganui, mai i te 16,384 nui. Ka whakamahi te Adaptive i output_config.effort, rānei te tiketike. |
stream | tūponotanga | Kāore | Pūrangiaho i roto i te aha o te hui a Anthropic. |
metadata | whakawhitiwhiti | Kāore | Tāmategia ā, kore i whakaatu. |
Whakaaronga
{
"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 ka taea hoki te pupuri tool_use ngā pouaka me te a thinking
peke, ko wai signature he kore. stop_reason he
end_turn, max_tokens, tool_use kei te mea anō refusal,
mahi ake te huarahi pēnei i a finish_reason i runga
Whakaputa Kōrero Atāwhai; stop_sequence he always
null, ahakoa i mutu te whakautu i te whakamutunga o te rārangi whakamutunga. input_tokens ngā tauira
he whakauru hou anake; kei roto i ngā wāhi kapi e rua te whakauru kapi. Kei te utu i roto i te
nymbot te mea me te X-Nymbot-Cost-Sats upoko.
I te hāpai atu, ko ēnei ngā kaupapa a Anthropic: message_start,
content_block_start, ping, content_block_delta
(text_delta, input_json_delta kei te mea anō thinking_delta),
content_block_stop, message_delta me te take mutu, te whakamahinga me
te nymbot whakaaturanga utu, ā message_stop. A ping e hoki ana
e ngana ana te tauira i roto i ngā hātaketanga 15 i a ia e mahi ana. Ka tae mai ngā karanga taputai i muri i te tuhinga, hei kotahi i te mea
tool_use tāpui me tōna katoa i whakauru ki tahi input_json_delta.
He hapa i tenei pae whakamutunga ka whakamahi i te hanga a Anthropic:
{"type": "error", "error": {"type": "not_found_error", "message": "…"}}. Ko te rārangi tēnei
kāore i tino nui 402 billing_error, he kaiwhakahaere kua nui rawa te whakapakari
503 overloaded_error. He raru i muri i te tīmata o te rārangi ka tuku
hei error tūnga.
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);
E tauira ana i ngā tohu
He whakaaturanga mō te nui o ngā input tokens ka whakamahia e tētahi tono Messages, kia taea e te kaiwhakamahi te tautoko i mua i te tukuna. He free, engari mehemea he kiha hoki.
POST https://nymbot.ai/api/v1/messages/count_tokens — me he kupu raka API. Atawhai.
He rite te tinana i te mea mō Ngā kaupapa kōrero, kore ai max_tokens;
me whakatutuki te ingoa tauira. He whakamātau te tauanga: te maha o ngā pūmanawa o te whakaaturanga pūnaha,
ngā karere, ngā karere taputai, me ngā whakamārama taputai ka whakataukohia ki te whā, ka tango i te 1,600 mō ia pikitia.
Ehara tēnei i te tokenizer a te kaiwhakahaere, nō reira ka rerekē te tauanga tika. Ko te kate i tae ki tōna rārangi w限 ka taea tonu te whakamahi i a ia.
Whakaaronga
{ "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);
Whakarārangi tauira
Ko ia mahere me te kaihangatanga e whakaae ana te API, me te utu o ia mea. Ka pānuitia te rārangi i te pātaka reihi rātou anō kia rite ki te kōwhiri a te tuhono app, kia kia tika tonu ai ki te mea ka whakahaere te tūmomo taputai.
GET https://nymbot.ai/api/v1/models — kāore he kī e hiahiatia ana. Kua kapihia mō ngā miniti e rima.
GET /api/v1/models/{id} he kōrero kotahi te hoki mai ana.
| Papa | Mahere | Kia hiahiatia ana | Whakaahua |
|---|---|---|---|
type | string (pātai) | Kāore | chat (te tirohanga matua), image, video, audio, embedding kei te mea anō all. Ka taea te tukua te maha, pēnei i image,video. |
Ko ngā utu ko āu mea e utu ana, kua whai atu tonu i te utu noho me te paenga, i roto i ngā tārau me i roto i ngā sats i te
tauira utu Bitcoin o te wā nei. balance e kī ana he aha te taurangi ka whakamahi te tauira.
nymbot_key Kei roto i te app te ingoa poto o te mahere. created he 항상
0, nō te mea kāore te katalog e tuhi i te wā i tāpirihia ai tētahi mahere. He mahere kore i ngā utu token kua tukuna
kia kitea e te katoa he utu per_request hei utu.
nymbot/auto he i mua tonu, e utu ana hei variable, me te
routes he rārangi e whakaatu ana i ngā utu o ia huarahi mātātoa. E tautoko ana ia i te kite me te whaiwhai i te whakaaro, engari
kāore i te mea ngā taputaki.
GET /api/v1/models/{id} ka whakaae i ngā ingoa me ngā ingoa tūpāpaku katoa e rite ana ki te tono, ā, ka hoki mai
te rārangi mō te tauira e whakatutuki ana i rātou.
Whakaaronga
{
"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"
}
]
}
Ngā momo atu:
- Whakaahua Kei te whai ngā whakauru
capabilities(accepts_image_url,requires_image_url,edit) me te utuper_generation. - Whakaata Kei te whai ngā whakauru
max_duration_secondsaresolutions, me he tau utuper_secondmō ia whakataunga. - Rongo Kei te whai ngā whakauru
audio_typespeechkei te mea anōtranscription, utuohiaper_1k_charskei te mea anōper_minute. - Whakauru Kei te whai ngā whakauru
dimensions,context_length,max_inputsme he utu mō ngā tūtohu input e tairongo ana ki te milioni tahi.
Kua tohuhia ngā utu "estimated": true ko te whakaaturanga a te tuhono mō tētahi generator e kore e rāhuihia te utu. He mea kore e mōhiotia type whakahoki 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);