Rach don t-susbaint
Tha an Nymbot.

Bun-eòlais Pàirt

Thòisich e gnìomhachas.

Tha an t-àireamh-fòn, an t-àireamh-fòn, an t-àireamh-fòn, an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn.

Thòisich e gnìomhachas

A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.

POST https://nymbot.ai/api/v1/chat/completions Tha an t-àireamh API key.

Tha model agus messages Tha an t-àireamh-fòn, tha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn. supported_parametersBha crìonadh de 0.2% ann an eaconomaidh Bhreatainn sna trì mìosan mu dheireadh den bhliadhna an uiridh.

PàirtPàirtPàirtSgrìobh
modelPàirtThanymbot/auto (Oùdhaich auto) for Nymbot's routing on the standard balance, or a catalog model id such as: anthropic/claude-sonnet-5 Tha an t-àireamh-fòn, tha an t-àireamh-fòn, tha an t-àireamh-fòn. Pàirt.
messagesPàirtThaThòisich e gnìomhachas. system, developer (S e seòrsa de system) user, assistant agus toolA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. text agus image_url A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. input_audio A bheil aon de na cùmhnantan as fheàrr.
streamPàirtThaThòisich e gnìomhachas ann an-diugh. Tha Stream.
stream_optionsPàirtTha{"include_usage": true} Tha an t-àireamh-fòn a tha an t-àireamh-fòn.
max_tokens
max_completion_tokens
PàirtThaTha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn.
temperature
top_p
PàirtThaThòisich e gnìomhachas: temperature Dhùin e 0 ann an 2, top_p Dhùin e anns na 0.
stopThòisich e gnìomhachas.ThaThòisich e gnìomhachas ann an t-àireamh-fòn, eadar-dhealaichte eadar-dhealaichte eadar-dhealaichte eadar-dhealaichte. nymbot/auto.
seedPàirtThaTha an t-àireamh-fòn a tha an model.
presence_penalty
frequency_penalty
PàirtThaThòisich e gnìomhachas ann an t-àireamh 2-2.
response_formatPàirtTha{"type": "json_object"} Tha {"type": "json_schema", "json_schema": {…}}Thòisich e gnìomhachas ann an t-àireamh-fòn. nymbot/auto.
tools
tool_choice
parallel_tool_calls
Array, String or Object, àireamh-fòn.ThaThòisich e gnìomhachas. TèarainteachdPàirt a web_search Thòisich e gnìomhachas Pàirt WebTha an mearachd a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a 'dùileadh a'. 400.
reasoning_effort
reasoning
Thòisich e gnìomhachas.Tha"minimal", "low", "medium" Tha "high"Tha {"effort": "high"}. "none" Tha {"enabled": false} Thòisich e gnìomhachas. Thòisich e.
pluginsPàirtTha[{"id": "web", "max_results": 5}] Tha an t-àireamh-fòn a 'sgeulachdan. up to 10 results.
nPàirtThaA bheil aon de na cùmhnantan as urrainn dhaibh fhaighinn. 400.
logit_bias
user
metadata
Thòisich e gnìomhachas.ThaTha iad a tha iad. logit_bias Tha an t-àireamh-fòn a-t-àireamh-fòn a-t-àireamh-fòn a-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à. user Tha an mearachd a 'ceadachd a 'ceadachd a 'ceadachd a 'ceadachd a 'ceadachd a 'ceadachd. metadata Tha an tòrr ann an tòrr ann an tòrr 16 string values, keys ann an tòrr ann an tòrr ann an tòrr ann an tòrr ann an tòrr ann an tòrr ann an tòrr ann an tòrr ann an tòrr ann an tòrr ann an tòrr ann an 512.

A sireadh an ordinary. chat.completionA sireadh an cost usage.cost Dh’amais Sanndaidh gu cùramach. nymbot Sgrìobh mi. model A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. message.reasoning_contentDh’amais Sanndaidh gu cùramach.

Sgrìobh

{
  "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 Tha an t-àireamh-fòn a-riamh a-riamh a-riamh a-riamh a-riamh a-riamh. tool_calls Tha an t-àireamh-fòn a tha thu a 'tools, length A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. content_filter A bheil aon de na cùmhnantan as urrainn dhaibh fhaighinn. stop Tha e. usage.completion_tokens_details.reasoning_tokens Tha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn. completion_tokens.

PàirtTha
400Tha model Tha messages (missing_required_parameterA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.unsupported_content(S e an t-àireamh 20)too_many_imagesA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.invalid_valueA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.invalid_image_urlA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.unsupported_tool); n A sireadh an 1; A :thinking A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.model_not_foundNa thig dhuinn gu bràth!"upstream_rejected).
402Tha an t-àireamh-fòn a tha thu a’ dèanamh thu.
403Bliadhna mhath ur dhiubh uile bho Camanachd Leodhais.key_limit_reachedLùghdaich max_tokens Tha i a cur an cap.
404A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.model_not_found).
429A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.upstream_rate_limited).
502, 503Na thig dhuinn gu bràth!"upstream_errorNa thig dhuinn gu bràth!"upstream_overloadedTha mi Retry-AfterA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.

Tha an t-àireamh-fòn a-riamh a-riamh a-riamh. Pàirt.

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

Tha Stream

Tha "stream": true Tha an t-àireamh-fòn, tha an t-àireamh-fòn, tha an t-àireamh-fòn. chat.completion.chunk Tha a data: Thòisich e gnìomhachas ann an Stream data: [DONE]Thòisich e gnìomhachas delta.reasoning_contentA sireadh an delta.content.

Tha an t-àireamh-fòn, tha an t-àireamh-fòn, tha an t-àireamh-fòn. max_tokens Ma tha thu fìor mu dàimh, tha thu fìor mu dàimh, eadar-dhealaichte eadar-dhealaichte eadar-dhealaichte.

Tha Stream

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]
  • Thòisich e gnìomhachas : Tha an t-àireamh ann an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh.
  • Tha e "stream_options": {"include_usage": true} Tha an t-àireamh-fòn, tha an emos. choicesDh’amais Sanndaidh gu cùramach. nymbot Sgrìobh mi.
  • Tha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn.
  • 'S e an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn. 401 Tha 402Thòisich e gnìomhachas ann an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh. data: {"error": {…}} Thòisich e gnìomhachas ann an sin. [DONE].
  • A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.

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

Thòisich e gnìomhachas

Thòisich e gnìomhachas tools A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. tool Tha sin dìreach lazy tool_call_idTha an t-àireamh-fòn, tha an t-àireamh-fòn, tha an t-àireamh-fòn.

tool_choice Tha "auto", "none", "required" Tha {"type": "function", "function": {"name": "…"}}A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.capabilities.toolsA bheil aon de na cùmhnantan as urrainn dhaibh fhaighinn. 400 unsupported_tool Tha nymbot/auto Tha an t-àireamh-fòn ann an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn.

Tha "stream": trueTha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn.

Dùn Dè an Iar.

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

A sireadh an Request

Thòisich e capabilities.vision Tha an t-àireamh. add an image_url Thòisich e gnìomhachas ann an t-àireamh-fòn. https:// Lùghdaich a data:image/…;base64, A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.400 invalid_image_urlTha optional. detail Tha auto, low Tha high.

Tha nymbot/autoThòisich e gnìomhachas ann an t-àireamh-fòn an t-àireamh-fòn. capabilities.vision Tha mi fo churam. 400 unsupported_contentTha an t-àireamh ann an t-àireamh ann an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh.

A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.

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

Thòisich e

Thòisich e capabilities.reasoning A sireadh, tha thu fìor mu dàimh, tha thu fìor mu dàimh. reasoning_effort ("minimal", "low", "medium" Tha "high"Tha "reasoning": {"effort": "high"}Tha an add :thinking A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. nymbot/auto, :thinking Tha an t-àireamh-fòn a tha an Standard Route.

Tha an Anthropic models a tha a 'sgeuladh a tha a 'sgeuladh de 1,000, 2,000, 8,000 or 16,000 tokens. max_tokens Tha an t-àireamh-fòn a-riamh a-riamh. tool_choice A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.

Thòisich e gnìomhachas ann an message.reasoning_contentTha delta.reasoning_content A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. completion_tokensA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.

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

Pàirt Suffixes

'S e an t-àireamh-fòn, an t-àireamh-fòn, an t-àireamh-fòn, an t-àireamh-fòn, an t-àireamh-fòn an t-àireamh-fòn. anthropic/claude-sonnet-5:online.

PàirtSgrìobh
:onlineTha an t-seòrsa de web, as plugins: [{"id": "web"}]Tha Pàirt Web.
:thinkingThòisich e gnìomhachas; nymbot/autoThòisich e gnìomhachas ann an t-àireamh-fòn, 400 model_not_found Tha an “no endpoints found”.
:nitro, :floor, :exacto, :extendedTha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn.

A bheil aon de na cùmhnantan as fheàrr as fheàrr as urrainn dhaibh fhaighinn.A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. 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);

Tha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn.

  • Tha an tòrr: "plugins": [{"id": "web", "max_results": 5}]Tha a :online Tha e na model.
  • Tha e na bhàrd a 'lùghdaich.: "tools": [{"type": "web_search", "parameters": {"max_results": 5}}]A sireadh an Accept as web_search_preview Tha openrouter:web_searchTha an t-àireamh-fòn, tha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn.

max_results Tha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn. nymbot.web_search.sourcesDhùin e a title, snippet agus urlTha mi as url_citation A sireadh an Message.

Tha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn.

Dùn Dè an Iar.

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

Thòisich e gnìomhachas

Tha an t-àireamh-fòn, tha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn.

POST https://nymbot.ai/api/v1/responses Tha an t-àireamh API key.

PàirtPàirtPàirtSgrìobh
modelPàirtThaTha Thòisich e gnìomhachasThòisich e gnìomhachas.
inputThòisich e gnìomhachas.ThaA string, or a list of items: Messages (Rolls) ClannGàidhlig user, assistant, system, developer) Sgrìobh input_text, input_image agus output_text Dhùin e function_call agus function_call_output Thòisich e gnìomhachas. input_image Tha an image_url Tha an t-àireamh-fòn ann an t-àireamh-fòn, no an t-àireamh-fòn. reasoning agus web_search_call Thòisich e gnìomhachas. item_reference Tha iad.
instructionsPàirtThaSgrìobh e Instructions System.
max_output_tokensPàirtThaTha am mearachd a scribes.
temperature
top_p
PàirtThaThòisich e gnìomhachas ann an model.
tools
tool_choice
parallel_tool_calls
Array, String or Object, àireamh-fòn.ThaA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.{"type": "function", "name": …, "parameters": …}) A web_search Tha web_search_preview Thòisich e gnìomhachas Pàirt Web Tha an t-àireamh-fòn a-riamh a-riamh a-riamh a-riamh a-riamh.
reasoningPàirtTha{"effort": "minimal" | "low" | "medium" | "high"}. xhigh agus max Sgrìobh high; none Tha mi ga fhaicinn.
text.format
response_format
PàirtThaThòisich e gnìomhachas ann an JSON. json_object.
metadataPàirtThaTha an t-àireamh ann an t-àireamh ann an t-àireamh ann an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh.
streamPàirtThaBliadhna mhath ur dhiubh uile bho Camanachd Leodhais.
storePàirtThaTha an t-àireamh-fòn, tha an t-àireamh-fòn. "store": false.
previous_response_id
conversation
background
Thòisich e gnìomhachas, boolean.ThaTha sin dìreach lazy: 400 unsupported_parameterTha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn. input Dùn Dè an Iar.

Sgrìobh

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

Tha an t-àireamh-fòn a 'dùileachadh. output Tha a function_call Pàirt call_id, name agus argumentsThòisich e gnìomhachas ann an A. function_call_output A sireadh an equal call_idThòisich e gnìomhachas ann an t-àireamh. reasoning Pàirt reasoning_text Thòisich e gnìomhachas. status Tha incomplete Tha sin dìreach lazy max_output_tokens Dh’amais Sanndaidh gu cùramach. incomplete_details.reason Tha max_output_tokens Tha content_filterA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. nymbot Objects an tòrr.

Thòisich e gnìomhachas ann an event: Pàirt a data: Lùghdaich a sequence_numberA sireadh an this order: response.created, response.in_progress, response.output_item.added, response.content_part.addedDhùin e anns an response.output_text.delta, response.output_text.done, response.content_part.done, response.output_item.doneDùn Dè an Iar response.completed Thòisich e gnìomhachas ann an t-àireamh-fòn. response.incomplete Tha an t-àireamh-fòn a-riamh a tha a’ stèidhichte air a’ stèidhichte air. response.failedThòisich e gnìomhachas ann an t-àireamh-fòn. response.reasoning_text.delta agus .doneA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. response.function_call_arguments.delta agus .done.

PàirtTha
400Tha model Tha input; previous_response_id, conversation, background Tha an item_reference (unsupported_parameter); a tha a' sgiobaidhean na sgiobaidhean na sgiobaidhean na sgiobaidhean.
402, 403, 404, 429, 502, 503Tha an t-àireamh 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);

Thòisich e gnìomhachas

A sireadh an Anthropic SDKs agus Claude Code. It works with every model in the catalog, not only Claude: the request is translated, run through the same pipeline, and translated back.

POST https://nymbot.ai/api/v1/messages Tha an t-àireamh-fòn, as x-api-key Tha Authorization: Bearer.

Tha anthropic-version agus anthropic-beta A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.

  • Tha an t-àireamh-fòn, as a catalog. claude-sonnet-5 Tha anthropic/claude-opus-5A sireadh, tha thu fìor mu dàimh.
  • (S e seòrsa de date)-20260514), -latest'S e seòrsa de version. -v1'S e an t-àireamh-fòn, as [1m] Tha an anthropic/ Tha anthropic. A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.claude-haiku-4-5 Tha claude-haiku-4.5).
  • Tha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn.
  • 'S e an t-àireamh-fòn, an t-àireamh-fòn, an t-àite. 404 not_found_error.
PàirtPàirtPàirtSgrìobh
modelPàirtThaA catalog model id, or a Anthropic model name.
max_tokensPàirtThaTha am mearachd a scribes.
messagesPàirtThauser agus assistant Thòisich e gnìomhachas. text, image (Base64 or URL source) a tha an t-àireamh. tool_use agus tool_result Tha bloc. thinking Thòisich e gnìomhachas ann an t-àireamh-fòn.
systemThòisich e gnìomhachas.ThaSystem prompt, as a string or text blocks.
temperature
top_p
PàirtThaThòisich e gnìomhachas ann an model. top_k Tha iad a tha iad.
stop_sequencesThòisich e StringThaTha an t-àireamh-fòn a-riamh a-riamh a-riamh a-riamh a-riamh a-riamh a-riamh a-riamh a-riamh a-riamh.
tools
tool_choice
Thòisich e gnìomhachas.ThaThòisich e name, description agus input_schemaPàirt a web_search Lùghdaich a tha seo. Pàirt WebThòisich e gnìomhachas anns an t-àireamh-fòn, eadar-dhealaichte eadar-dhealaichte. unsupported_tool. tool_choice Tha auto, any, tool Tha noneTha disable_parallel_tool_use.
thinkingPàirtTha{"type": "enabled", "budget_tokens": 8192}, {"type": "adaptive"} Tha {"type": "disabled"}Tha an t-àireamh-fòn a-t-àireamh-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t-à-t. output_config.effortTha e high.
streamPàirtThaTha an t-àireamh ann an Anthropic.
metadataPàirtThaTha e ignorant.

Sgrìobh

{
  "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 Tha na h-àite tool_use Pàirt a thinking Dè a tha thu a’ block? signature Tha e embal. stop_reason Tha end_turn, max_tokens, tool_use Tha refusalA sireadh an equal way as finish_reason Tha Thòisich e gnìomhachas; stop_sequence Tha nullTha an t-àireamh-fòn a tha thu a' sgiobaidhean. input_tokens Bha crìonadh de 0.2% ann an eaconomaidh Bhreatainn sna trì mìosan mu dheireadh den bhliadhna an uiridh. nymbot A sireadh an e X-Nymbot-Cost-Sats Tha seo.

Thòisich e gnìomhachas ann an Anthropic: message_start, content_block_start, ping, content_block_delta (text_delta, input_json_delta Tha thinking_delta), content_block_stop, message_delta A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn. nymbot A sireadh an Objective. message_stopPàirt a ping Tha an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh. tool_use Thòisich e gnìomhachas eadar-dhealaichte. input_json_delta.

Tha errors on this endpoint use Anthropic's format: {"type": "error", "error": {"type": "not_found_error", "message": "…"}}Tha equilibrium àm. 402 billing_errorTha an overloaded provider. 503 overloaded_errorTha an t-àireamh-fòn a tha thu a' stèidhichte air a 'dùileachadh. error Tha e Event.

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

Thòisich e gnìomhachas

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 Tha an t-àireamh. free.

'S e seòrsa de body. Message Na StàiteTha sin max_tokensA bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.

Sgrìobh

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

Pàirt Modèla

Tha an t-àireamh ann an t-àireamh ann an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh.

GET https://nymbot.ai/api/v1/models Tha an t-àireamh-tòrr a 'sgeulachdan.Chiùdhaich an 5 min.

GET /api/v1/models/{id} Tha an entrée.

PàirtPàirtPàirtSgrìobh
typeThòisich e gnìomhachas.Thachat Na thig dhuinn gu bràth!" image, video, audio, embedding Tha allA sireadh an t-àite, as image,video.

Tha an t-àireamh-fòn, tha an t-àireamh-fòn an t-àireamh-fòn an t-àireamh-fòn. balance Tha equilibrium a tha model a tha a 'dùile. nymbot_key Tha an t-àireamh-fòn ann an app. created Tha an t-àireamh ann an t-àireamh ann an t-àireamh an t-àireamh an t-àireamh an t-àireamh an t-àireamh. per_request an àite sin.

nymbot/auto Thòisich e gnìomhachas ann an t-àite. variableTha a routes A bheil aon de na cùmhnantan as fheàrr as urrainn dhaibh fhaighinn.

GET /api/v1/models/{id} Tha an t-àireamh-fòn, tha an t-àireamh-fòn, tha an t-àireamh-fòn.

Sgrìobh

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

Dùn Dè an Iar:

  • Pàirt Pàirt capabilities (accepts_image_url, requires_image_url, editA sireadh an price per_generation.
  • Pàirt Pàirt max_duration_seconds agus resolutionsA sireadh an price per_second Thòisich e gnìomhachas.
  • Pàirt Pàirt audio_type speech Tha transcriptionPàirt per_1k_chars Tha per_minute.
  • Pàirt Pàirt dimensions, context_length, max_inputs Tha an t-àireamh-fòn a 'dùileachadh.

Preise an t-àite "estimated": true Bha crìonadh de 0.2% ann an eaconomaidh Bhreatainn eadar-dhealaichte eadar-dhealaichte. type Pàirt 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);