# Compare multiple chat models
Source: https://docs.ninjachat.ai/api-reference/compare-multiple-chat-models
/openapi.json post /compare
# Create a chat completion
Source: https://docs.ninjachat.ai/api-reference/create-a-chat-completion
/openapi.json post /chat/completions
OpenAI-compatible chat completions with ordered model fallbacks and provider routing policy. Pass model "@slug" to run a saved preset you own — the preset supplies models, prompt, tools, and routing; send only messages.
# Create a chat completion (legacy path)
Source: https://docs.ninjachat.ai/api-reference/create-a-chat-completion-legacy-path
/openapi.json post /chat
Backward-compatible path for /chat/completions, including historical field spellings and session memory.
# Create a chat session
Source: https://docs.ninjachat.ai/api-reference/create-a-chat-session
/openapi.json post /sessions
# Create a multimodal pipeline
Source: https://docs.ninjachat.ai/api-reference/create-a-multimodal-pipeline
/openapi.json post /pipelines
Run up to five dependent chat, image and video steps as one durable async job.
# Create a stateless response
Source: https://docs.ninjachat.ai/api-reference/create-a-stateless-response
/openapi.json post /responses
OpenAI Responses-compatible text, vision, structured-output, and function-calling API. Set stream=true for typed lifecycle events.
# Create a video job
Source: https://docs.ninjachat.ai/api-reference/create-a-video-job
/openapi.json post /videos
Submit an async video job. Poll GET /videos/{id}, or register a signed webhook (POST /webhooks or https://www.ninjachat.ai/developers/webhooks) for video.completed / video.failed.
# Create a video job (legacy path)
Source: https://docs.ninjachat.ai/api-reference/create-a-video-job-legacy-path
/openapi.json post /video
Backward-compatible alias of /videos.
# Create a webhook
Source: https://docs.ninjachat.ai/api-reference/create-a-webhook
/openapi.json post /webhooks
Register an HTTPS URL. NinjaChat POSTs signed JSON for video and pipeline completion, budget.alert (50/80/100% of a spend limit), and balance.low (prepaid $5/$1). The signing secret is returned once. Console: https://www.ninjachat.ai/developers/webhooks
# Delete a chat session
Source: https://docs.ninjachat.ai/api-reference/delete-a-chat-session
/openapi.json delete /sessions/{id}
# Delete a webhook
Source: https://docs.ninjachat.ai/api-reference/delete-a-webhook
/openapi.json delete /webhooks
# Estimate request cost
Source: https://docs.ninjachat.ai/api-reference/estimate-request-cost
/openapi.json post /estimate
Public pre-flight estimate; does not deduct credits.
# Export a chat session
Source: https://docs.ninjachat.ai/api-reference/export-a-chat-session
/openapi.json get /sessions/{id}/export
# Generate images
Source: https://docs.ninjachat.ai/api-reference/generate-images
/openapi.json post /images/generations
# Generate images (legacy path)
Source: https://docs.ninjachat.ai/api-reference/generate-images-legacy-path
/openapi.json post /images
Backward-compatible alias of /images/generations.
# Get a chat session
Source: https://docs.ninjachat.ai/api-reference/get-a-chat-session
/openapi.json get /sessions/{id}
# Get a live model
Source: https://docs.ninjachat.ai/api-reference/get-a-live-model
/openapi.json get /models/{id}
# Get a multimodal pipeline
Source: https://docs.ninjachat.ai/api-reference/get-a-multimodal-pipeline
/openapi.json get /pipelines/{id}
# Get a request trace
Source: https://docs.ninjachat.ai/api-reference/get-a-request-trace
/openapi.json get /requests/{id}
# Get a video job
Source: https://docs.ninjachat.ai/api-reference/get-a-video-job
/openapi.json get /videos/{id}
Poll job status until completed or failed. Prefer a webhook if you do not want to poll.
# Get a video job (legacy path)
Source: https://docs.ninjachat.ai/api-reference/get-a-video-job-legacy-path
/openapi.json get /video/status
Query-string compatibility endpoint for /videos/{id}.
# Get balance
Source: https://docs.ninjachat.ai/api-reference/get-balance
/openapi.json get /balance
# Get gateway health
Source: https://docs.ninjachat.ai/api-reference/get-gateway-health
/openapi.json get /health
# Get model battle rankings
Source: https://docs.ninjachat.ai/api-reference/get-model-battle-rankings
/openapi.json get /battles
# Get public network statistics
Source: https://docs.ninjachat.ai/api-reference/get-public-network-statistics
/openapi.json get /network
# Get the live price sheet
Source: https://docs.ninjachat.ai/api-reference/get-the-live-price-sheet
/openapi.json get /pricing
Public prices generated from the same tables used by billing.
# Get this OpenAPI document
Source: https://docs.ninjachat.ai/api-reference/get-this-openapi-document
/openapi.json get /openapi
# Get usage
Source: https://docs.ninjachat.ai/api-reference/get-usage
/openapi.json get /usage
# List live models
Source: https://docs.ninjachat.ai/api-reference/list-live-models
/openapi.json get /models
# List webhook deliveries
Source: https://docs.ninjachat.ai/api-reference/list-webhook-deliveries
/openapi.json get /webhooks/deliveries
Recent delivery attempts for one endpoint, newest first.
# List webhooks
Source: https://docs.ninjachat.ai/api-reference/list-webhooks
/openapi.json get /webhooks
List HTTPS endpoints registered for video completion and spend-alert callbacks. Console: https://www.ninjachat.ai/developers/webhooks
# Claude Fable 5
Source: https://docs.ninjachat.ai/api-reference/models/chat/claude-fable-5
claude-fable-5 on NinjaChat — Anthropic's Fable 5 for long-running agents, deep research, and complex multimodal work with a 1M-token context. $10.00 / MTok input, $50.00 / MTok output.
`claude-fable-5`
Anthropic — served by Anthropic, DeepInfra, GMI Cloud
1,000,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Anthropic's Fable 5 for long-running agents, deep research, and complex multimodal work with a 1M-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------- | :------------- | :------------ | :------------- |
| \$10.00 / MTok | \$50.00 / MTok | \$1.00 / MTok | \$12.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.10. Billing is metered per token. Prices are live at `GET /api/v1/models/claude-fable-5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "claude-fable-5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="claude-fable-5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-fable-5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `claude-fable-5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `claude-fable-5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"claude-fable-5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("claude-fable-5");
if (!model.servable) throw new Error("claude-fable-5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Claude Fable 5.1
Source: https://docs.ninjachat.ai/api-reference/models/chat/claude-fable-5-1
claude-fable-5.1 on NinjaChat — Anthropic's Mythos-class Claude Fable 5.1 for hours-long, multi-application agent work. $10.00 / MTok input, $50.00 / MTok output.
`claude-fable-5.1`
Anthropic
1,000,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Anthropic's Mythos-class Claude Fable 5.1 for hours-long, multi-application agent work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------- | :------------- | :------------ | :------------- |
| \$10.00 / MTok | \$50.00 / MTok | \$0.25 / MTok | \$12.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.10. Billing is metered per token. Prices are live at `GET /api/v1/models/claude-fable-5.1`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "claude-fable-5.1",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="claude-fable-5.1",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-fable-5.1","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `claude-fable-5.1` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `claude-fable-5.1` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"claude-fable-5.1"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("claude-fable-5.1");
if (!model.servable) throw new Error("claude-fable-5.1 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Claude Haiku 4.5
Source: https://docs.ninjachat.ai/api-reference/models/chat/claude-haiku-4-5
claude-haiku-4.5 on NinjaChat — Anthropic's Haiku 4.5 with vision, tools, extended thinking, and a 64K output ceiling. $1.00 / MTok input, $5.00 / MTok output.
`claude-haiku-4.5`
Anthropic — served by Anthropic, DeepInfra, GMI Cloud
200,000-token context window · 64,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Anthropic's Haiku 4.5 with vision, tools, extended thinking, and a 64K output ceiling.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.00 / MTok | \$5.00 / MTok | \$0.10 / MTok | \$1.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.01. Billing is metered per token. Prices are live at `GET /api/v1/models/claude-haiku-4.5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "claude-haiku-4.5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="claude-haiku-4.5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-haiku-4.5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `claude-haiku-4.5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `claude-haiku-4.5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"claude-haiku-4.5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("claude-haiku-4.5");
if (!model.servable) throw new Error("claude-haiku-4.5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Claude Opus 4.6
Source: https://docs.ninjachat.ai/api-reference/models/chat/claude-opus-4-6
claude-opus-4.6 on NinjaChat — Anthropic's Opus 4.6 for deep analysis and complex coding. $5.00 / MTok input, $25.00 / MTok output.
`claude-opus-4.6`
Anthropic — served by Anthropic, GMI Cloud
200,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
Anthropic's Opus 4.6 for deep analysis and complex coding.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$5.00 / MTok | \$25.00 / MTok | \$0.50 / MTok | \$6.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.05. Billing is metered per token. Prices are live at `GET /api/v1/models/claude-opus-4.6`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "claude-opus-4.6",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="claude-opus-4.6",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-opus-4.6","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `claude-opus-4.6` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `claude-opus-4.6` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"claude-opus-4.6"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("claude-opus-4.6");
if (!model.servable) throw new Error("claude-opus-4.6 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Claude Opus 4.7
Source: https://docs.ninjachat.ai/api-reference/models/chat/claude-opus-4-7
claude-opus-4.7 on NinjaChat — Anthropic's Opus 4.7 for complex analysis, coding, multimodal work, and tool use. $5.00 / MTok input, $25.00 / MTok output.
`claude-opus-4.7`
Anthropic — served by Anthropic, DeepInfra, GMI Cloud
409,600-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Anthropic's Opus 4.7 for complex analysis, coding, multimodal work, and tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$5.00 / MTok | \$25.00 / MTok | \$0.50 / MTok | \$5.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.05. Billing is metered per token. Prices are live at `GET /api/v1/models/claude-opus-4.7`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "claude-opus-4.7",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="claude-opus-4.7",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-opus-4.7","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `claude-opus-4.7` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `claude-opus-4.7` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"claude-opus-4.7"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("claude-opus-4.7");
if (!model.servable) throw new Error("claude-opus-4.7 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Claude Opus 4.8
Source: https://docs.ninjachat.ai/api-reference/models/chat/claude-opus-4-8
claude-opus-4.8 on NinjaChat — Anthropic's Opus 4.8 for deep reasoning, coding, visual analysis, and long-horizon agents. $5.00 / MTok input, $25.00 / MTok output.
`claude-opus-4.8`
Anthropic — served by Anthropic, DeepInfra, GMI Cloud
1,000,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Anthropic's Opus 4.8 for deep reasoning, coding, visual analysis, and long-horizon agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$5.00 / MTok | \$25.00 / MTok | \$0.50 / MTok | \$5.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.05. Billing is metered per token. Prices are live at `GET /api/v1/models/claude-opus-4.8`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "claude-opus-4.8",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="claude-opus-4.8",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-opus-4.8","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `claude-opus-4.8` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `claude-opus-4.8` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"claude-opus-4.8"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("claude-opus-4.8");
if (!model.servable) throw new Error("claude-opus-4.8 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Claude Opus 5
Source: https://docs.ninjachat.ai/api-reference/models/chat/claude-opus-5
claude-opus-5 on NinjaChat — Anthropic's Opus 5 for complex agentic coding and enterprise knowledge work. $5.00 / MTok input, $25.00 / MTok output.
`claude-opus-5`
Anthropic — served by Anthropic, DeepInfra, GMI Cloud
1,000,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Anthropic's Opus 5 for complex agentic coding and enterprise knowledge work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$5.00 / MTok | \$25.00 / MTok | \$0.50 / MTok | \$6.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.05. Billing is metered per token. Prices are live at `GET /api/v1/models/claude-opus-5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "claude-opus-5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="claude-opus-5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-opus-5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `claude-opus-5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `claude-opus-5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"claude-opus-5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("claude-opus-5");
if (!model.servable) throw new Error("claude-opus-5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Claude Sonnet 4.5
Source: https://docs.ninjachat.ai/api-reference/models/chat/claude-sonnet-4-5
claude-sonnet-4.5 on NinjaChat — Anthropic's Sonnet 4.5 — strong at code and analysis. $3.00 / MTok input, $15.00 / MTok output.
`claude-sonnet-4.5`
Anthropic
200,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning
Anthropic's Sonnet 4.5 — strong at code and analysis.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$3.00 / MTok | \$15.00 / MTok | \$0.30 / MTok | \$3.75 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.03. Billing is metered per token. Prices are live at `GET /api/v1/models/claude-sonnet-4.5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "claude-sonnet-4.5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="claude-sonnet-4.5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-4.5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `claude-sonnet-4.5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `claude-sonnet-4.5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"claude-sonnet-4.5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("claude-sonnet-4.5");
if (!model.servable) throw new Error("claude-sonnet-4.5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Claude Sonnet 4.6
Source: https://docs.ninjachat.ai/api-reference/models/chat/claude-sonnet-4-6
claude-sonnet-4.6 on NinjaChat — Anthropic's Sonnet 4.6 — strong code and reasoning at mid-tier cost. $3.00 / MTok input, $15.00 / MTok output.
`claude-sonnet-4.6`
Anthropic — served by Anthropic, DeepInfra
200,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
Anthropic's Sonnet 4.6 — strong code and reasoning at mid-tier cost.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$3.00 / MTok | \$15.00 / MTok | \$0.30 / MTok | \$3.75 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.03. Billing is metered per token. Prices are live at `GET /api/v1/models/claude-sonnet-4.6`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "claude-sonnet-4.6",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="claude-sonnet-4.6",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-4.6","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `claude-sonnet-4.6` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `claude-sonnet-4.6` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"claude-sonnet-4.6"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("claude-sonnet-4.6");
if (!model.servable) throw new Error("claude-sonnet-4.6 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Claude Sonnet 5
Source: https://docs.ninjachat.ai/api-reference/models/chat/claude-sonnet-5
claude-sonnet-5 on NinjaChat — Anthropic's frontier Sonnet for coding and agents, with a native 1M context window. $2.00 / MTok input, $10.00 / MTok output.
`claude-sonnet-5`
Anthropic — served by Anthropic, DeepInfra, GMI Cloud
1,000,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Anthropic's frontier Sonnet for coding and agents, with a native 1M context window.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$2.00 / MTok | \$10.00 / MTok | \$0.20 / MTok | \$2.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.02. Billing is metered per token. Prices are live at `GET /api/v1/models/claude-sonnet-5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "claude-sonnet-5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="claude-sonnet-5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `claude-sonnet-5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `claude-sonnet-5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"claude-sonnet-5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("claude-sonnet-5");
if (!model.servable) throw new Error("claude-sonnet-5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Codestral 2508
Source: https://docs.ninjachat.ai/api-reference/models/chat/codestral-2508
codestral-2508 on NinjaChat — Mistral's low-latency coding model for chat generation, function calling, and repository-scale context. $0.30 / MTok input, $0.90 / MTok output.
`codestral-2508`
Mistral AI — served by Mistral
256,000-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Mistral's low-latency coding model for chat generation, function calling, and repository-scale context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.30 / MTok | \$0.90 / MTok | \$0.03 / MTok | \$0.30 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0024. Billing is metered per token. Prices are live at `GET /api/v1/models/codestral-2508`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "codestral-2508",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="codestral-2508",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"codestral-2508","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `codestral-2508` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `codestral-2508` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"codestral-2508"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("codestral-2508");
if (!model.servable) throw new Error("codestral-2508 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Command A
Source: https://docs.ninjachat.ai/api-reference/models/chat/command-a
command-a on NinjaChat — Cohere's high-capability enterprise model for agents, retrieval, tool use, and multilingual production workloads. $2.50 / MTok input, $10.00 / MTok output.
`command-a`
Cohere
256,000-token context window · 32,000 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Cohere's high-capability enterprise model for agents, retrieval, tool use, and multilingual production workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$2.50 / MTok | \$10.00 / MTok | \$0.25 / MTok | \$2.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0225. Billing is metered per token. Prices are live at `GET /api/v1/models/command-a`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "command-a",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="command-a",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"command-a","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `command-a` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `command-a` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"command-a"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("command-a");
if (!model.servable) throw new Error("command-a is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Command R
Source: https://docs.ninjachat.ai/api-reference/models/chat/command-r
command-r on NinjaChat — Cohere's balanced enterprise model for long-context retrieval, structured work, and multilingual tool use. $0.15 / MTok input, $0.60 / MTok output.
`command-r`
Cohere
128,000-token context window · 4,000 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Cohere's balanced enterprise model for long-context retrieval, structured work, and multilingual tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.15 / MTok | \$0.60 / MTok | \$0.015 / MTok | \$0.15 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0014. Billing is metered per token. Prices are live at `GET /api/v1/models/command-r`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "command-r",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="command-r",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"command-r","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `command-r` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `command-r` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"command-r"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("command-r");
if (!model.servable) throw new Error("command-r is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Command R7B
Source: https://docs.ninjachat.ai/api-reference/models/chat/command-r7b
command-r7b on NinjaChat — Cohere's compact Command R model for inexpensive, latency-sensitive agents, retrieval, and multilingual work. $0.0375 / MTok input, $0.15 / MTok output.
`command-r7b`
Cohere
128,000-token context window · 4,000 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Cohere's compact Command R model for inexpensive, latency-sensitive agents, retrieval, and multilingual work.
## Pricing
| Input | Output | Cached input | Cache write |
| :-------------- | :------------ | :-------------- | :-------------- |
| \$0.0375 / MTok | \$0.15 / MTok | \$0.0037 / MTok | \$0.0375 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0004. Billing is metered per token. Prices are live at `GET /api/v1/models/command-r7b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "command-r7b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="command-r7b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"command-r7b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `command-r7b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `command-r7b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"command-r7b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("command-r7b");
if (!model.servable) throw new Error("command-r7b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# DeepSeek R1 0528
Source: https://docs.ninjachat.ai/api-reference/models/chat/deepseek-r1-0528
deepseek-r1-0528 on NinjaChat — DeepSeek's open R1 reasoning model (May 2025 update) for deep reasoning, mathematics, and research agents. $0.57 / MTok input, $2.29 / MTok output.
`deepseek-r1-0528`
DeepSeek — served by GMI Cloud, DeepInfra, io.net Intelligence
163,840-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
DeepSeek's open R1 reasoning model (May 2025 update) for deep reasoning, mathematics, and research agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.57 / MTok | \$2.29 / MTok | \$0.057 / MTok | \$0.57 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0052. Billing is metered per token. Prices are live at `GET /api/v1/models/deepseek-r1-0528`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-r1-0528",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="deepseek-r1-0528",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-r1-0528","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `deepseek-r1-0528` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `deepseek-r1-0528` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"deepseek-r1-0528"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("deepseek-r1-0528");
if (!model.servable) throw new Error("deepseek-r1-0528 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# DeepSeek V3
Source: https://docs.ninjachat.ai/api-reference/models/chat/deepseek-v3
deepseek-v3 on NinjaChat — DeepSeek's non-reasoning V3 model for coding, math, and budget tool agents. $1.74 / MTok input, $3.48 / MTok output.
`deepseek-v3`
DeepSeek — served by DeepInfra
163,840-token context window · 8,192 max output tokens
Streaming, JSON mode, Multilingual
DeepSeek's non-reasoning V3 model for coding, math, and budget tool agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$1.74 / MTok | \$3.48 / MTok | \$0.174 / MTok | \$1.74 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0122. Billing is metered per token. Prices are live at `GET /api/v1/models/deepseek-v3`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-v3",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="deepseek-v3",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v3","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `deepseek-v3` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `deepseek-v3` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"deepseek-v3"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("deepseek-v3");
if (!model.servable) throw new Error("deepseek-v3 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# DeepSeek V3 0324
Source: https://docs.ninjachat.ai/api-reference/models/chat/deepseek-v3-0324
deepseek-v3-0324 on NinjaChat — DeepSeek's stable March 2025 V3 snapshot for deterministic, non-reasoning workloads. $0.24 / MTok input, $0.90 / MTok output.
`deepseek-v3-0324`
DeepSeek — served by DeepInfra
163,840-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
DeepSeek's stable March 2025 V3 snapshot for deterministic, non-reasoning workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.24 / MTok | \$0.90 / MTok | \$0.024 / MTok | \$0.24 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0021. Billing is metered per token. Prices are live at `GET /api/v1/models/deepseek-v3-0324`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-v3-0324",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="deepseek-v3-0324",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v3-0324","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `deepseek-v3-0324` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `deepseek-v3-0324` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"deepseek-v3-0324"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("deepseek-v3-0324");
if (!model.servable) throw new Error("deepseek-v3-0324 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# DeepSeek V3.1
Source: https://docs.ninjachat.ai/api-reference/models/chat/deepseek-v3-1
deepseek-v3.1 on NinjaChat — DeepSeek's hybrid instruct model served in deterministic non-thinking mode for fast coding, JSON, and tools. $0.25 / MTok input, $0.95 / MTok output.
`deepseek-v3.1`
DeepSeek — served by DeepInfra
163,840-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
DeepSeek's hybrid instruct model served in deterministic non-thinking mode for fast coding, JSON, and tools.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.25 / MTok | \$0.95 / MTok | \$0.13 / MTok | \$0.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0022. Billing is metered per token. Prices are live at `GET /api/v1/models/deepseek-v3.1`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-v3.1",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="deepseek-v3.1",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v3.1","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `deepseek-v3.1` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `deepseek-v3.1` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"deepseek-v3.1"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("deepseek-v3.1");
if (!model.servable) throw new Error("deepseek-v3.1 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# DeepSeek V3.2
Source: https://docs.ninjachat.ai/api-reference/models/chat/deepseek-v3-2
deepseek-v3.2 on NinjaChat — DeepSeek's V3.2 general-purpose model for budget agents, coding, and reasoning. $0.56 / MTok input, $0.84 / MTok output.
`deepseek-v3.2`
DeepSeek — served by GMI Cloud, DeepInfra, DigitalOcean Inference, BytePlus (Ark), Novita AI
163,840-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
DeepSeek's V3.2 general-purpose model for budget agents, coding, and reasoning.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.56 / MTok | \$0.84 / MTok | \$0.056 / MTok | \$0.56 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0037. Billing is metered per token. Prices are live at `GET /api/v1/models/deepseek-v3.2`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-v3.2",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="deepseek-v3.2",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v3.2","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `deepseek-v3.2` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `deepseek-v3.2` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"deepseek-v3.2"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("deepseek-v3.2");
if (!model.servable) throw new Error("deepseek-v3.2 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# DeepSeek V4 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/deepseek-v4-flash
deepseek-v4-flash on NinjaChat — DeepSeek's current V4 Flash release with a million-token context. $0.14 / MTok input, $0.28 / MTok output.
`deepseek-v4-flash`
DeepSeek — served by DeepInfra, DigitalOcean Inference, BytePlus (Ark), Atlas Cloud
1,048,576-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
DeepSeek's current V4 Flash release with a million-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.14 / MTok | \$0.28 / MTok | \$0.014 / MTok | \$0.14 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.001. Billing is metered per token. Prices are live at `GET /api/v1/models/deepseek-v4-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-v4-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `deepseek-v4-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `deepseek-v4-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"deepseek-v4-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("deepseek-v4-flash");
if (!model.servable) throw new Error("deepseek-v4-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# DeepSeek V4 Flash 0731
Source: https://docs.ninjachat.ai/api-reference/models/chat/deepseek-v4-flash-0731
deepseek-v4-flash-0731 on NinjaChat — DeepSeek's V4 Flash (July 31 build): fast, low-cost reasoning with a 1M-token context. $0.22 / MTok input, $0.66 / MTok output.
`deepseek-v4-flash-0731`
DeepSeek — served by Fireworks AI, DeepInfra, GMI Cloud, Baseten, DigitalOcean Inference, Tencent Cloud TokenHub, Morph, Chutes, Novita AI
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context
DeepSeek's V4 Flash (July 31 build): fast, low-cost reasoning with a 1M-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.22 / MTok | \$0.66 / MTok | \$0.007 / MTok | \$0.22 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0018. Billing is metered per token. Prices are live at `GET /api/v1/models/deepseek-v4-flash-0731`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-v4-flash-0731",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="deepseek-v4-flash-0731",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-flash-0731","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `deepseek-v4-flash-0731` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `deepseek-v4-flash-0731` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"deepseek-v4-flash-0731"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("deepseek-v4-flash-0731");
if (!model.servable) throw new Error("deepseek-v4-flash-0731 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# DeepSeek V4 Pro
Source: https://docs.ninjachat.ai/api-reference/models/chat/deepseek-v4-pro
deepseek-v4-pro on NinjaChat — DeepSeek's current V4 Pro release for frontier coding and complex reasoning with a million-token context. $1.74 / MTok input, $3.48 / MTok output.
`deepseek-v4-pro`
DeepSeek — served by DeepInfra, Fireworks AI, Baseten, DigitalOcean Inference, BytePlus (Ark), Atlas Cloud, Tencent Cloud TokenHub
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
DeepSeek's current V4 Pro release for frontier coding and complex reasoning with a million-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$1.74 / MTok | \$3.48 / MTok | \$0.174 / MTok | \$1.74 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0122. Billing is metered per token. Prices are live at `GET /api/v1/models/deepseek-v4-pro`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-v4-pro",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-pro","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `deepseek-v4-pro` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `deepseek-v4-pro` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"deepseek-v4-pro"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("deepseek-v4-pro");
if (!model.servable) throw new Error("deepseek-v4-pro is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# DeepSeek V4 Pro 0813
Source: https://docs.ninjachat.ai/api-reference/models/chat/deepseek-v4-pro-0813
deepseek-v4-pro-0813 on NinjaChat — DeepSeek's V4 Pro (August 13 build) for agentic coding and production reasoning with a 1M-token context. $1.32 / MTok input, $3.96 / MTok output.
`deepseek-v4-pro-0813`
DeepSeek — served by Fireworks AI, DeepInfra, GMI Cloud, Baseten, DigitalOcean Inference
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context
DeepSeek's V4 Pro (August 13 build) for agentic coding and production reasoning with a 1M-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$1.32 / MTok | \$3.96 / MTok | \$0.132 / MTok | \$1.32 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0106. Billing is metered per token. Prices are live at `GET /api/v1/models/deepseek-v4-pro-0813`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-v4-pro-0813",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="deepseek-v4-pro-0813",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-pro-0813","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `deepseek-v4-pro-0813` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `deepseek-v4-pro-0813` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"deepseek-v4-pro-0813"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("deepseek-v4-pro-0813");
if (!model.servable) throw new Error("deepseek-v4-pro-0813 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Euryale 3.1 70B
Source: https://docs.ninjachat.ai/api-reference/models/chat/euryale-70b
euryale-70b on NinjaChat — Sao10K's Llama 3.1 70B creative model tuned for immersive dialogue and roleplay. $0.85 / MTok input, $0.85 / MTok output.
`euryale-70b`
Sao10K — served by DeepInfra
131,072-token context window · 16,384 max output tokens
Streaming, JSON mode, Long context, Multilingual
Sao10K's Llama 3.1 70B creative model tuned for immersive dialogue and roleplay.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.85 / MTok | \$0.85 / MTok | \$0.085 / MTok | \$0.85 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0051. Billing is metered per token. Prices are live at `GET /api/v1/models/euryale-70b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "euryale-70b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="euryale-70b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"euryale-70b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `euryale-70b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `euryale-70b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"euryale-70b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("euryale-70b");
if (!model.servable) throw new Error("euryale-70b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 2.5 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-2-5-flash
gemini-2.5-flash on NinjaChat — Google's high-efficiency Gemini 2.5 Flash. $0.30 / MTok input, $2.50 / MTok output.
`gemini-2.5-flash`
Google — served by Google, DeepInfra
1,000,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Tool calling, Vision, Multilingual
Google's high-efficiency Gemini 2.5 Flash.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.30 / MTok | \$2.50 / MTok | \$0.03 / MTok | \$0.30 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.004. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-2.5-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-2.5-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-2.5-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-2.5-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-2.5-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-2.5-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-2.5-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-2.5-flash");
if (!model.servable) throw new Error("gemini-2.5-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 2.5 Pro
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-2-5-pro
gemini-2.5-pro on NinjaChat — Google's Gemini 2.5 Pro for long documents and research with a 1M-token context. $1.25 / MTok input, $10.00 / MTok output.
`gemini-2.5-pro`
Google — served by Google, DeepInfra
1,000,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's Gemini 2.5 Pro for long documents and research with a 1M-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------- | :------------ |
| \$1.25 / MTok | \$10.00 / MTok | \$0.125 / MTok | \$1.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0163. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-2.5-pro`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-2.5-pro",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-2.5-pro",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-2.5-pro","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-2.5-pro` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-2.5-pro` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-2.5-pro"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-2.5-pro");
if (!model.servable) throw new Error("gemini-2.5-pro is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 3.1 Flash Lite
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-3-1-flash-lite
gemini-3.1-flash-lite on NinjaChat — Google's low-cost million-token Gemini 3.1 Flash Lite for high-volume multimodal work. $0.25 / MTok input, $1.50 / MTok output.
`gemini-3.1-flash-lite`
Google — served by GMI Cloud, DeepInfra
1,000,000-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's low-cost million-token Gemini 3.1 Flash Lite for high-volume multimodal work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.25 / MTok | \$1.50 / MTok | \$0.025 / MTok | \$0.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0028. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-3.1-flash-lite`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-3.1-flash-lite",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-3.1-flash-lite",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3.1-flash-lite","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-3.1-flash-lite` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-3.1-flash-lite` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-3.1-flash-lite"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-3.1-flash-lite");
if (!model.servable) throw new Error("gemini-3.1-flash-lite is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 3.1 Pro
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-3-1-pro
gemini-3.1-pro on NinjaChat — Google's Gemini 3.1 Pro — top-tier reasoning with a 1M-token context. $2.00 / MTok input, $12.00 / MTok output.
`gemini-3.1-pro`
Google — served by Google, DeepInfra
1,000,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
Google's Gemini 3.1 Pro — top-tier reasoning with a 1M-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$2.00 / MTok | \$12.00 / MTok | \$0.20 / MTok | \$2.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.022. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-3.1-pro`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-3.1-pro",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-3.1-pro",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3.1-pro","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-3.1-pro` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-3.1-pro` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-3.1-pro"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-3.1-pro");
if (!model.servable) throw new Error("gemini-3.1-pro is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 3.5 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-3-5-flash
gemini-3.5-flash on NinjaChat — Google's Gemini 3.5 Flash for multimodal agents, million-token analysis, and fast tool use. $1.50 / MTok input, $9.00 / MTok output.
`gemini-3.5-flash`
Google — served by GMI Cloud, DeepInfra
1,000,000-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's Gemini 3.5 Flash for multimodal agents, million-token analysis, and fast tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.50 / MTok | \$9.00 / MTok | \$0.15 / MTok | \$1.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0165. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-3.5-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-3.5-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-3.5-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3.5-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-3.5-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-3.5-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-3.5-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-3.5-flash");
if (!model.servable) throw new Error("gemini-3.5-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 3.5 Flash-Lite
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-3-5-flash-lite
gemini-3.5-flash-lite on NinjaChat — Google's Gemini 3.5 Flash-Lite for high-volume, low-cost agentic and multimodal workloads. $0.30 / MTok input, $2.50 / MTok output.
`gemini-3.5-flash-lite`
Google — served by Google, GMI Cloud
1,048,576-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's Gemini 3.5 Flash-Lite for high-volume, low-cost agentic and multimodal workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.30 / MTok | \$2.50 / MTok | \$0.03 / MTok | \$0.30 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.004. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-3.5-flash-lite`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-3.5-flash-lite",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-3.5-flash-lite",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3.5-flash-lite","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-3.5-flash-lite` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-3.5-flash-lite` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-3.5-flash-lite"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-3.5-flash-lite");
if (!model.servable) throw new Error("gemini-3.5-flash-lite is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 3.6 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-3-6-flash
gemini-3.6-flash on NinjaChat — Google's high-efficiency Gemini 3.6 Flash for multimodal coding, agentic workflows, and long-context analysis. $1.50 / MTok input, $7.50 / MTok output.
`gemini-3.6-flash`
Google — served by Google, GMI Cloud
1,048,576-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's high-efficiency Gemini 3.6 Flash for multimodal coding, agentic workflows, and long-context analysis.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.50 / MTok | \$7.50 / MTok | \$0.15 / MTok | \$1.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.015. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-3.6-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-3.6-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-3.6-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3.6-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-3.6-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-3.6-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-3.6-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-3.6-flash");
if (!model.servable) throw new Error("gemini-3.6-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 3.7 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-3-7-flash
gemini-3.7-flash on NinjaChat — Google's Gemini 3.7 Flash for coding, multimodal reasoning, and high-throughput agents. $1.50 / MTok input, $7.50 / MTok output.
`gemini-3.7-flash`
Google — served by Google, GMI Cloud, DeepInfra
1,048,576-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's Gemini 3.7 Flash for coding, multimodal reasoning, and high-throughput agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.50 / MTok | \$7.50 / MTok | \$0.15 / MTok | \$1.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.015. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-3.7-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-3.7-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-3.7-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3.7-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-3.7-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-3.7-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-3.7-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-3.7-flash");
if (!model.servable) throw new Error("gemini-3.7-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 3.8 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-3-8-flash
gemini-3.8-flash on NinjaChat — Google's Gemini 3.8 Flash for coding, multimodal reasoning, and high-throughput agents. $1.50 / MTok input, $7.50 / MTok output.
`gemini-3.8-flash`
Google — served by GMI Cloud
1,048,576-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's Gemini 3.8 Flash for coding, multimodal reasoning, and high-throughput agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.50 / MTok | \$7.50 / MTok | \$0.15 / MTok | \$1.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.015. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-3.8-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-3.8-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-3.8-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3.8-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-3.8-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-3.8-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-3.8-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-3.8-flash");
if (!model.servable) throw new Error("gemini-3.8-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 3 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-3-flash
gemini-3-flash on NinjaChat — Google's Gemini 3 Flash with a 1M-token context window. $0.50 / MTok input, $3.00 / MTok output.
`gemini-3-flash`
Google
1,000,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Vision, Multilingual
Google's Gemini 3 Flash with a 1M-token context window.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.50 / MTok | \$3.00 / MTok | \$0.05 / MTok | \$0.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0055. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-3-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-3-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-3-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-3-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-3-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-3-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-3-flash");
if (!model.servable) throw new Error("gemini-3-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemini 3 Pro
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemini-3-pro
gemini-3-pro on NinjaChat — Google's Gemini 3 Pro for reasoning, coding, and multimodal work. $2.00 / MTok input, $12.00 / MTok output.
`gemini-3-pro`
Google — served by Google, DeepInfra
1,000,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's Gemini 3 Pro for reasoning, coding, and multimodal work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$2.00 / MTok | \$12.00 / MTok | \$0.20 / MTok | \$2.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.022. Billing is metered per token. Prices are live at `GET /api/v1/models/gemini-3-pro`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemini-3-pro",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemini-3-pro",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3-pro","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemini-3-pro` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemini-3-pro` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemini-3-pro"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemini-3-pro");
if (!model.servable) throw new Error("gemini-3-pro is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemma 3 12B
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemma-3-12b
gemma-3-12b on NinjaChat — Google's compact multimodal Gemma 3 model for inexpensive vision and tool workloads. $0.05 / MTok input, $0.15 / MTok output.
`gemma-3-12b`
Google — served by DeepInfra
131,072-token context window · 32,768 max output tokens
Streaming, Tool calling, Vision, Long context, Multilingual
Google's compact multimodal Gemma 3 model for inexpensive vision and tool workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.05 / MTok | \$0.15 / MTok | \$0.005 / MTok | \$0.05 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0004. Billing is metered per token. Prices are live at `GET /api/v1/models/gemma-3-12b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemma-3-12b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemma-3-12b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemma-3-12b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemma-3-12b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemma-3-12b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemma-3-12b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemma-3-12b");
if (!model.servable) throw new Error("gemma-3-12b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemma 3 27B
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemma-3-27b
gemma-3-27b on NinjaChat — Google's larger open Gemma 3 model with reliable tool and JSON support. $0.08 / MTok input, $0.16 / MTok output.
`gemma-3-27b`
Google — served by DeepInfra
131,072-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Google's larger open Gemma 3 model with reliable tool and JSON support.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.08 / MTok | \$0.16 / MTok | \$0.008 / MTok | \$0.08 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0006. Billing is metered per token. Prices are live at `GET /api/v1/models/gemma-3-27b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemma-3-27b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemma-3-27b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemma-3-27b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemma-3-27b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemma-3-27b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemma-3-27b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemma-3-27b");
if (!model.servable) throw new Error("gemma-3-27b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemma 3 4B
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemma-3-4b
gemma-3-4b on NinjaChat — Google's efficient open 4B multimodal model with tools and structured outputs. $0.05 / MTok input, $0.10 / MTok output.
`gemma-3-4b`
Google — served by DeepInfra
131,072-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
Google's efficient open 4B multimodal model with tools and structured outputs.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.05 / MTok | \$0.10 / MTok | \$0.005 / MTok | \$0.05 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0004. Billing is metered per token. Prices are live at `GET /api/v1/models/gemma-3-4b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemma-3-4b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemma-3-4b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemma-3-4b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemma-3-4b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemma-3-4b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemma-3-4b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemma-3-4b");
if (!model.servable) throw new Error("gemma-3-4b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemma 4 26B A4B
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemma-4-26b-a4b
gemma-4-26b-a4b on NinjaChat — Google's sparse Gemma 4 variant with 4B active parameters for efficient multimodal reasoning. $0.13 / MTok input, $0.40 / MTok output.
`gemma-4-26b-a4b`
Google — served by DeepInfra, GMI Cloud, io.net Intelligence
256,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's sparse Gemma 4 variant with 4B active parameters for efficient multimodal reasoning.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.13 / MTok | \$0.40 / MTok | \$0.013 / MTok | \$0.13 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0011. Billing is metered per token. Prices are live at `GET /api/v1/models/gemma-4-26b-a4b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemma-4-26b-a4b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemma-4-26b-a4b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemma-4-26b-a4b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemma-4-26b-a4b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemma-4-26b-a4b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemma-4-26b-a4b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemma-4-26b-a4b");
if (!model.servable) throw new Error("gemma-4-26b-a4b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemma 4 31B
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemma-4-31b
gemma-4-31b on NinjaChat — Google's popular open multimodal model with native reasoning and function calling. $0.18 / MTok input, $0.50 / MTok output.
`gemma-4-31b`
Google — served by DeepInfra, GMI Cloud, DigitalOcean Inference, Morph, Chutes
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's popular open multimodal model with native reasoning and function calling.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.18 / MTok | \$0.50 / MTok | \$0.018 / MTok | \$0.18 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0014. Billing is metered per token. Prices are live at `GET /api/v1/models/gemma-4-31b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemma-4-31b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemma-4-31b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemma-4-31b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemma-4-31b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemma-4-31b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemma-4-31b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemma-4-31b");
if (!model.servable) throw new Error("gemma-4-31b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemma 4 31B Turbo
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemma-4-31b-turbo
gemma-4-31b-turbo on NinjaChat — Google's Gemma 4 31B in a low-latency Turbo serving tier with multimodal input and function calling. $0.09 / MTok input, $0.34 / MTok output.
`gemma-4-31b-turbo`
Google — served by DeepInfra
262,144-token context window · 16,384 max output tokens
Streaming, Tool calling, Vision, Reasoning, Long context, Multilingual
Google's Gemma 4 31B in a low-latency Turbo serving tier with multimodal input and function calling.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.09 / MTok | \$0.34 / MTok | \$0.009 / MTok | \$0.09 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0008. Billing is metered per token. Prices are live at `GET /api/v1/models/gemma-4-31b-turbo`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemma-4-31b-turbo",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemma-4-31b-turbo",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemma-4-31b-turbo","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemma-4-31b-turbo` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemma-4-31b-turbo` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemma-4-31b-turbo"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemma-4-31b-turbo");
if (!model.servable) throw new Error("gemma-4-31b-turbo is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemma 4 31B Ultra
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemma-4-31b-ultra
gemma-4-31b-ultra on NinjaChat — Google's Gemma 4 31B in a higher-accuracy Ultra serving tier for reasoning and tool-driven text workloads. $0.27 / MTok input, $0.76 / MTok output.
`gemma-4-31b-ultra`
Google — served by DeepInfra
131,072-token context window · 65,536 max output tokens
Streaming, Tool calling, Reasoning, Long context, Multilingual
Google's Gemma 4 31B in a higher-accuracy Ultra serving tier for reasoning and tool-driven text workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.27 / MTok | \$0.76 / MTok | \$0.027 / MTok | \$0.27 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0022. Billing is metered per token. Prices are live at `GET /api/v1/models/gemma-4-31b-ultra`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemma-4-31b-ultra",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemma-4-31b-ultra",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemma-4-31b-ultra","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemma-4-31b-ultra` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemma-4-31b-ultra` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemma-4-31b-ultra"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemma-4-31b-ultra");
if (!model.servable) throw new Error("gemma-4-31b-ultra is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Gemma 4 E4B
Source: https://docs.ninjachat.ai/api-reference/models/chat/gemma-4-e4b
gemma-4-e4b on NinjaChat — Google's tiny Gemma 4 E4B model with long-context reasoning and reliable tool calling. $0.02 / MTok input, $0.10 / MTok output.
`gemma-4-e4b`
Google — served by DeepInfra
131,072-token context window · 32,768 max output tokens
Streaming, Tool calling, Reasoning, Long context, Multilingual
Google's tiny Gemma 4 E4B model with long-context reasoning and reliable tool calling.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.02 / MTok | \$0.10 / MTok | \$0.002 / MTok | \$0.02 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0002. Billing is metered per token. Prices are live at `GET /api/v1/models/gemma-4-e4b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gemma-4-e4b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gemma-4-e4b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemma-4-e4b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gemma-4-e4b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gemma-4-e4b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gemma-4-e4b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gemma-4-e4b");
if (!model.servable) throw new Error("gemma-4-e4b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GLM 4.6
Source: https://docs.ninjachat.ai/api-reference/models/chat/glm-4-6
glm-4.6 on NinjaChat — Z.ai's efficient bilingual reasoning and coding model with structured tool support. $0.50 / MTok input, $2.00 / MTok output.
`glm-4.6`
Z.ai — served by DeepInfra
202,752-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Z.ai's efficient bilingual reasoning and coding model with structured tool support.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.50 / MTok | \$2.00 / MTok | \$0.05 / MTok | \$0.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0045. Billing is metered per token. Prices are live at `GET /api/v1/models/glm-4.6`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "glm-4.6",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="glm-4.6",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-4.6","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `glm-4.6` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `glm-4.6` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"glm-4.6"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("glm-4.6");
if (!model.servable) throw new Error("glm-4.6 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GLM 4.7
Source: https://docs.ninjachat.ai/api-reference/models/chat/glm-4-7
glm-4.7 on NinjaChat — Z.ai's full GLM 4.7 reasoning model for coding and multi-step agent work. $0.60 / MTok input, $2.20 / MTok output.
`glm-4.7`
Z.ai — served by DeepInfra, Baseten, BytePlus (Ark)
200,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Z.ai's full GLM 4.7 reasoning model for coding and multi-step agent work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.60 / MTok | \$2.20 / MTok | \$0.06 / MTok | \$0.60 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0052. Billing is metered per token. Prices are live at `GET /api/v1/models/glm-4.7`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "glm-4.7",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="glm-4.7",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-4.7","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `glm-4.7` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `glm-4.7` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"glm-4.7"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("glm-4.7");
if (!model.servable) throw new Error("glm-4.7 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GLM 4.7 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/glm-4-7-flash
glm-4.7-flash on NinjaChat — Z.ai's extremely low-cost GLM reasoning model for fast coding and tool workflows. $0.06 / MTok input, $0.40 / MTok output.
`glm-4.7-flash`
Z.ai — served by DeepInfra, io.net Intelligence
202,752-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Z.ai's extremely low-cost GLM reasoning model for fast coding and tool workflows.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.06 / MTok | \$0.40 / MTok | \$0.006 / MTok | \$0.06 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0007. Billing is metered per token. Prices are live at `GET /api/v1/models/glm-4.7-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "glm-4.7-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="glm-4.7-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-4.7-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `glm-4.7-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `glm-4.7-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"glm-4.7-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("glm-4.7-flash");
if (!model.servable) throw new Error("glm-4.7-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GLM-5
Source: https://docs.ninjachat.ai/api-reference/models/chat/glm-5
glm-5 on NinjaChat — Z.ai's GLM-5 with strong bilingual (Chinese/English) capabilities. $1.00 / MTok input, $3.20 / MTok output.
`glm-5`
Z.ai — served by DigitalOcean Inference, Z.ai (Zhipu), DeepInfra, GMI Cloud, Novita AI
128,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Multilingual
Z.ai's GLM-5 with strong bilingual (Chinese/English) capabilities.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.00 / MTok | \$3.20 / MTok | \$0.10 / MTok | \$1.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0082. Billing is metered per token. Prices are live at `GET /api/v1/models/glm-5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "glm-5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="glm-5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `glm-5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `glm-5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"glm-5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("glm-5");
if (!model.servable) throw new Error("glm-5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GLM 5.1
Source: https://docs.ninjachat.ai/api-reference/models/chat/glm-5-1
glm-5.1 on NinjaChat — Z.ai's agentic GLM 5.1 model with structured output, reasoning, and function-calling support. $1.40 / MTok input, $4.40 / MTok output.
`glm-5.1`
Z.ai — served by DigitalOcean Inference, DeepInfra, GMI Cloud, Chutes
163,840-token context window · 163,840 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Z.ai's agentic GLM 5.1 model with structured output, reasoning, and function-calling support.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.40 / MTok | \$4.40 / MTok | \$0.14 / MTok | \$1.40 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0114. Billing is metered per token. Prices are live at `GET /api/v1/models/glm-5.1`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "glm-5.1",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="glm-5.1",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.1","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `glm-5.1` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `glm-5.1` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"glm-5.1"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("glm-5.1");
if (!model.servable) throw new Error("glm-5.1 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GLM 5.2
Source: https://docs.ninjachat.ai/api-reference/models/chat/glm-5-2
glm-5.2 on NinjaChat — Z.ai's GLM 5.2 agentic model for engineering, multilingual coding, and long-horizon tasks. $1.40 / MTok input, $4.40 / MTok output.
`glm-5.2`
Z.ai — served by Fireworks AI, DeepInfra, GMI Cloud, Baseten, DigitalOcean Inference, BytePlus (Ark), Atlas Cloud, Mistral, Morph, Chutes, FriendliAI
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Z.ai's GLM 5.2 agentic model for engineering, multilingual coding, and long-horizon tasks.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.40 / MTok | \$4.40 / MTok | \$0.14 / MTok | \$1.40 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0114. Billing is metered per token. Prices are live at `GET /api/v1/models/glm-5.2`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "glm-5.2",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="glm-5.2",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.2","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `glm-5.2` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `glm-5.2` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"glm-5.2"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("glm-5.2");
if (!model.servable) throw new Error("glm-5.2 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GLM 5.2 Fast
Source: https://docs.ninjachat.ai/api-reference/models/chat/glm-5-2-fast
glm-5.2-fast on NinjaChat — Z.ai's speed-optimized GLM 5.2 for real-time agentic engineering with a full 1M-token context. $2.10 / MTok input, $6.60 / MTok output.
`glm-5.2-fast`
Z.ai — served by Fireworks AI, Baseten
1,048,576-token context window · 262,144 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Z.ai's speed-optimized GLM 5.2 for real-time agentic engineering with a full 1M-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$2.10 / MTok | \$6.60 / MTok | \$0.21 / MTok | \$2.10 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0171. Billing is metered per token. Prices are live at `GET /api/v1/models/glm-5.2-fast`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "glm-5.2-fast",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="glm-5.2-fast",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.2-fast","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `glm-5.2-fast` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `glm-5.2-fast` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"glm-5.2-fast"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("glm-5.2-fast");
if (!model.servable) throw new Error("glm-5.2-fast is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GLM 5.3
Source: https://docs.ninjachat.ai/api-reference/models/chat/glm-5-3
glm-5.3 on NinjaChat — Z.ai's frontier long-horizon coding model with mandatory adaptive reasoning and 1M context. $1.40 / MTok input, $4.40 / MTok output.
`glm-5.3`
Z.ai — served by Z.ai (Zhipu), io.net Intelligence
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Z.ai's frontier long-horizon coding model with mandatory adaptive reasoning and 1M context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.40 / MTok | \$4.40 / MTok | \$0.26 / MTok | \$1.40 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0114. Billing is metered per token. Prices are live at `GET /api/v1/models/glm-5.3`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "glm-5.3",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.3","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `glm-5.3` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `glm-5.3` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"glm-5.3"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("glm-5.3");
if (!model.servable) throw new Error("glm-5.3 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GLM 5.3 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/glm-5-3-flash
glm-5.3-flash on NinjaChat — Z.ai's efficient GLM 5.3 variant for high-volume coding, multimodal agents, and million-token work. $0.15 / MTok input, $0.50 / MTok output.
`glm-5.3-flash`
Z.ai — served by SiliconFlow, io.net Intelligence
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Z.ai's efficient GLM 5.3 variant for high-volume coding, multimodal agents, and million-token work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.15 / MTok | \$0.50 / MTok | \$0.03 / MTok | \$0.15 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0013. Billing is metered per token. Prices are live at `GET /api/v1/models/glm-5.3-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "glm-5.3-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="glm-5.3-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.3-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `glm-5.3-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `glm-5.3-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"glm-5.3-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("glm-5.3-flash");
if (!model.servable) throw new Error("glm-5.3-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-4.1
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-4-1
gpt-4.1 on NinjaChat — OpenAI's high-intelligence non-reasoning model with a one-million-token context window, vision, and tool use. $2.00 / MTok input, $8.00 / MTok output.
`gpt-4.1`
OpenAI
1,047,576-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
OpenAI's high-intelligence non-reasoning model with a one-million-token context window, vision, and tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$2.00 / MTok | \$8.00 / MTok | \$0.50 / MTok | \$2.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.018. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-4.1`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-4.1",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-4.1",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4.1","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-4.1` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-4.1` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-4.1"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-4.1");
if (!model.servable) throw new Error("gpt-4.1 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-4.1 Mini
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-4-1-mini
gpt-4.1-mini on NinjaChat — OpenAI's efficient GPT-4.1 model with million-token context, vision, structured output, and tool use. $0.40 / MTok input, $1.60 / MTok output.
`gpt-4.1-mini`
OpenAI — served by OpenAI, Atlas Cloud
1,047,576-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
OpenAI's efficient GPT-4.1 model with million-token context, vision, structured output, and tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.40 / MTok | \$1.60 / MTok | \$0.10 / MTok | \$0.40 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0036. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-4.1-mini`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-4.1-mini",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-4.1-mini",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4.1-mini","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-4.1-mini` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-4.1-mini` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-4.1-mini"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-4.1-mini");
if (!model.servable) throw new Error("gpt-4.1-mini is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-4o Mini
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-4o-mini
gpt-4o-mini on NinjaChat — OpenAI's compact multimodal model for inexpensive, high-throughput chat, vision, and structured workflows. $0.15 / MTok input, $0.60 / MTok output.
`gpt-4o-mini`
OpenAI
128,000-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
OpenAI's compact multimodal model for inexpensive, high-throughput chat, vision, and structured workflows.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.15 / MTok | \$0.60 / MTok | \$0.075 / MTok | \$0.15 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0014. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-4o-mini`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-4o-mini` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-4o-mini` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-4o-mini"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-4o-mini");
if (!model.servable) throw new Error("gpt-4o-mini is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5
gpt-5 on NinjaChat — A backwards-compatible NinjaChat API alias that currently serves OpenAI GPT-5.2. $1.75 / MTok input, $14.00 / MTok output.
`gpt-5`
OpenAI
400,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning
A backwards-compatible NinjaChat API alias that currently serves OpenAI GPT-5.2.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------- | :------------ |
| \$1.75 / MTok | \$14.00 / MTok | \$0.175 / MTok | \$1.75 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0228. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5");
if (!model.servable) throw new Error("gpt-5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5.3 Codex
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-3-codex
gpt-5.3-codex on NinjaChat — OpenAI's coding-specialized reasoning model for complex software engineering and agentic tool use. $1.75 / MTok input, $14.00 / MTok output.
`gpt-5.3-codex`
OpenAI
400,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
OpenAI's coding-specialized reasoning model for complex software engineering and agentic tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------- | :------------ |
| \$1.75 / MTok | \$14.00 / MTok | \$0.175 / MTok | \$1.75 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0228. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5.3-codex`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.3-codex",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.3-codex",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.3-codex","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5.3-codex` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5.3-codex` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5.3-codex"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5.3-codex");
if (!model.servable) throw new Error("gpt-5.3-codex is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5.4
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-4
gpt-5.4 on NinjaChat — OpenAI's GPT-5.4 flagship for hard reasoning and code. $2.50 / MTok input, $15.00 / MTok output.
`gpt-5.4`
OpenAI
256,000-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning
OpenAI's GPT-5.4 flagship for hard reasoning and code.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$2.50 / MTok | \$15.00 / MTok | \$0.25 / MTok | \$2.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0275. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5.4`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.4",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.4",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5.4` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5.4` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5.4"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5.4");
if (!model.servable) throw new Error("gpt-5.4 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5.4 Mini
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-4-mini
gpt-5.4-mini on NinjaChat — OpenAI's compact GPT-5.4 model for fast multimodal agents and structured workloads. $0.75 / MTok input, $4.50 / MTok output.
`gpt-5.4-mini`
OpenAI — served by GMI Cloud, Atlas Cloud
409,600-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
OpenAI's compact GPT-5.4 model for fast multimodal agents and structured workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.75 / MTok | \$4.50 / MTok | \$0.075 / MTok | \$0.75 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0083. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5.4-mini`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.4-mini",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5.4-mini` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5.4-mini` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5.4-mini"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5.4-mini");
if (!model.servable) throw new Error("gpt-5.4-mini is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5.4 Nano
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-4-nano
gpt-5.4-nano on NinjaChat — OpenAI's smallest GPT-5.4 model for routing, extraction, and lightweight agent loops. $0.20 / MTok input, $1.25 / MTok output.
`gpt-5.4-nano`
OpenAI — served by GMI Cloud, Atlas Cloud
409,600-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
OpenAI's smallest GPT-5.4 model for routing, extraction, and lightweight agent loops.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$1.25 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0023. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5.4-nano`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.4-nano",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.4-nano",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4-nano","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5.4-nano` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5.4-nano` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5.4-nano"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5.4-nano");
if (!model.servable) throw new Error("gpt-5.4-nano is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5.4 Pro
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-4-pro
gpt-5.4-pro on NinjaChat — OpenAI's highest-effort GPT-5.4 variant for the most demanding tasks. $30.00 / MTok input, $180.00 / MTok output.
`gpt-5.4-pro`
OpenAI
256,000-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning
OpenAI's highest-effort GPT-5.4 variant for the most demanding tasks.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------- | :-------------- | :------------ | :------------- |
| \$30.00 / MTok | \$180.00 / MTok | \$3.00 / MTok | \$30.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.33. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5.4-pro`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.4-pro",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.4-pro",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4-pro","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5.4-pro` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5.4-pro` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5.4-pro"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5.4-pro");
if (!model.servable) throw new Error("gpt-5.4-pro is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5.5
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-5
gpt-5.5 on NinjaChat — OpenAI's GPT-5.5 flagship with a million-token context, vision, and tool use. $5.00 / MTok input, $30.00 / MTok output.
`gpt-5.5`
OpenAI — served by OpenAI, GMI Cloud
1,050,000-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
OpenAI's GPT-5.5 flagship with a million-token context, vision, and tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$5.00 / MTok | \$30.00 / MTok | \$0.50 / MTok | \$5.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.055. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5.5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5.5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5.5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5.5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5.5");
if (!model.servable) throw new Error("gpt-5.5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5.5 Pro
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-5-pro
gpt-5.5-pro on NinjaChat — OpenAI's highest-accuracy GPT-5.5 variant for difficult reasoning, tool use, and long-context professional work. $30.00 / MTok input, $180.00 / MTok output.
`gpt-5.5-pro`
OpenAI
1,050,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
OpenAI's highest-accuracy GPT-5.5 variant for difficult reasoning, tool use, and long-context professional work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------- | :-------------- | :------------- | :------------- |
| \$30.00 / MTok | \$180.00 / MTok | \$30.00 / MTok | \$30.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.33. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5.5-pro`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.5-pro",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.5-pro",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.5-pro","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5.5-pro` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5.5-pro` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5.5-pro"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5.5-pro");
if (!model.servable) throw new Error("gpt-5.5-pro is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5.6 Luna
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-6-luna
gpt-5.6-luna on NinjaChat — OpenAI's high-volume GPT-5.6 model with 1.05M context and full tool support. $0.20 / MTok input, $1.20 / MTok output.
`gpt-5.6-luna`
OpenAI
1,050,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
OpenAI's high-volume GPT-5.6 model with 1.05M context and full tool support.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$1.20 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0022. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5.6-luna`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.6-luna",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.6-luna",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-luna","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5.6-luna` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5.6-luna` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5.6-luna"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5.6-luna");
if (!model.servable) throw new Error("gpt-5.6-luna is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5.6 Sol
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-6-sol
gpt-5.6-sol on NinjaChat — OpenAI's flagship GPT-5.6 model for the hardest reasoning and coding workloads. $4.00 / MTok input, $20.00 / MTok output.
`gpt-5.6-sol`
OpenAI — served by OpenAI, Microsoft Foundry
1,050,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
OpenAI's flagship GPT-5.6 model for the hardest reasoning and coding workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$4.00 / MTok | \$20.00 / MTok | \$0.40 / MTok | \$4.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.04. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5.6-sol`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.6-sol",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.6-sol",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5.6-sol` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5.6-sol` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5.6-sol"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5.6-sol");
if (!model.servable) throw new Error("gpt-5.6-sol is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5.6 Terra
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-6-terra
gpt-5.6-terra on NinjaChat — OpenAI's balanced GPT-5.6 model for coding, agents, and professional work. $2.00 / MTok input, $12.00 / MTok output.
`gpt-5.6-terra`
OpenAI
1,050,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
OpenAI's balanced GPT-5.6 model for coding, agents, and professional work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$2.00 / MTok | \$12.00 / MTok | \$0.20 / MTok | \$2.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.022. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5.6-terra`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.6-terra",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.6-terra",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-terra","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5.6-terra` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5.6-terra` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5.6-terra"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5.6-terra");
if (!model.servable) throw new Error("gpt-5.6-terra is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-5 Nano
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-5-nano
gpt-5-nano on NinjaChat — OpenAI's compact GPT-5 Nano for high-throughput reasoning, vision, and agent workloads. $0.05 / MTok input, $0.40 / MTok output.
`gpt-5-nano`
OpenAI
400,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
OpenAI's compact GPT-5 Nano for high-throughput reasoning, vision, and agent workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.05 / MTok | \$0.40 / MTok | \$0.005 / MTok | \$0.05 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0007. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-5-nano`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5-nano",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5-nano",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5-nano","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-5-nano` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-5-nano` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-5-nano"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-5-nano");
if (!model.servable) throw new Error("gpt-5-nano is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-OSS 120B
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-oss-120b
gpt-oss-120b on NinjaChat — OpenAI's Apache-2.0 open-weight 120B reasoning model for high-volume tool use. $0.35 / MTok input, $0.75 / MTok output.
`gpt-oss-120b`
OpenAI — served by Fireworks AI, Groq, Baseten, Cerebras, DeepInfra, DigitalOcean Inference, BytePlus (Ark), Amazon Bedrock, Scaleway Generative APIs, Cloudflare Workers AI, Hugging Face Inference Providers, Novita AI
131,072-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context
OpenAI's Apache-2.0 open-weight 120B reasoning model for high-volume tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.35 / MTok | \$0.75 / MTok | \$0.035 / MTok | \$0.35 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0025. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-oss-120b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-oss-120b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-oss-120b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-oss-120b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-oss-120b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-oss-120b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-oss-120b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-oss-120b");
if (!model.servable) throw new Error("gpt-oss-120b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-OSS 120B Turbo
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-oss-120b-turbo
gpt-oss-120b-turbo on NinjaChat — OpenAI's GPT-OSS 120B in a faster Turbo serving tier for tool-driven reasoning and coding workloads. $0.15 / MTok input, $0.60 / MTok output.
`gpt-oss-120b-turbo`
OpenAI — served by DeepInfra
131,072-token context window · 65,536 max output tokens
Streaming, Tool calling, Reasoning, Long context
OpenAI's GPT-OSS 120B in a faster Turbo serving tier for tool-driven reasoning and coding workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.15 / MTok | \$0.60 / MTok | \$0.015 / MTok | \$0.15 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0014. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-oss-120b-turbo`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-oss-120b-turbo",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-oss-120b-turbo",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-oss-120b-turbo","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-oss-120b-turbo` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-oss-120b-turbo` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-oss-120b-turbo"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-oss-120b-turbo");
if (!model.servable) throw new Error("gpt-oss-120b-turbo is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-OSS 120B Ultra
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-oss-120b-ultra
gpt-oss-120b-ultra on NinjaChat — OpenAI's GPT-OSS 120B in a high-speed Ultra serving tier with tools, JSON, and streaming. $0.20 / MTok input, $0.95 / MTok output.
`gpt-oss-120b-ultra`
OpenAI — served by DeepInfra
131,072-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context
OpenAI's GPT-OSS 120B in a high-speed Ultra serving tier with tools, JSON, and streaming.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$0.95 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.002. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-oss-120b-ultra`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-oss-120b-ultra",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-oss-120b-ultra",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-oss-120b-ultra","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-oss-120b-ultra` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-oss-120b-ultra` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-oss-120b-ultra"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-oss-120b-ultra");
if (!model.servable) throw new Error("gpt-oss-120b-ultra is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# GPT-OSS 20B
Source: https://docs.ninjachat.ai/api-reference/models/chat/gpt-oss-20b
gpt-oss-20b on NinjaChat — OpenAI's compact 20B open-weight reasoning model for ultra-fast agents and structured outputs. $0.075 / MTok input, $0.45 / MTok output.
`gpt-oss-20b`
OpenAI — served by Groq, DeepInfra, DigitalOcean Inference, Hugging Face Inference Providers
131,072-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
OpenAI's compact 20B open-weight reasoning model for ultra-fast agents and structured outputs.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------- | :------------ | :-------------- | :------------- |
| \$0.075 / MTok | \$0.45 / MTok | \$0.0075 / MTok | \$0.075 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0009. Billing is metered per token. Prices are live at `GET /api/v1/models/gpt-oss-20b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-oss-20b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-oss-20b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-oss-20b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `gpt-oss-20b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `gpt-oss-20b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"gpt-oss-20b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-oss-20b");
if (!model.servable) throw new Error("gpt-oss-20b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Grok 4
Source: https://docs.ninjachat.ai/api-reference/models/chat/grok-4
grok-4 on NinjaChat — xAI's Grok 4 with strong reasoning and up-to-date knowledge. $1.25 / MTok input, $2.50 / MTok output.
`grok-4`
xAI
256,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Reasoning
xAI's Grok 4 with strong reasoning and up-to-date knowledge.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$1.25 / MTok | \$2.50 / MTok | \$0.125 / MTok | \$1.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0088. Billing is metered per token. Prices are live at `GET /api/v1/models/grok-4`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "grok-4",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="grok-4",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-4","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `grok-4` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `grok-4` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"grok-4"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-4");
if (!model.servable) throw new Error("grok-4 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Grok 4.20
Source: https://docs.ninjachat.ai/api-reference/models/chat/grok-4-20
grok-4.20 on NinjaChat — xAI's million-token multimodal Grok 4.20 reasoning model for long-context agents and tool orchestration. $1.25 / MTok input, $2.50 / MTok output.
`grok-4.20`
xAI
1,000,000-token context window · 131,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
xAI's million-token multimodal Grok 4.20 reasoning model for long-context agents and tool orchestration.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.25 / MTok | \$2.50 / MTok | \$0.20 / MTok | \$1.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0088. Billing is metered per token. Prices are live at `GET /api/v1/models/grok-4.20`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "grok-4.20",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="grok-4.20",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-4.20","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `grok-4.20` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `grok-4.20` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"grok-4.20"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-4.20");
if (!model.servable) throw new Error("grok-4.20 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Grok 4.20 Fast
Source: https://docs.ninjachat.ai/api-reference/models/chat/grok-4-20-fast
grok-4.20-fast on NinjaChat — The non-reasoning Grok 4.20 endpoint for fast million-token multimodal and agentic workloads. $1.25 / MTok input, $2.50 / MTok output.
`grok-4.20-fast`
xAI
1,000,000-token context window · 131,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context
The non-reasoning Grok 4.20 endpoint for fast million-token multimodal and agentic workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.25 / MTok | \$2.50 / MTok | \$0.20 / MTok | \$1.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0088. Billing is metered per token. Prices are live at `GET /api/v1/models/grok-4.20-fast`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "grok-4.20-fast",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="grok-4.20-fast",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-4.20-fast","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `grok-4.20-fast` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `grok-4.20-fast` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"grok-4.20-fast"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-4.20-fast");
if (!model.servable) throw new Error("grok-4.20-fast is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Grok 4.3
Source: https://docs.ninjachat.ai/api-reference/models/chat/grok-4-3
grok-4.3 on NinjaChat — xAI's Grok 4.3 million-token reasoning model with vision, tools, structured output, and December 2025 knowledge. $1.25 / MTok input, $2.50 / MTok output.
`grok-4.3`
xAI — served by xAI, Atlas Cloud
1,000,000-token context window · 131,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
xAI's Grok 4.3 million-token reasoning model with vision, tools, structured output, and December 2025 knowledge.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.25 / MTok | \$2.50 / MTok | \$0.20 / MTok | \$1.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0088. Billing is metered per token. Prices are live at `GET /api/v1/models/grok-4.3`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "grok-4.3",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="grok-4.3",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-4.3","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `grok-4.3` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `grok-4.3` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"grok-4.3"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-4.3");
if (!model.servable) throw new Error("grok-4.3 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Grok 4.5
Source: https://docs.ninjachat.ai/api-reference/models/chat/grok-4-5
grok-4.5 on NinjaChat — xAI's frontier Grok 4.5 model for coding, STEM, and complex agent workflows. $2.00 / MTok input, $6.00 / MTok output.
`grok-4.5`
xAI — served by xAI, GMI Cloud
500,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context
xAI's frontier Grok 4.5 model for coding, STEM, and complex agent workflows.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$2.00 / MTok | \$6.00 / MTok | \$0.30 / MTok | \$2.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.016. Billing is metered per token. Prices are live at `GET /api/v1/models/grok-4.5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "grok-4.5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="grok-4.5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-4.5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `grok-4.5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `grok-4.5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"grok-4.5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-4.5");
if (!model.servable) throw new Error("grok-4.5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Grok 4.6
Source: https://docs.ninjachat.ai/api-reference/models/chat/grok-4-6
grok-4.6 on NinjaChat — xAI's frontier Grok model for coding, agents, and visual knowledge work. $2.00 / MTok input, $6.00 / MTok output.
`grok-4.6`
xAI — served by xAI, GMI Cloud
500,000-token context window · 128,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
xAI's frontier Grok model for coding, agents, and visual knowledge work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$2.00 / MTok | \$6.00 / MTok | \$0.20 / MTok | \$2.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.016. Billing is metered per token. Prices are live at `GET /api/v1/models/grok-4.6`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "grok-4.6",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="grok-4.6",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-4.6","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `grok-4.6` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `grok-4.6` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"grok-4.6"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-4.6");
if (!model.servable) throw new Error("grok-4.6 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Grok Build 0.1
Source: https://docs.ninjachat.ai/api-reference/models/chat/grok-build-0-1
grok-build-0.1 on NinjaChat — xAI's cost-efficient coding model tuned for agentic engineering and tool use. $1.00 / MTok input, $2.00 / MTok output.
`grok-build-0.1`
xAI
256,000-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
xAI's cost-efficient coding model tuned for agentic engineering and tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.00 / MTok | \$2.00 / MTok | \$0.20 / MTok | \$1.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.007. Billing is metered per token. Prices are live at `GET /api/v1/models/grok-build-0.1`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "grok-build-0.1",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="grok-build-0.1",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-build-0.1","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `grok-build-0.1` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `grok-build-0.1` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"grok-build-0.1"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-build-0.1");
if (!model.servable) throw new Error("grok-build-0.1 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Hermes 3 405B
Source: https://docs.ninjachat.ai/api-reference/models/chat/hermes-3-405b
hermes-3-405b on NinjaChat — Nous Research's 405B Llama 3.1 fine-tune for high-quality general assistance and controlled generation. $1.00 / MTok input, $1.00 / MTok output.
`hermes-3-405b`
Nous Research — served by DeepInfra
131,072-token context window · 16,384 max output tokens
Streaming, JSON mode, Long context, Multilingual
Nous Research's 405B Llama 3.1 fine-tune for high-quality general assistance and controlled generation.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.00 / MTok | \$1.00 / MTok | \$0.10 / MTok | \$1.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.006. Billing is metered per token. Prices are live at `GET /api/v1/models/hermes-3-405b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "hermes-3-405b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="hermes-3-405b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"hermes-3-405b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `hermes-3-405b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `hermes-3-405b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"hermes-3-405b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("hermes-3-405b");
if (!model.servable) throw new Error("hermes-3-405b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Hermes 3 70B
Source: https://docs.ninjachat.ai/api-reference/models/chat/hermes-3-70b
hermes-3-70b on NinjaChat — Nous Research's controllable Llama 3.1 fine-tune for assistants, structured output, and long-form conversation. $0.70 / MTok input, $0.70 / MTok output.
`hermes-3-70b`
Nous Research — served by DeepInfra
131,072-token context window · 16,384 max output tokens
Streaming, JSON mode, Long context, Multilingual
Nous Research's controllable Llama 3.1 fine-tune for assistants, structured output, and long-form conversation.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.70 / MTok | \$0.70 / MTok | \$0.07 / MTok | \$0.70 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0042. Billing is metered per token. Prices are live at `GET /api/v1/models/hermes-3-70b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "hermes-3-70b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="hermes-3-70b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"hermes-3-70b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `hermes-3-70b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `hermes-3-70b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"hermes-3-70b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("hermes-3-70b");
if (!model.servable) throw new Error("hermes-3-70b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# HY3
Source: https://docs.ninjachat.ai/api-reference/models/chat/hy3
hy3 on NinjaChat — Tencent's HY3 reasoning and coding model with a 262K-token context. $0.14 / MTok input, $0.58 / MTok output.
`hy3`
Tencent — served by GMI Cloud, DeepInfra
262,144-token context window · 128,000 max output tokens
Streaming, JSON mode, Reasoning, Long context, Multilingual
Tencent's HY3 reasoning and coding model with a 262K-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.14 / MTok | \$0.58 / MTok | \$0.014 / MTok | \$0.14 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0013. Billing is metered per token. Prices are live at `GET /api/v1/models/hy3`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "hy3",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="hy3",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"hy3","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `hy3` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `hy3` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"hy3"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("hy3");
if (!model.servable) throw new Error("hy3 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Inkling
Source: https://docs.ninjachat.ai/api-reference/models/chat/inkling
inkling on NinjaChat — Thinking Machines Lab's 975B multimodal open-weight generalist with 1M context. $1.00 / MTok input, $4.05 / MTok output.
`inkling`
Thinking Machines Lab — served by Fireworks AI, DeepInfra, Baseten
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Thinking Machines Lab's 975B multimodal open-weight generalist with 1M context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.00 / MTok | \$4.05 / MTok | \$0.10 / MTok | \$1.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0091. Billing is metered per token. Prices are live at `GET /api/v1/models/inkling`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "inkling",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="inkling",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"inkling","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `inkling` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `inkling` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"inkling"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("inkling");
if (!model.servable) throw new Error("inkling is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Inkling Small
Source: https://docs.ninjachat.ai/api-reference/models/chat/inkling-small
inkling-small on NinjaChat — Thinking Machines Lab's efficient 276B/12B-active multimodal reasoner with a 524K context window. $0.50 / MTok input, $1.20 / MTok output.
`inkling-small`
Thinking Machines Lab — served by DeepInfra, Baseten
524,288-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Thinking Machines Lab's efficient 276B/12B-active multimodal reasoner with a 524K context window.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.50 / MTok | \$1.20 / MTok | \$0.05 / MTok | \$0.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0037. Billing is metered per token. Prices are live at `GET /api/v1/models/inkling-small`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "inkling-small",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="inkling-small",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"inkling-small","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `inkling-small` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `inkling-small` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"inkling-small"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("inkling-small");
if (!model.servable) throw new Error("inkling-small is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Kimi K2.5
Source: https://docs.ninjachat.ai/api-reference/models/chat/kimi-k2-5
kimi-k2.5 on NinjaChat — Moonshot AI's native multimodal Kimi K2.5 for advanced coding, visual agents, and long-context reasoning. $0.60 / MTok input, $3.00 / MTok output.
`kimi-k2.5`
Moonshot AI — served by GMI Cloud, DeepInfra, DigitalOcean Inference
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Moonshot AI's native multimodal Kimi K2.5 for advanced coding, visual agents, and long-context reasoning.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.60 / MTok | \$3.00 / MTok | \$0.06 / MTok | \$0.60 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.006. Billing is metered per token. Prices are live at `GET /api/v1/models/kimi-k2.5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "kimi-k2.5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="kimi-k2.5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"kimi-k2.5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `kimi-k2.5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `kimi-k2.5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"kimi-k2.5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("kimi-k2.5");
if (!model.servable) throw new Error("kimi-k2.5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Kimi K2.6
Source: https://docs.ninjachat.ai/api-reference/models/chat/kimi-k2-6
kimi-k2.6 on NinjaChat — Moonshot's multimodal agentic model for long-horizon coding and autonomous execution. $0.95 / MTok input, $4.00 / MTok output.
`kimi-k2.6`
Moonshot AI — served by Fireworks AI, DeepInfra, GMI Cloud, Baseten, DigitalOcean Inference, Atlas Cloud, Chutes, Tencent Cloud TokenHub
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Moonshot's multimodal agentic model for long-horizon coding and autonomous execution.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.95 / MTok | \$4.00 / MTok | \$0.095 / MTok | \$0.95 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0088. Billing is metered per token. Prices are live at `GET /api/v1/models/kimi-k2.6`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "kimi-k2.6",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="kimi-k2.6",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"kimi-k2.6","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `kimi-k2.6` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `kimi-k2.6` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"kimi-k2.6"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("kimi-k2.6");
if (!model.servable) throw new Error("kimi-k2.6 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Kimi K2.6 Fast
Source: https://docs.ninjachat.ai/api-reference/models/chat/kimi-k2-6-fast
kimi-k2.6-fast on NinjaChat — Moonshot's latency-optimized Kimi K2.6 tier for fast reasoning, structured output, and tool use. $2.00 / MTok input, $8.00 / MTok output.
`kimi-k2.6-fast`
Moonshot AI — served by Fireworks AI
262,144-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Moonshot's latency-optimized Kimi K2.6 tier for fast reasoning, structured output, and tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$2.00 / MTok | \$8.00 / MTok | \$0.30 / MTok | \$2.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.018. Billing is metered per token. Prices are live at `GET /api/v1/models/kimi-k2.6-fast`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "kimi-k2.6-fast",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="kimi-k2.6-fast",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"kimi-k2.6-fast","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `kimi-k2.6-fast` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `kimi-k2.6-fast` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"kimi-k2.6-fast"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("kimi-k2.6-fast");
if (!model.servable) throw new Error("kimi-k2.6-fast is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Kimi K2.7 Code
Source: https://docs.ninjachat.ai/api-reference/models/chat/kimi-k2-7-code
kimi-k2.7-code on NinjaChat — Moonshot's coding-specialized Kimi with faster, more token-efficient long-horizon execution. $0.95 / MTok input, $4.00 / MTok output.
`kimi-k2.7-code`
Moonshot AI — served by Fireworks AI, DeepInfra, GMI Cloud, Baseten
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Moonshot's coding-specialized Kimi with faster, more token-efficient long-horizon execution.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.95 / MTok | \$4.00 / MTok | \$0.095 / MTok | \$0.95 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0088. Billing is metered per token. Prices are live at `GET /api/v1/models/kimi-k2.7-code`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "kimi-k2.7-code",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="kimi-k2.7-code",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"kimi-k2.7-code","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `kimi-k2.7-code` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `kimi-k2.7-code` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"kimi-k2.7-code"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("kimi-k2.7-code");
if (!model.servable) throw new Error("kimi-k2.7-code is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Kimi K2.7 Code Fast
Source: https://docs.ninjachat.ai/api-reference/models/chat/kimi-k2-7-code-fast
kimi-k2.7-code-fast on NinjaChat — Moonshot's high-throughput Kimi K2.7 Code tier for fast long-context engineering and structured code workloads. $1.90 / MTok input, $8.00 / MTok output.
`kimi-k2.7-code-fast`
Moonshot AI — served by GMI Cloud
262,144-token context window · 32,768 max output tokens
Streaming, JSON mode, Reasoning, Long context, Multilingual
Moonshot's high-throughput Kimi K2.7 Code tier for fast long-context engineering and structured code workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.90 / MTok | \$8.00 / MTok | \$0.38 / MTok | \$1.90 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0175. Billing is metered per token. Prices are live at `GET /api/v1/models/kimi-k2.7-code-fast`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "kimi-k2.7-code-fast",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="kimi-k2.7-code-fast",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"kimi-k2.7-code-fast","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `kimi-k2.7-code-fast` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `kimi-k2.7-code-fast` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"kimi-k2.7-code-fast"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("kimi-k2.7-code-fast");
if (!model.servable) throw new Error("kimi-k2.7-code-fast is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Kimi K3
Source: https://docs.ninjachat.ai/api-reference/models/chat/kimi-k3
kimi-k3 on NinjaChat — Moonshot's Kimi K3 frontier model with native vision and a 1M-token context. $3.00 / MTok input, $15.00 / MTok output.
`kimi-k3`
Moonshot AI — served by Fireworks AI, DeepInfra, GMI Cloud, Baseten, DigitalOcean Inference, Morph, Chutes
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Moonshot's Kimi K3 frontier model with native vision and a 1M-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$3.00 / MTok | \$15.00 / MTok | \$0.30 / MTok | \$3.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.03. Billing is metered per token. Prices are live at `GET /api/v1/models/kimi-k3`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "kimi-k3",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="kimi-k3",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"kimi-k3","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `kimi-k3` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `kimi-k3` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"kimi-k3"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("kimi-k3");
if (!model.servable) throw new Error("kimi-k3 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Kimi K3 Fast
Source: https://docs.ninjachat.ai/api-reference/models/chat/kimi-k3-fast
kimi-k3-fast on NinjaChat — Moonshot's latency-tuned Kimi K3 tier with native vision, tools, structured output, and a 1M-token context. $4.50 / MTok input, $22.50 / MTok output.
`kimi-k3-fast`
Moonshot AI — served by Fireworks AI
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Moonshot's latency-tuned Kimi K3 tier with native vision, tools, structured output, and a 1M-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$4.50 / MTok | \$22.50 / MTok | \$0.45 / MTok | \$4.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.045. Billing is metered per token. Prices are live at `GET /api/v1/models/kimi-k3-fast`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "kimi-k3-fast",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="kimi-k3-fast",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"kimi-k3-fast","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `kimi-k3-fast` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `kimi-k3-fast` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"kimi-k3-fast"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("kimi-k3-fast");
if (!model.servable) throw new Error("kimi-k3-fast is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Ling 3.0 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/ling-3-0-flash
ling-3.0-flash on NinjaChat — InclusionAI's 124B/5.1B-active MoE optimized for token-efficient production agents and tool execution. $0.06 / MTok input, $0.18 / MTok output.
`ling-3.0-flash`
InclusionAI — served by DeepInfra, Novita AI
131,072-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
InclusionAI's 124B/5.1B-active MoE optimized for token-efficient production agents and tool execution.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.06 / MTok | \$0.18 / MTok | \$0.006 / MTok | \$0.06 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0005. Billing is metered per token. Prices are live at `GET /api/v1/models/ling-3.0-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "ling-3.0-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="ling-3.0-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ling-3.0-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `ling-3.0-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `ling-3.0-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"ling-3.0-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("ling-3.0-flash");
if (!model.servable) throw new Error("ling-3.0-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Llama 3.1 70B
Source: https://docs.ninjachat.ai/api-reference/models/chat/llama-3-1-70b
llama-3.1-70b on NinjaChat — Meta's widely adopted Llama 3.1 70B instruct model for general agents, RAG, and multilingual chat. $0.40 / MTok input, $0.40 / MTok output.
`llama-3.1-70b`
Meta — served by DeepInfra
131,072-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Meta's widely adopted Llama 3.1 70B instruct model for general agents, RAG, and multilingual chat.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.40 / MTok | \$0.40 / MTok | \$0.04 / MTok | \$0.40 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0024. Billing is metered per token. Prices are live at `GET /api/v1/models/llama-3.1-70b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "llama-3.1-70b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="llama-3.1-70b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"llama-3.1-70b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `llama-3.1-70b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `llama-3.1-70b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"llama-3.1-70b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("llama-3.1-70b");
if (!model.servable) throw new Error("llama-3.1-70b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Llama 3.1 8B Instruct
Source: https://docs.ninjachat.ai/api-reference/models/chat/llama-3-1-8b
llama-3.1-8b on NinjaChat — Meta's compact long-context Llama 3.1 8B instruct model for extreme-volume workloads. $0.06 / MTok input, $0.06 / MTok output.
`llama-3.1-8b`
Meta — served by DeepInfra, Nscale Serverless Inference, Hugging Face Inference Providers
131,072-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Meta's compact long-context Llama 3.1 8B instruct model for extreme-volume workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.06 / MTok | \$0.06 / MTok | \$0.006 / MTok | \$0.06 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0004. Billing is metered per token. Prices are live at `GET /api/v1/models/llama-3.1-8b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "llama-3.1-8b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="llama-3.1-8b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"llama-3.1-8b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `llama-3.1-8b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `llama-3.1-8b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"llama-3.1-8b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("llama-3.1-8b");
if (!model.servable) throw new Error("llama-3.1-8b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Llama 3.3 70B Instruct Turbo
Source: https://docs.ninjachat.ai/api-reference/models/chat/llama-3-3-70b
llama-3.3-70b on NinjaChat — Meta's multilingual Llama 3.3 70B instruct model in a low-latency Turbo serving tier. $0.10 / MTok input, $0.32 / MTok output.
`llama-3.3-70b`
Meta — served by DeepInfra
131,072-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Meta's multilingual Llama 3.3 70B instruct model in a low-latency Turbo serving tier.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.10 / MTok | \$0.32 / MTok | \$0.01 / MTok | \$0.10 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0009. Billing is metered per token. Prices are live at `GET /api/v1/models/llama-3.3-70b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "llama-3.3-70b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="llama-3.3-70b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"llama-3.3-70b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `llama-3.3-70b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `llama-3.3-70b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"llama-3.3-70b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("llama-3.3-70b");
if (!model.servable) throw new Error("llama-3.3-70b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Llama 4 Maverick
Source: https://docs.ninjachat.ai/api-reference/models/chat/llama-4-maverick
llama-4-maverick on NinjaChat — Meta's 128-expert multimodal Llama 4 Maverick model with a full 1M-token context and tool use. $0.25 / MTok input, $0.87 / MTok output.
`llama-4-maverick`
Meta — served by DeepInfra, DigitalOcean Inference
1,048,576-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
Meta's 128-expert multimodal Llama 4 Maverick model with a full 1M-token context and tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.25 / MTok | \$0.87 / MTok | \$0.025 / MTok | \$0.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0022. Billing is metered per token. Prices are live at `GET /api/v1/models/llama-4-maverick`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "llama-4-maverick",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="llama-4-maverick",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"llama-4-maverick","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `llama-4-maverick` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `llama-4-maverick` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"llama-4-maverick"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("llama-4-maverick");
if (!model.servable) throw new Error("llama-4-maverick is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Llama 4 Scout
Source: https://docs.ninjachat.ai/api-reference/models/chat/llama-4-scout
llama-4-scout on NinjaChat — Meta's efficient multimodal Llama 4 Scout model with tool use and a 327K-token context. $0.11 / MTok input, $0.34 / MTok output.
`llama-4-scout`
Meta — served by DeepInfra
327,680-token context window · 8,192 max output tokens
Streaming, JSON mode, Long context, Multilingual
Meta's efficient multimodal Llama 4 Scout model with tool use and a 327K-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.11 / MTok | \$0.34 / MTok | \$0.011 / MTok | \$0.11 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0009. Billing is metered per token. Prices are live at `GET /api/v1/models/llama-4-scout`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "llama-4-scout",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="llama-4-scout",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"llama-4-scout","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `llama-4-scout` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `llama-4-scout` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"llama-4-scout"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("llama-4-scout");
if (!model.servable) throw new Error("llama-4-scout is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# LongCat 2.0
Source: https://docs.ninjachat.ai/api-reference/models/chat/longcat-2-0
longcat-2.0 on NinjaChat — Meituan's native million-token sparse-MoE model for agentic coding and long-horizon tool use. $0.75 / MTok input, $2.95 / MTok output.
`longcat-2.0`
Meituan — served by SiliconFlow, Atlas Cloud
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Meituan's native million-token sparse-MoE model for agentic coding and long-horizon tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.75 / MTok | \$2.95 / MTok | \$0.015 / MTok | \$0.75 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0067. Billing is metered per token. Prices are live at `GET /api/v1/models/longcat-2.0`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "longcat-2.0",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="longcat-2.0",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"longcat-2.0","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `longcat-2.0` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `longcat-2.0` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"longcat-2.0"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("longcat-2.0");
if (!model.servable) throw new Error("longcat-2.0 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Lunaris 8B Turbo
Source: https://docs.ninjachat.ai/api-reference/models/chat/lunaris-8b
lunaris-8b on NinjaChat — Sao10K's Lunaris 8B creative chat model for dialogue-heavy and roleplay workloads. $0.04 / MTok input, $0.05 / MTok output.
`lunaris-8b`
Sao10K — served by DeepInfra
8,192-token context window · 4,096 max output tokens
Streaming, JSON mode
Sao10K's Lunaris 8B creative chat model for dialogue-heavy and roleplay workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.04 / MTok | \$0.05 / MTok | \$0.004 / MTok | \$0.04 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0003. Billing is metered per token. Prices are live at `GET /api/v1/models/lunaris-8b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "lunaris-8b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="lunaris-8b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"lunaris-8b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `lunaris-8b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `lunaris-8b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"lunaris-8b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("lunaris-8b");
if (!model.servable) throw new Error("lunaris-8b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# MiMo V2.5
Source: https://docs.ninjachat.ai/api-reference/models/chat/mimo-v2-5
mimo-v2.5 on NinjaChat — Xiaomi's efficient multimodal agent model for coding and tool-driven workflows. $0.14 / MTok input, $0.28 / MTok output.
`mimo-v2.5`
Xiaomi — served by GMI Cloud, Xiaomi MiMo
1,048,576-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Xiaomi's efficient multimodal agent model for coding and tool-driven workflows.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.14 / MTok | \$0.28 / MTok | \$0.014 / MTok | \$0.14 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.001. Billing is metered per token. Prices are live at `GET /api/v1/models/mimo-v2.5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mimo-v2.5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mimo-v2.5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mimo-v2.5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mimo-v2.5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mimo-v2.5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mimo-v2.5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mimo-v2.5");
if (!model.servable) throw new Error("mimo-v2.5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# MiMo V2.5 Pro
Source: https://docs.ninjachat.ai/api-reference/models/chat/mimo-v2-5-pro
mimo-v2.5-pro on NinjaChat — Xiaomi's higher-capability MiMo V2.5 tier for long-context coding and tool-driven agents. $0.435 / MTok input, $0.87 / MTok output.
`mimo-v2.5-pro`
Xiaomi — served by GMI Cloud, Xiaomi MiMo
1,050,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Xiaomi's higher-capability MiMo V2.5 tier for long-context coding and tool-driven agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------- | :------------ | :-------------- | :------------- |
| \$0.435 / MTok | \$0.87 / MTok | \$0.0435 / MTok | \$0.435 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0031. Billing is metered per token. Prices are live at `GET /api/v1/models/mimo-v2.5-pro`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mimo-v2.5-pro",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mimo-v2.5-pro",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mimo-v2.5-pro","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mimo-v2.5-pro` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mimo-v2.5-pro` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mimo-v2.5-pro"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mimo-v2.5-pro");
if (!model.servable) throw new Error("mimo-v2.5-pro is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# MiniMax M2.5
Source: https://docs.ninjachat.ai/api-reference/models/chat/minimax-m2-5
minimax-m2.5 on NinjaChat — MiniMax's efficient M2.5 reasoning model for budget agents, coding, and multilingual tool use. $0.30 / MTok input, $1.20 / MTok output.
`minimax-m2.5`
MiniMax — served by DeepInfra, GMI Cloud, DigitalOcean Inference
196,608-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Multilingual
MiniMax's efficient M2.5 reasoning model for budget agents, coding, and multilingual tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.30 / MTok | \$1.20 / MTok | \$0.03 / MTok | \$0.30 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0027. Billing is metered per token. Prices are live at `GET /api/v1/models/minimax-m2.5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "minimax-m2.5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="minimax-m2.5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"minimax-m2.5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `minimax-m2.5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `minimax-m2.5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"minimax-m2.5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("minimax-m2.5");
if (!model.servable) throw new Error("minimax-m2.5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# MiniMax M2.7
Source: https://docs.ninjachat.ai/api-reference/models/chat/minimax-m2-7
minimax-m2.7 on NinjaChat — MiniMax's efficient agent model for complex harnesses and multi-step productivity work. $0.30 / MTok input, $1.20 / MTok output.
`minimax-m2.7`
MiniMax — served by Fireworks AI, DeepInfra, GMI Cloud, Novita AI
196,608-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
MiniMax's efficient agent model for complex harnesses and multi-step productivity work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.30 / MTok | \$1.20 / MTok | \$0.03 / MTok | \$0.30 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0027. Billing is metered per token. Prices are live at `GET /api/v1/models/minimax-m2.7`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "minimax-m2.7",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="minimax-m2.7",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"minimax-m2.7","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `minimax-m2.7` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `minimax-m2.7` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"minimax-m2.7"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("minimax-m2.7");
if (!model.servable) throw new Error("minimax-m2.7 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# MiniMax M2.7 Turbo
Source: https://docs.ninjachat.ai/api-reference/models/chat/minimax-m2-7-turbo
minimax-m2.7-turbo on NinjaChat — The high-throughput MiniMax M2.7 variant for reasoning-heavy agents and coding workflows. $0.38 / MTok input, $1.70 / MTok output.
`minimax-m2.7-turbo`
MiniMax — served by DeepInfra
196,608-token context window · 131,072 max output tokens
Streaming, Tool calling, Reasoning, Long context, Multilingual
The high-throughput MiniMax M2.7 variant for reasoning-heavy agents and coding workflows.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.38 / MTok | \$1.70 / MTok | \$0.07 / MTok | \$0.38 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0036. Billing is metered per token. Prices are live at `GET /api/v1/models/minimax-m2.7-turbo`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "minimax-m2.7-turbo",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="minimax-m2.7-turbo",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"minimax-m2.7-turbo","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `minimax-m2.7-turbo` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `minimax-m2.7-turbo` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"minimax-m2.7-turbo"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("minimax-m2.7-turbo");
if (!model.servable) throw new Error("minimax-m2.7-turbo is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# MiniMax M3
Source: https://docs.ninjachat.ai/api-reference/models/chat/minimax-m3
minimax-m3 on NinjaChat — MiniMax's low-cost open-weight frontier model with native multimodality and 512K context. $0.30 / MTok input, $1.20 / MTok output.
`minimax-m3`
MiniMax — served by Fireworks AI, DeepInfra, Morph
512,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
MiniMax's low-cost open-weight frontier model with native multimodality and 512K context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.30 / MTok | \$1.20 / MTok | \$0.03 / MTok | \$0.30 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0027. Billing is metered per token. Prices are live at `GET /api/v1/models/minimax-m3`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "minimax-m3",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="minimax-m3",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"minimax-m3","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `minimax-m3` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `minimax-m3` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"minimax-m3"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("minimax-m3");
if (!model.servable) throw new Error("minimax-m3 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Ministral 3 14B
Source: https://docs.ninjachat.ai/api-reference/models/chat/ministral-3-14b
ministral-3-14b on NinjaChat — Mistral's largest Ministral 3 model for capable budget agents, visual document work, and multilingual coding. $0.20 / MTok input, $0.20 / MTok output.
`ministral-3-14b`
Mistral AI — served by Mistral, DigitalOcean Inference
262,144-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
Mistral's largest Ministral 3 model for capable budget agents, visual document work, and multilingual coding.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$0.20 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0012. Billing is metered per token. Prices are live at `GET /api/v1/models/ministral-3-14b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "ministral-3-14b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="ministral-3-14b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ministral-3-14b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `ministral-3-14b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `ministral-3-14b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"ministral-3-14b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("ministral-3-14b");
if (!model.servable) throw new Error("ministral-3-14b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Ministral 3 3B
Source: https://docs.ninjachat.ai/api-reference/models/chat/ministral-3-3b
ministral-3-3b on NinjaChat — Mistral's smallest Ministral 3 model for inexpensive multilingual, visual, and function-calling workloads. $0.10 / MTok input, $0.10 / MTok output.
`ministral-3-3b`
Mistral AI — served by Mistral
131,072-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
Mistral's smallest Ministral 3 model for inexpensive multilingual, visual, and function-calling workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.10 / MTok | \$0.10 / MTok | \$0.01 / MTok | \$0.10 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0006. Billing is metered per token. Prices are live at `GET /api/v1/models/ministral-3-3b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "ministral-3-3b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="ministral-3-3b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ministral-3-3b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `ministral-3-3b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `ministral-3-3b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"ministral-3-3b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("ministral-3-3b");
if (!model.servable) throw new Error("ministral-3-3b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Ministral 3 8B
Source: https://docs.ninjachat.ai/api-reference/models/chat/ministral-3-8b
ministral-3-8b on NinjaChat — Mistral's balanced Ministral 3 model for fast visual understanding, coding, and tool use. $0.15 / MTok input, $0.15 / MTok output.
`ministral-3-8b`
Mistral AI — served by Mistral
262,144-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
Mistral's balanced Ministral 3 model for fast visual understanding, coding, and tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.15 / MTok | \$0.15 / MTok | \$0.015 / MTok | \$0.15 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0009. Billing is metered per token. Prices are live at `GET /api/v1/models/ministral-3-8b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "ministral-3-8b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="ministral-3-8b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ministral-3-8b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `ministral-3-8b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `ministral-3-8b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"ministral-3-8b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("ministral-3-8b");
if (!model.servable) throw new Error("ministral-3-8b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Mistral Large
Source: https://docs.ninjachat.ai/api-reference/models/chat/mistral-large
mistral-large on NinjaChat — Mistral AI's Mistral Large for multilingual tasks, coding, and general-purpose work. $2.00 / MTok input, $6.00 / MTok output.
`mistral-large`
Mistral AI — served by Mistral
128,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Multilingual
Mistral AI's Mistral Large for multilingual tasks, coding, and general-purpose work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$2.00 / MTok | \$6.00 / MTok | \$0.20 / MTok | \$2.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.016. Billing is metered per token. Prices are live at `GET /api/v1/models/mistral-large`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mistral-large",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mistral-large",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mistral-large","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mistral-large` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mistral-large` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mistral-large"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mistral-large");
if (!model.servable) throw new Error("mistral-large is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Mistral Large 3
Source: https://docs.ninjachat.ai/api-reference/models/chat/mistral-large-3
mistral-large-3 on NinjaChat — Mistral's open-weight 675B/41B-active general-purpose flagship with native vision and tool use. $0.50 / MTok input, $1.50 / MTok output.
`mistral-large-3`
Mistral AI — served by Mistral
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
Mistral's open-weight 675B/41B-active general-purpose flagship with native vision and tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.50 / MTok | \$1.50 / MTok | \$0.05 / MTok | \$0.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.004. Billing is metered per token. Prices are live at `GET /api/v1/models/mistral-large-3`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mistral-large-3",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mistral-large-3",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mistral-large-3","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mistral-large-3` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mistral-large-3` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mistral-large-3"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mistral-large-3");
if (!model.servable) throw new Error("mistral-large-3 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Mistral Medium 3.5
Source: https://docs.ninjachat.ai/api-reference/models/chat/mistral-medium-3-5
mistral-medium-3.5 on NinjaChat — Mistral's frontier-class multimodal model optimized for agentic coding and professional work. $1.50 / MTok input, $7.50 / MTok output.
`mistral-medium-3.5`
Mistral AI — served by Mistral
256,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Mistral's frontier-class multimodal model optimized for agentic coding and professional work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.50 / MTok | \$7.50 / MTok | \$0.15 / MTok | \$1.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.015. Billing is metered per token. Prices are live at `GET /api/v1/models/mistral-medium-3.5`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mistral-medium-3.5",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mistral-medium-3.5",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mistral-medium-3.5","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mistral-medium-3.5` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mistral-medium-3.5` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mistral-medium-3.5"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mistral-medium-3.5");
if (!model.servable) throw new Error("mistral-medium-3.5 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Mistral Nemo 12B
Source: https://docs.ninjachat.ai/api-reference/models/chat/mistral-nemo-12b
mistral-nemo-12b on NinjaChat — Mistral's compact multilingual 12B instruct model for bulk summarization and classification. $0.019 / MTok input, $0.03 / MTok output.
`mistral-nemo-12b`
Mistral AI — served by DeepInfra
131,072-token context window · 32,768 max output tokens
Streaming, Long context, Multilingual
Mistral's compact multilingual 12B instruct model for bulk summarization and classification.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------- | :------------ | :-------------- | :------------- |
| \$0.019 / MTok | \$0.03 / MTok | \$0.0019 / MTok | \$0.019 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0002. Billing is metered per token. Prices are live at `GET /api/v1/models/mistral-nemo-12b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mistral-nemo-12b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mistral-nemo-12b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mistral-nemo-12b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mistral-nemo-12b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mistral-nemo-12b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mistral-nemo-12b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mistral-nemo-12b");
if (!model.servable) throw new Error("mistral-nemo-12b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Mistral Nemo 12B TEE
Source: https://docs.ninjachat.ai/api-reference/models/chat/mistral-nemo-12b-tee
mistral-nemo-12b-tee on NinjaChat — Mistral's compact multilingual 12B model served in a TEE-backed confidential-compute environment. $0.02 / MTok input, $0.10 / MTok output.
`mistral-nemo-12b-tee`
Mistral AI — served by Chutes
131,072-token context window · 32,768 max output tokens
Streaming, JSON mode, Long context, Multilingual
Mistral's compact multilingual 12B model served in a TEE-backed confidential-compute environment.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.02 / MTok | \$0.10 / MTok | \$0.002 / MTok | \$0.02 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0002. Billing is metered per token. Prices are live at `GET /api/v1/models/mistral-nemo-12b-tee`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mistral-nemo-12b-tee",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mistral-nemo-12b-tee",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mistral-nemo-12b-tee","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mistral-nemo-12b-tee` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mistral-nemo-12b-tee` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mistral-nemo-12b-tee"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mistral-nemo-12b-tee");
if (!model.servable) throw new Error("mistral-nemo-12b-tee is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Mistral Small 24B
Source: https://docs.ninjachat.ai/api-reference/models/chat/mistral-small-24b
mistral-small-24b on NinjaChat — Mistral's efficient 24B instruct model with JSON support for structured generation and multilingual drafting. $0.05 / MTok input, $0.08 / MTok output.
`mistral-small-24b`
Mistral AI — served by DeepInfra
32,768-token context window · 32,768 max output tokens
Streaming, JSON mode, Multilingual
Mistral's efficient 24B instruct model with JSON support for structured generation and multilingual drafting.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.05 / MTok | \$0.08 / MTok | \$0.005 / MTok | \$0.05 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0004. Billing is metered per token. Prices are live at `GET /api/v1/models/mistral-small-24b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mistral-small-24b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mistral-small-24b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mistral-small-24b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mistral-small-24b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mistral-small-24b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mistral-small-24b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mistral-small-24b");
if (!model.servable) throw new Error("mistral-small-24b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Mistral Small 3.2 24B
Source: https://docs.ninjachat.ai/api-reference/models/chat/mistral-small-3-2-24b
mistral-small-3.2-24b on NinjaChat — Mistral's inexpensive Small 3.2 multimodal instruct model with tools and structured JSON. $0.075 / MTok input, $0.20 / MTok output.
`mistral-small-3.2-24b`
Mistral AI — served by DeepInfra
128,000-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
Mistral's inexpensive Small 3.2 multimodal instruct model with tools and structured JSON.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------- | :------------ | :-------------- | :------------- |
| \$0.075 / MTok | \$0.20 / MTok | \$0.0075 / MTok | \$0.075 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0006. Billing is metered per token. Prices are live at `GET /api/v1/models/mistral-small-3.2-24b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mistral-small-3.2-24b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mistral-small-3.2-24b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mistral-small-3.2-24b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mistral-small-3.2-24b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mistral-small-3.2-24b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mistral-small-3.2-24b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mistral-small-3.2-24b");
if (!model.servable) throw new Error("mistral-small-3.2-24b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Mistral Small 4
Source: https://docs.ninjachat.ai/api-reference/models/chat/mistral-small-4
mistral-small-4 on NinjaChat — Mistral's efficient 119B/6.5B-active hybrid model unifying instruct, reasoning, and coding. $0.15 / MTok input, $0.60 / MTok output.
`mistral-small-4`
Mistral AI — served by Mistral
256,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Mistral's efficient 119B/6.5B-active hybrid model unifying instruct, reasoning, and coding.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.15 / MTok | \$0.60 / MTok | \$0.015 / MTok | \$0.15 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0014. Billing is metered per token. Prices are live at `GET /api/v1/models/mistral-small-4`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mistral-small-4",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mistral-small-4",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mistral-small-4","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mistral-small-4` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mistral-small-4` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mistral-small-4"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mistral-small-4");
if (!model.servable) throw new Error("mistral-small-4 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Muse Glimmer 30B
Source: https://docs.ninjachat.ai/api-reference/models/chat/muse-glimmer-30b
muse-glimmer-30b on NinjaChat — Meta's fast 30B Muse Glimmer multimodal model with vision and function calling. $0.35 / MTok input, $1.50 / MTok output.
`muse-glimmer-30b`
Meta — served by Fireworks AI, DeepInfra
131,072-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
Meta's fast 30B Muse Glimmer multimodal model with vision and function calling.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.35 / MTok | \$1.50 / MTok | \$0.035 / MTok | \$0.35 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0033. Billing is metered per token. Prices are live at `GET /api/v1/models/muse-glimmer-30b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "muse-glimmer-30b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="muse-glimmer-30b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"muse-glimmer-30b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `muse-glimmer-30b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `muse-glimmer-30b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"muse-glimmer-30b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("muse-glimmer-30b");
if (!model.servable) throw new Error("muse-glimmer-30b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# MythoMax 13B
Source: https://docs.ninjachat.ai/api-reference/models/chat/mythomax-13b
mythomax-13b on NinjaChat — Gryphe's established 13B creative model for compact roleplay and dialogue workloads. $0.40 / MTok input, $0.40 / MTok output.
`mythomax-13b`
Gryphe — served by DeepInfra
4,096-token context window · 2,048 max output tokens
Streaming
Gryphe's established 13B creative model for compact roleplay and dialogue workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.40 / MTok | \$0.40 / MTok | \$0.04 / MTok | \$0.40 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0024. Billing is metered per token. Prices are live at `GET /api/v1/models/mythomax-13b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "mythomax-13b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="mythomax-13b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mythomax-13b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `mythomax-13b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `mythomax-13b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"mythomax-13b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("mythomax-13b");
if (!model.servable) throw new Error("mythomax-13b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Nemotron 3.5 Lightning
Source: https://docs.ninjachat.ai/api-reference/models/chat/nemotron-3-5-lightning
nemotron-3.5-lightning on NinjaChat — NVIDIA's hybrid Mamba-Transformer reasoning model with 3B active parameters. $0.08 / MTok input, $0.20 / MTok output.
`nemotron-3.5-lightning`
NVIDIA — served by Fireworks AI, DeepInfra
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context
NVIDIA's hybrid Mamba-Transformer reasoning model with 3B active parameters.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.08 / MTok | \$0.20 / MTok | \$0.008 / MTok | \$0.08 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0006. Billing is metered per token. Prices are live at `GET /api/v1/models/nemotron-3.5-lightning`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "nemotron-3.5-lightning",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="nemotron-3.5-lightning",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nemotron-3.5-lightning","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `nemotron-3.5-lightning` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `nemotron-3.5-lightning` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"nemotron-3.5-lightning"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nemotron-3.5-lightning");
if (!model.servable) throw new Error("nemotron-3.5-lightning is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Nemotron 3 Nano 30B A3B
Source: https://docs.ninjachat.ai/api-reference/models/chat/nemotron-3-nano
nemotron-3-nano on NinjaChat — NVIDIA's efficient hybrid MoE reasoning model with 3B active parameters. $0.05 / MTok input, $0.20 / MTok output.
`nemotron-3-nano`
NVIDIA — served by DeepInfra, Novita AI
262,144-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
NVIDIA's efficient hybrid MoE reasoning model with 3B active parameters.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.05 / MTok | \$0.20 / MTok | \$0.005 / MTok | \$0.05 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0005. Billing is metered per token. Prices are live at `GET /api/v1/models/nemotron-3-nano`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "nemotron-3-nano",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="nemotron-3-nano",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nemotron-3-nano","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `nemotron-3-nano` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `nemotron-3-nano` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"nemotron-3-nano"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nemotron-3-nano");
if (!model.servable) throw new Error("nemotron-3-nano is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Nemotron 3 Nano Omni
Source: https://docs.ninjachat.ai/api-reference/models/chat/nemotron-3-nano-omni
nemotron-3-nano-omni on NinjaChat — NVIDIA's compact Omni model for image-aware reasoning and function-driven agent workloads. $0.50 / MTok input, $0.90 / MTok output.
`nemotron-3-nano-omni`
NVIDIA — served by DigitalOcean Inference, Chutes
65,536-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
NVIDIA's compact Omni model for image-aware reasoning and function-driven agent workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.50 / MTok | \$0.90 / MTok | \$0.05 / MTok | \$0.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0034. Billing is metered per token. Prices are live at `GET /api/v1/models/nemotron-3-nano-omni`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "nemotron-3-nano-omni",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="nemotron-3-nano-omni",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nemotron-3-nano-omni","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `nemotron-3-nano-omni` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `nemotron-3-nano-omni` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"nemotron-3-nano-omni"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nemotron-3-nano-omni");
if (!model.servable) throw new Error("nemotron-3-nano-omni is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Nemotron 3 Super
Source: https://docs.ninjachat.ai/api-reference/models/chat/nemotron-3-super
nemotron-3-super on NinjaChat — NVIDIA's 120B/12B-active hybrid MoE for compute-efficient multi-agent reasoning and tool workflows. $0.30 / MTok input, $0.65 / MTok output.
`nemotron-3-super`
NVIDIA — served by DeepInfra, DigitalOcean Inference, Amazon Bedrock
262,144-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context
NVIDIA's 120B/12B-active hybrid MoE for compute-efficient multi-agent reasoning and tool workflows.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.30 / MTok | \$0.65 / MTok | \$0.03 / MTok | \$0.30 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0022. Billing is metered per token. Prices are live at `GET /api/v1/models/nemotron-3-super`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "nemotron-3-super",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="nemotron-3-super",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nemotron-3-super","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `nemotron-3-super` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `nemotron-3-super` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"nemotron-3-super"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nemotron-3-super");
if (!model.servable) throw new Error("nemotron-3-super is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Nemotron 3 Ultra
Source: https://docs.ninjachat.ai/api-reference/models/chat/nemotron-3-ultra
nemotron-3-ultra on NinjaChat — NVIDIA's 550B/55B-active frontier reasoning model for demanding agent workloads. $0.90 / MTok input, $2.40 / MTok output.
`nemotron-3-ultra`
NVIDIA — served by Fireworks AI, DeepInfra, Baseten, DigitalOcean Inference
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context
NVIDIA's 550B/55B-active frontier reasoning model for demanding agent workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.90 / MTok | \$2.40 / MTok | \$0.09 / MTok | \$0.90 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0069. Billing is metered per token. Prices are live at `GET /api/v1/models/nemotron-3-ultra`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "nemotron-3-ultra",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="nemotron-3-ultra",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nemotron-3-ultra","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `nemotron-3-ultra` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `nemotron-3-ultra` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"nemotron-3-ultra"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nemotron-3-ultra");
if (!model.servable) throw new Error("nemotron-3-ultra is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Nemotron Nano 12B v2 VL
Source: https://docs.ninjachat.ai/api-reference/models/chat/nemotron-nano-12b-v2-vl
nemotron-nano-12b-v2-vl on NinjaChat — NVIDIA's compact multimodal reasoning model for cost-efficient visual agents and tool workflows. $0.20 / MTok input, $0.60 / MTok output.
`nemotron-nano-12b-v2-vl`
NVIDIA — served by DigitalOcean Inference
128,000-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
NVIDIA's compact multimodal reasoning model for cost-efficient visual agents and tool workflows.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$0.60 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0016. Billing is metered per token. Prices are live at `GET /api/v1/models/nemotron-nano-12b-v2-vl`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "nemotron-nano-12b-v2-vl",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="nemotron-nano-12b-v2-vl",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nemotron-nano-12b-v2-vl","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `nemotron-nano-12b-v2-vl` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `nemotron-nano-12b-v2-vl` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"nemotron-nano-12b-v2-vl"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nemotron-nano-12b-v2-vl");
if (!model.servable) throw new Error("nemotron-nano-12b-v2-vl is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Nemotron Nano 9B V2
Source: https://docs.ninjachat.ai/api-reference/models/chat/nemotron-nano-9b-v2
nemotron-nano-9b-v2 on NinjaChat — NVIDIA's compact 9B controllable-reasoning model with fast tool calls. $0.06 / MTok input, $0.23 / MTok output.
`nemotron-nano-9b-v2`
NVIDIA — served by Amazon Bedrock
131,072-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context
NVIDIA's compact 9B controllable-reasoning model with fast tool calls.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.06 / MTok | \$0.23 / MTok | \$0.006 / MTok | \$0.06 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0006. Billing is metered per token. Prices are live at `GET /api/v1/models/nemotron-nano-9b-v2`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "nemotron-nano-9b-v2",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="nemotron-nano-9b-v2",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nemotron-nano-9b-v2","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `nemotron-nano-9b-v2` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `nemotron-nano-9b-v2` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"nemotron-nano-9b-v2"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nemotron-nano-9b-v2");
if (!model.servable) throw new Error("nemotron-nano-9b-v2 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Nex N2 Pro
Source: https://docs.ninjachat.ai/api-reference/models/chat/nex-n2-pro
nex-n2-pro on NinjaChat — Nex AGI's frontier agentic model for coding, multimodal reasoning, and long-horizon execution. $0.50 / MTok input, $2.50 / MTok output.
`nex-n2-pro`
Nex AGI — served by SiliconFlow
262,144-token context window · 256,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context
Nex AGI's frontier agentic model for coding, multimodal reasoning, and long-horizon execution.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.50 / MTok | \$2.50 / MTok | \$0.25 / MTok | \$0.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.005. Billing is metered per token. Prices are live at `GET /api/v1/models/nex-n2-pro`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "nex-n2-pro",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="nex-n2-pro",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nex-n2-pro","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `nex-n2-pro` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `nex-n2-pro` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"nex-n2-pro"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nex-n2-pro");
if (!model.servable) throw new Error("nex-n2-pro is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Ninja 1
Source: https://docs.ninjachat.ai/api-reference/models/chat/ninja-1
ninja-1 on NinjaChat — NinjaChat's stable default-model alias, currently backed by ByteDance Seed 1.8. $0.25 / MTok input, $2.00 / MTok output.
`ninja-1`
NinjaChat — served by BytePlus (Seed)
256,000-token context window · 64,000 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning
NinjaChat's stable default-model alias, currently backed by ByteDance Seed 1.8.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.25 / MTok | \$2.00 / MTok | \$0.05 / MTok | \$0.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0033. Billing is metered per token. Prices are live at `GET /api/v1/models/ninja-1`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "ninja-1",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="ninja-1",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ninja-1","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `ninja-1` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `ninja-1` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"ninja-1"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("ninja-1");
if (!model.servable) throw new Error("ninja-1 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# o3-mini
Source: https://docs.ninjachat.ai/api-reference/models/chat/o3-mini
o3-mini on NinjaChat — OpenAI's o3-mini reasoning model for math, logic, and step-by-step problems. $1.10 / MTok input, $4.40 / MTok output.
`o3-mini`
OpenAI
200,000-token context window · 100,000 max output tokens
Streaming, JSON mode, Reasoning
OpenAI's o3-mini reasoning model for math, logic, and step-by-step problems.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.10 / MTok | \$4.40 / MTok | \$0.11 / MTok | \$1.10 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0099. Billing is metered per token. Prices are live at `GET /api/v1/models/o3-mini`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "o3-mini",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="o3-mini",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"o3-mini","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `o3-mini` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `o3-mini` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"o3-mini"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("o3-mini");
if (!model.servable) throw new Error("o3-mini is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Phi-4
Source: https://docs.ninjachat.ai/api-reference/models/chat/phi-4
phi-4 on NinjaChat — Microsoft's compact 14B reasoning model with reliable structured output. $0.07 / MTok input, $0.14 / MTok output.
`phi-4`
Microsoft — served by DeepInfra
16,384-token context window · 16,384 max output tokens
Streaming, JSON mode, Reasoning
Microsoft's compact 14B reasoning model with reliable structured output.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.07 / MTok | \$0.14 / MTok | \$0.007 / MTok | \$0.07 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0005. Billing is metered per token. Prices are live at `GET /api/v1/models/phi-4`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "phi-4",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="phi-4",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"phi-4","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `phi-4` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `phi-4` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"phi-4"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("phi-4");
if (!model.servable) throw new Error("phi-4 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 2.5 72B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-2-5-72b
qwen-2.5-72b on NinjaChat — Qwen's capable 72B instruction model for multilingual agents, code, math, and structured output. $0.36 / MTok input, $0.40 / MTok output.
`qwen-2.5-72b`
Qwen — served by DeepInfra
32,768-token context window · 8,192 max output tokens
Streaming, JSON mode, Tool calling, Multilingual
Qwen's capable 72B instruction model for multilingual agents, code, math, and structured output.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.36 / MTok | \$0.40 / MTok | \$0.036 / MTok | \$0.36 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0022. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-2.5-72b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-2.5-72b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-2.5-72b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-2.5-72b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-2.5-72b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-2.5-72b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-2.5-72b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-2.5-72b");
if (!model.servable) throw new Error("qwen-2.5-72b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.5 122B A10B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-5-122b-a10b
qwen-3.5-122b-a10b on NinjaChat — Qwen's 122B/10B-active multimodal MoE, balancing stronger quality with efficient inference. $0.29 / MTok input, $2.40 / MTok output.
`qwen-3.5-122b-a10b`
Qwen — served by DeepInfra, SiliconFlow
262,144-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's 122B/10B-active multimodal MoE, balancing stronger quality with efficient inference.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.29 / MTok | \$2.40 / MTok | \$0.029 / MTok | \$0.29 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0039. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.5-122b-a10b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.5-122b-a10b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.5-122b-a10b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.5-122b-a10b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.5-122b-a10b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.5-122b-a10b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.5-122b-a10b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.5-122b-a10b");
if (!model.servable) throw new Error("qwen-3.5-122b-a10b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.5 27B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-5-27b
qwen-3.5-27b on NinjaChat — Qwen's dense 27B multimodal model for capable coding, reasoning, and visual tool workflows. $0.26 / MTok input, $2.60 / MTok output.
`qwen-3.5-27b`
Qwen — served by DeepInfra, SiliconFlow
262,144-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's dense 27B multimodal model for capable coding, reasoning, and visual tool workflows.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.26 / MTok | \$2.60 / MTok | \$0.026 / MTok | \$0.26 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0039. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.5-27b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.5-27b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.5-27b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.5-27b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.5-27b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.5-27b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.5-27b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.5-27b");
if (!model.servable) throw new Error("qwen-3.5-27b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.5 35B A3B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-5-35b-a3b
qwen-3.5-35b-a3b on NinjaChat — Qwen's efficient 35B MoE activates only 3B parameters per token while supporting tools and vision. $0.14 / MTok input, $1.00 / MTok output.
`qwen-3.5-35b-a3b`
Qwen — served by DeepInfra
262,144-token context window · 81,920 max output tokens
Streaming, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's efficient 35B MoE activates only 3B parameters per token while supporting tools and vision.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.14 / MTok | \$1.00 / MTok | \$0.014 / MTok | \$0.14 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0017. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.5-35b-a3b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.5-35b-a3b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.5-35b-a3b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.5-35b-a3b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.5-35b-a3b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.5-35b-a3b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.5-35b-a3b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.5-35b-a3b");
if (!model.servable) throw new Error("qwen-3.5-35b-a3b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.5 397B A17B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-5-397b-a17b
qwen-3.5-397b-a17b on NinjaChat — Qwen's 397B/17B-active multimodal flagship with broad multilingual, coding, and agentic capability. $0.55 / MTok input, $3.50 / MTok output.
`qwen-3.5-397b-a17b`
Qwen — served by DeepInfra, DigitalOcean Inference, Morph, Chutes
262,144-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's 397B/17B-active multimodal flagship with broad multilingual, coding, and agentic capability.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.55 / MTok | \$3.50 / MTok | \$0.055 / MTok | \$0.55 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0063. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.5-397b-a17b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.5-397b-a17b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.5-397b-a17b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.5-397b-a17b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.5-397b-a17b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.5-397b-a17b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.5-397b-a17b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.5-397b-a17b");
if (!model.servable) throw new Error("qwen-3.5-397b-a17b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.5 9B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-5-9b
qwen-3.5-9b on NinjaChat — Qwen's compact 9B multimodal reasoning model with tools and a 262K-token context. $0.10 / MTok input, $0.15 / MTok output.
`qwen-3.5-9b`
Qwen — served by DeepInfra, SiliconFlow
262,144-token context window · 81,920 max output tokens
Streaming, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's compact 9B multimodal reasoning model with tools and a 262K-token context.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.10 / MTok | \$0.15 / MTok | \$0.01 / MTok | \$0.10 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0007. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.5-9b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.5-9b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.5-9b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.5-9b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.5-9b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.5-9b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.5-9b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.5-9b");
if (!model.servable) throw new Error("qwen-3.5-9b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.5 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-5-flash
qwen-3.5-flash on NinjaChat — Qwen's low-latency vision-language MoE for million-token multimodal analysis, portable tool use, and production agents. $0.10 / MTok input, $0.40 / MTok output.
`qwen-3.5-flash`
Qwen — served by Alibaba Cloud Model Studio
1,000,000-token context window · 65,536 max output tokens
Streaming, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's low-latency vision-language MoE for million-token multimodal analysis, portable tool use, and production agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.10 / MTok | \$0.40 / MTok | \$0.01 / MTok | \$0.10 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0009. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.5-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.5-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.5-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.5-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.5-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.5-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.5-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.5-flash");
if (!model.servable) throw new Error("qwen-3.5-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.6 27B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-6-27b
qwen-3.6-27b on NinjaChat — Qwen's compact 27B multimodal reasoning model for fast agents, agentic coding, and visual reasoning. $0.60 / MTok input, $3.20 / MTok output.
`qwen-3.6-27b`
Qwen — served by DeepInfra, Groq, Morph, Chutes
131,072-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's compact 27B multimodal reasoning model for fast agents, agentic coding, and visual reasoning.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.60 / MTok | \$3.20 / MTok | \$0.06 / MTok | \$0.60 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0062. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.6-27b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.6-27b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.6-27b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.6-27b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.6-27b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.6-27b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.6-27b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.6-27b");
if (!model.servable) throw new Error("qwen-3.6-27b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.6 35B A3B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-6-35b-a3b
qwen-3.6-35b-a3b on NinjaChat — Qwen's sparse 35B/3B-active multimodal model for efficient coding and agents. $0.10 / MTok input, $0.95 / MTok output.
`qwen-3.6-35b-a3b`
Qwen — served by DeepInfra
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's sparse 35B/3B-active multimodal model for efficient coding and agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.10 / MTok | \$0.95 / MTok | \$0.01 / MTok | \$0.10 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0015. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.6-35b-a3b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.6-35b-a3b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.6-35b-a3b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.6-35b-a3b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.6-35b-a3b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.6-35b-a3b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.6-35b-a3b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.6-35b-a3b");
if (!model.servable) throw new Error("qwen-3.6-35b-a3b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.6 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-6-flash
qwen-3.6-flash on NinjaChat — Qwen's fast native vision-language model for million-token multimodal reasoning, coding, and production agents. $0.25 / MTok input, $1.50 / MTok output.
`qwen-3.6-flash`
Qwen — served by Alibaba Cloud Model Studio
1,000,000-token context window · 65,536 max output tokens
Streaming, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's fast native vision-language model for million-token multimodal reasoning, coding, and production agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.25 / MTok | \$1.50 / MTok | \$0.025 / MTok | \$0.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0028. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.6-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.6-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.6-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.6-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.6-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.6-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.6-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.6-flash");
if (!model.servable) throw new Error("qwen-3.6-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.6 Plus
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-6-plus
qwen-3.6-plus on NinjaChat — Qwen's native vision-language Plus model for million-token multimodal reasoning, coding, and structured agent work. $0.50 / MTok input, $3.00 / MTok output.
`qwen-3.6-plus`
Qwen — served by Alibaba Cloud Model Studio
1,000,000-token context window · 65,536 max output tokens
Streaming, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's native vision-language Plus model for million-token multimodal reasoning, coding, and structured agent work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.50 / MTok | \$3.00 / MTok | \$0.05 / MTok | \$0.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0055. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.6-plus`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.6-plus",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.6-plus",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.6-plus","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.6-plus` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.6-plus` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.6-plus"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.6-plus");
if (!model.servable) throw new Error("qwen-3.6-plus is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.7 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-7-flash
qwen-3.7-flash on NinjaChat — Qwen's low-cost million-token multimodal model for fast reasoning, coding, video understanding, tools, and structured output. $0.225 / MTok input, $0.90 / MTok output.
`qwen-3.7-flash`
Qwen — served by Alibaba Cloud Model Studio
1,000,000-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's low-cost million-token multimodal model for fast reasoning, coding, video understanding, tools, and structured output.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------- | :------------ | :------------- | :------------- |
| \$0.225 / MTok | \$0.90 / MTok | \$0.045 / MTok | \$0.225 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0021. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.7-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.7-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.7-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.7-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.7-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.7-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.7-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.7-flash");
if (!model.servable) throw new Error("qwen-3.7-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.7 Max
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-7-max
qwen-3.7-max on NinjaChat — Qwen's proprietary Max model for long-context coding, analysis, and multilingual knowledge work. $5.00 / MTok input, $15.00 / MTok output.
`qwen-3.7-max`
Qwen — served by GMI Cloud, DeepInfra
256,000-token context window · 16,384 max output tokens
Streaming, JSON mode, Long context, Multilingual
Qwen's proprietary Max model for long-context coding, analysis, and multilingual knowledge work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------- | :------------ | :------------ |
| \$5.00 / MTok | \$15.00 / MTok | \$1.00 / MTok | \$5.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.04. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.7-max`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.7-max",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.7-max",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.7-max","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.7-max` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.7-max` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.7-max"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.7-max");
if (!model.servable) throw new Error("qwen-3.7-max is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.7 Plus
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-7-plus
qwen-3.7-plus on NinjaChat — Qwen's fast multimodal flagship for agent loops, coding, and tool use. $0.50 / MTok input, $3.00 / MTok output.
`qwen-3.7-plus`
Qwen — served by Fireworks AI
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's fast multimodal flagship for agent loops, coding, and tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.50 / MTok | \$3.00 / MTok | \$0.05 / MTok | \$0.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0055. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.7-plus`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.7-plus",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.7-plus",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.7-plus","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.7-plus` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.7-plus` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.7-plus"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.7-plus");
if (!model.servable) throw new Error("qwen-3.7-plus is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.8 2.4T A95B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-8-2-4t
qwen-3.8-2.4t on NinjaChat — Qwen's open-weight 2.4T-parameter sparse-MoE flagship with 95B active parameters. $2.00 / MTok input, $6.00 / MTok output.
`qwen-3.8-2.4t`
Qwen — served by Fireworks AI, DeepInfra
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Qwen's open-weight 2.4T-parameter sparse-MoE flagship with 95B active parameters.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$2.00 / MTok | \$6.00 / MTok | \$0.20 / MTok | \$2.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.016. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.8-2.4t`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.8-2.4t",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.8-2.4t",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.8-2.4t","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.8-2.4t` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.8-2.4t` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.8-2.4t"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.8-2.4t");
if (!model.servable) throw new Error("qwen-3.8-2.4t is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.8 27B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-8-27b
qwen-3.8-27b on NinjaChat — Qwen's efficient 27B multimodal model for cost-efficient coding, long-context agents, and multilingual work. $0.45 / MTok input, $3.20 / MTok output.
`qwen-3.8-27b`
Qwen — served by DeepInfra, GMI Cloud, Chutes
1,048,575-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Qwen's efficient 27B multimodal model for cost-efficient coding, long-context agents, and multilingual work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.45 / MTok | \$3.20 / MTok | \$0.045 / MTok | \$0.45 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0055. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.8-27b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.8-27b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.8-27b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.8-27b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.8-27b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.8-27b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.8-27b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.8-27b");
if (!model.servable) throw new Error("qwen-3.8-27b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.8 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-8-flash
qwen-3.8-flash on NinjaChat — Alibaba's Qwen 3.8 Flash multimodal reasoning model for coding, agents, and document analysis. $0.15 / MTok input, $0.47 / MTok output.
`qwen-3.8-flash`
Qwen — served by Novita AI
1,000,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
Alibaba's Qwen 3.8 Flash multimodal reasoning model for coding, agents, and document analysis.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.15 / MTok | \$0.47 / MTok | \$0.015 / MTok | \$0.15 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0013. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.8-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.8-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.8-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.8-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.8-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.8-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.8-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.8-flash");
if (!model.servable) throw new Error("qwen-3.8-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen 3.8 Max
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen-3-8-max
qwen-3.8-max on NinjaChat — Qwen's 2.4T-parameter sparse-MoE frontier model for autonomous long-horizon work. $2.00 / MTok input, $6.00 / MTok output.
`qwen-3.8-max`
Qwen — served by DeepInfra, Fireworks AI, GMI Cloud, DigitalOcean Inference, Atlas Cloud
262,144-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Qwen's 2.4T-parameter sparse-MoE frontier model for autonomous long-horizon work.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$2.00 / MTok | \$6.00 / MTok | \$0.20 / MTok | \$2.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.016. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen-3.8-max`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen-3.8-max",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen-3.8-max",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-3.8-max","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen-3.8-max` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen-3.8-max` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen-3.8-max"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-3.8-max");
if (!model.servable) throw new Error("qwen-3.8-max is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen2.5 Coder 3B Instruct
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen2-5-coder-3b
qwen2.5-coder-3b on NinjaChat — Qwen's tiny coding specialist for latency-sensitive and extreme-volume API workloads. $0.01 / MTok input, $0.03 / MTok output.
`qwen2.5-coder-3b`
Qwen — served by Nscale Serverless Inference
32,768-token context window · 8,192 max output tokens
Streaming, JSON mode, Multilingual
Qwen's tiny coding specialist for latency-sensitive and extreme-volume API workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.01 / MTok | \$0.03 / MTok | \$0.001 / MTok | \$0.01 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0001. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen2.5-coder-3b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen2.5-coder-3b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen2.5-coder-3b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen2.5-coder-3b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen2.5-coder-3b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen2.5-coder-3b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen2.5-coder-3b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen2.5-coder-3b");
if (!model.servable) throw new Error("qwen2.5-coder-3b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen2.5 Coder 7B Instruct
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen2-5-coder-7b
qwen2.5-coder-7b on NinjaChat — Qwen's compact coding specialist for inexpensive generation and structured code workflows. $0.01 / MTok input, $0.03 / MTok output.
`qwen2.5-coder-7b`
Qwen — served by Nscale Serverless Inference
131,072-token context window · 8,192 max output tokens
Streaming, JSON mode, Long context, Multilingual
Qwen's compact coding specialist for inexpensive generation and structured code workflows.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.01 / MTok | \$0.03 / MTok | \$0.001 / MTok | \$0.01 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0001. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen2.5-coder-7b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen2.5-coder-7b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen2.5-coder-7b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen2.5-coder-7b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen2.5-coder-7b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen2.5-coder-7b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen2.5-coder-7b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen2.5-coder-7b");
if (!model.servable) throw new Error("qwen2.5-coder-7b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 14B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-14b
qwen3-14b on NinjaChat — Qwen's compact hybrid reasoning model for economical structured workloads. $0.12 / MTok input, $0.24 / MTok output.
`qwen3-14b`
Qwen — served by DeepInfra, Nscale Serverless Inference
40,960-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Qwen's compact hybrid reasoning model for economical structured workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.12 / MTok | \$0.24 / MTok | \$0.012 / MTok | \$0.12 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0009. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-14b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-14b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-14b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-14b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-14b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-14b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-14b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-14b");
if (!model.servable) throw new Error("qwen3-14b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 235B A22B Instruct
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-235b-instruct
qwen3-235b-instruct on NinjaChat — Qwen's 235B-parameter instruction model combines 22B active parameters with low-cost structured tool use. $0.20 / MTok input, $0.60 / MTok output.
`qwen3-235b-instruct`
Qwen — served by DeepInfra, Hugging Face Inference Providers
262,144-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Qwen's 235B-parameter instruction model combines 22B active parameters with low-cost structured tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$0.60 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0016. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-235b-instruct`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-235b-instruct",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-235b-instruct",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-235b-instruct","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-235b-instruct` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-235b-instruct` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-235b-instruct"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-235b-instruct");
if (!model.servable) throw new Error("qwen3-235b-instruct is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 30B A3B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-30b-a3b
qwen3-30b-a3b on NinjaChat — Qwen's sparse 30B model with only 3B active parameters for fast reasoning and tools. $0.12 / MTok input, $0.50 / MTok output.
`qwen3-30b-a3b`
Qwen — served by DeepInfra
40,960-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Qwen's sparse 30B model with only 3B active parameters for fast reasoning and tools.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.12 / MTok | \$0.50 / MTok | \$0.012 / MTok | \$0.12 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0011. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-30b-a3b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-30b-a3b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-30b-a3b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-30b-a3b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-30b-a3b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-30b-a3b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-30b-a3b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-30b-a3b");
if (!model.servable) throw new Error("qwen3-30b-a3b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 32B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-32b
qwen3-32b on NinjaChat — Qwen's efficient dense 32B model served in fast non-thinking mode with direct tool support. $0.08 / MTok input, $0.28 / MTok output.
`qwen3-32b`
Qwen — served by DeepInfra, Nscale Serverless Inference, Hugging Face Inference Providers
40,960-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Qwen's efficient dense 32B model served in fast non-thinking mode with direct tool support.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.08 / MTok | \$0.28 / MTok | \$0.008 / MTok | \$0.08 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0007. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-32b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-32b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-32b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-32b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-32b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-32b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-32b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-32b");
if (!model.servable) throw new Error("qwen3-32b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 Coder 480B Turbo
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-coder-480b-turbo
qwen3-coder-480b-turbo on NinjaChat — Qwen's 480B MoE agentic coding model in a low-latency Turbo serving tier. $0.30 / MTok input, $1.00 / MTok output.
`qwen3-coder-480b-turbo`
Qwen — served by DeepInfra
262,144-token context window · 262,144 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Qwen's 480B MoE agentic coding model in a low-latency Turbo serving tier.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.30 / MTok | \$1.00 / MTok | \$0.10 / MTok | \$0.30 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0025. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-coder-480b-turbo`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-coder-480b-turbo",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-coder-480b-turbo",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-coder-480b-turbo","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-coder-480b-turbo` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-coder-480b-turbo` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-coder-480b-turbo"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-coder-480b-turbo");
if (!model.servable) throw new Error("qwen3-coder-480b-turbo is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 Coder Next
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-coder-next
qwen3-coder-next on NinjaChat — Qwen's 80B/3B-active coding MoE for long-horizon software agents, repository navigation, and tool execution. $0.20 / MTok input, $1.50 / MTok output.
`qwen3-coder-next`
Qwen — served by Novita AI
262,144-token context window · 65,536 max output tokens
Streaming, Long context, Multilingual
Qwen's 80B/3B-active coding MoE for long-horizon software agents, repository navigation, and tool execution.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$1.50 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0025. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-coder-next`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-coder-next",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-coder-next",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-coder-next","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-coder-next` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-coder-next` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-coder-next"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-coder-next");
if (!model.servable) throw new Error("qwen3-coder-next is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 Max
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-max
qwen3-max on NinjaChat — Qwen's flagship non-reasoning model for fast tool-driven production workloads. $1.20 / MTok input, $6.00 / MTok output.
`qwen3-max`
Qwen — served by DeepInfra
256,000-token context window · 32,768 max output tokens
Streaming, Tool calling, Long context, Multilingual
Qwen's flagship non-reasoning model for fast tool-driven production workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.20 / MTok | \$6.00 / MTok | \$0.24 / MTok | \$1.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.012. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-max`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-max",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-max",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-max","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-max` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-max` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-max"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-max");
if (!model.servable) throw new Error("qwen3-max is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 Max Thinking
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-max-thinking
qwen3-max-thinking on NinjaChat — Qwen's flagship thinking model with adaptive tool use and extended test-time reasoning. $1.20 / MTok input, $6.00 / MTok output.
`qwen3-max-thinking`
Qwen — served by DeepInfra
256,000-token context window · 256,000 max output tokens
Streaming, Tool calling, Reasoning, Long context, Multilingual
Qwen's flagship thinking model with adaptive tool use and extended test-time reasoning.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.20 / MTok | \$6.00 / MTok | \$0.24 / MTok | \$1.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.012. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-max-thinking`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-max-thinking",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-max-thinking",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-max-thinking","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-max-thinking` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-max-thinking` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-max-thinking"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-max-thinking");
if (!model.servable) throw new Error("qwen3-max-thinking is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 Next 80B A3B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-next-80b-a3b
qwen3-next-80b-a3b on NinjaChat — Qwen's efficient 80B instruct model with 3B active parameters for RAG and stable tool use. $0.15 / MTok input, $1.50 / MTok output.
`qwen3-next-80b-a3b`
Qwen — served by DeepInfra, GMI Cloud, io.net Intelligence, Amazon Bedrock
262,144-token context window · 16,384 max output tokens
Streaming, JSON mode, Tool calling, Long context, Multilingual
Qwen's efficient 80B instruct model with 3B active parameters for RAG and stable tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.15 / MTok | \$1.50 / MTok | \$0.015 / MTok | \$0.15 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0023. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-next-80b-a3b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-next-80b-a3b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-next-80b-a3b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-next-80b-a3b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-next-80b-a3b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-next-80b-a3b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-next-80b-a3b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-next-80b-a3b");
if (!model.servable) throw new Error("qwen3-next-80b-a3b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 VL 235B A22B Instruct
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-vl-235b-a22b
qwen3-vl-235b-a22b on NinjaChat — Qwen's large sparse vision-language flagship for high-accuracy OCR, visual reasoning, coding, and tool orchestration. $0.20 / MTok input, $0.88 / MTok output.
`qwen3-vl-235b-a22b`
Qwen — served by DeepInfra, Novita AI
262,144-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
Qwen's large sparse vision-language flagship for high-accuracy OCR, visual reasoning, coding, and tool orchestration.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$0.88 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0019. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-vl-235b-a22b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-vl-235b-a22b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-vl-235b-a22b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-vl-235b-a22b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-vl-235b-a22b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-vl-235b-a22b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-vl-235b-a22b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-vl-235b-a22b");
if (!model.servable) throw new Error("qwen3-vl-235b-a22b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 VL 30B A3B Instruct
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-vl-30b-a3b
qwen3-vl-30b-a3b on NinjaChat — Qwen's efficient 3B-active vision-language model for image-aware agents, OCR, coding, and structured tool use. $0.20 / MTok input, $0.70 / MTok output.
`qwen3-vl-30b-a3b`
Qwen — served by DeepInfra, Novita AI
262,144-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
Qwen's efficient 3B-active vision-language model for image-aware agents, OCR, coding, and structured tool use.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$0.70 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0017. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-vl-30b-a3b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-vl-30b-a3b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-vl-30b-a3b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-vl-30b-a3b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-vl-30b-a3b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-vl-30b-a3b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-vl-30b-a3b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-vl-30b-a3b");
if (!model.servable) throw new Error("qwen3-vl-30b-a3b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen3 VL 32B Instruct
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwen3-vl-32b-instruct
qwen3-vl-32b-instruct on NinjaChat — Qwen's dense 32B vision-language model for high-precision document recognition, spatial understanding, and image-aware agents. $0.16 / MTok input, $0.64 / MTok output.
`qwen3-vl-32b-instruct`
Qwen — served by Alibaba Cloud Model Studio
131,072-token context window · 32,768 max output tokens
Streaming, JSON mode, Tool calling, Vision, Long context, Multilingual
Qwen's dense 32B vision-language model for high-precision document recognition, spatial understanding, and image-aware agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.16 / MTok | \$0.64 / MTok | \$0.016 / MTok | \$0.16 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0015. Billing is metered per token. Prices are live at `GET /api/v1/models/qwen3-vl-32b-instruct`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwen3-vl-32b-instruct",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwen3-vl-32b-instruct",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-vl-32b-instruct","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwen3-vl-32b-instruct` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwen3-vl-32b-instruct` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwen3-vl-32b-instruct"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen3-vl-32b-instruct");
if (!model.servable) throw new Error("qwen3-vl-32b-instruct is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# QwQ 32B
Source: https://docs.ninjachat.ai/api-reference/models/chat/qwq-32b
qwq-32b on NinjaChat — Qwen's QwQ 32B reasoning-focused open model, strong at math. $0.29 / MTok input, $0.59 / MTok output.
`qwq-32b`
Qwen — served by Groq
32,000-token context window · 8,192 max output tokens
Streaming, JSON mode, Reasoning
Qwen's QwQ 32B reasoning-focused open model, strong at math.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------- | :------------ |
| \$0.29 / MTok | \$0.59 / MTok | \$0.029 / MTok | \$0.29 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0021. Billing is metered per token. Prices are live at `GET /api/v1/models/qwq-32b`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "qwq-32b",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="qwq-32b",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwq-32b","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `qwq-32b` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `qwq-32b` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"qwq-32b"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwq-32b");
if (!model.servable) throw new Error("qwq-32b is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Seed 1.8
Source: https://docs.ninjachat.ai/api-reference/models/chat/seed-1-8
seed-1.8 on NinjaChat — ByteDance's long-context multimodal Seed 1.8 reasoning model with a 256K context window. $0.25 / MTok input, $2.00 / MTok output.
`seed-1.8`
ByteDance — served by BytePlus (Seed), DeepInfra
256,000-token context window · 65,536 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
ByteDance's long-context multimodal Seed 1.8 reasoning model with a 256K context window.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.25 / MTok | \$2.00 / MTok | \$0.05 / MTok | \$0.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0033. Billing is metered per token. Prices are live at `GET /api/v1/models/seed-1.8`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "seed-1.8",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="seed-1.8",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seed-1.8","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `seed-1.8` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `seed-1.8` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"seed-1.8"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seed-1.8");
if (!model.servable) throw new Error("seed-1.8 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Seed 2.0 Code
Source: https://docs.ninjachat.ai/api-reference/models/chat/seed-2-0-code
seed-2.0-code on NinjaChat — ByteDance's coding-specialized multimodal Seed 2.0 Code model for repository-scale engineering. $1.00 / MTok input, $6.00 / MTok output.
`seed-2.0-code`
ByteDance — served by DeepInfra, BytePlus (Ark)
256,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Vision, Reasoning, Long context, Multilingual
ByteDance's coding-specialized multimodal Seed 2.0 Code model for repository-scale engineering.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.00 / MTok | \$6.00 / MTok | \$0.10 / MTok | \$1.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.011. Billing is metered per token. Prices are live at `GET /api/v1/models/seed-2.0-code`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "seed-2.0-code",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="seed-2.0-code",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seed-2.0-code","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `seed-2.0-code` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `seed-2.0-code` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"seed-2.0-code"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seed-2.0-code");
if (!model.servable) throw new Error("seed-2.0-code is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Seed 2.0 Mini
Source: https://docs.ninjachat.ai/api-reference/models/chat/seed-2-0-mini
seed-2.0-mini on NinjaChat — ByteDance's low-cost multimodal Seed 2.0 Mini reasoning model with a 256K context window. $0.20 / MTok input, $0.80 / MTok output.
`seed-2.0-mini`
ByteDance — served by DeepInfra, BytePlus (Ark)
256,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
ByteDance's low-cost multimodal Seed 2.0 Mini reasoning model with a 256K context window.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$0.80 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0018. Billing is metered per token. Prices are live at `GET /api/v1/models/seed-2.0-mini`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "seed-2.0-mini",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="seed-2.0-mini",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seed-2.0-mini","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `seed-2.0-mini` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `seed-2.0-mini` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"seed-2.0-mini"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seed-2.0-mini");
if (!model.servable) throw new Error("seed-2.0-mini is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Seed 2.0 Pro
Source: https://docs.ninjachat.ai/api-reference/models/chat/seed-2-0-pro
seed-2.0-pro on NinjaChat — ByteDance's full-capability multimodal Seed 2.0 Pro reasoning model for professional agent workloads. $1.00 / MTok input, $6.00 / MTok output.
`seed-2.0-pro`
ByteDance — served by DeepInfra, BytePlus (Ark)
256,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
ByteDance's full-capability multimodal Seed 2.0 Pro reasoning model for professional agent workloads.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$1.00 / MTok | \$6.00 / MTok | \$0.10 / MTok | \$1.00 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.011. Billing is metered per token. Prices are live at `GET /api/v1/models/seed-2.0-pro`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "seed-2.0-pro",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="seed-2.0-pro",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seed-2.0-pro","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `seed-2.0-pro` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `seed-2.0-pro` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"seed-2.0-pro"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seed-2.0-pro");
if (!model.servable) throw new Error("seed-2.0-pro is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Seed 2.1 Turbo
Source: https://docs.ninjachat.ai/api-reference/models/chat/seed-2-1-turbo
seed-2.1-turbo on NinjaChat — ByteDance's current multimodal Seed 2.1 Turbo model for long-context agents and visual reasoning. $0.50 / MTok input, $2.50 / MTok output.
`seed-2.1-turbo`
ByteDance — served by BytePlus (Ark)
256,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Vision, Reasoning, Long context, Multilingual
ByteDance's current multimodal Seed 2.1 Turbo model for long-context agents and visual reasoning.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.50 / MTok | \$2.50 / MTok | \$0.10 / MTok | \$0.50 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.005. Billing is metered per token. Prices are live at `GET /api/v1/models/seed-2.1-turbo`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "seed-2.1-turbo",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="seed-2.1-turbo",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seed-2.1-turbo","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `image_url content parts`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `seed-2.1-turbo` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `seed-2.1-turbo` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"seed-2.1-turbo"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seed-2.1-turbo");
if (!model.servable) throw new Error("seed-2.1-turbo is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Solar Pro 4
Source: https://docs.ninjachat.ai/api-reference/models/chat/solar-pro4
solar-pro4 on NinjaChat — Upstage's long-context agentic model for multi-step work, tools, and evidence-heavy documents. $0.30 / MTok input, $1.20 / MTok output.
`solar-pro4`
Upstage
524,288-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
Upstage's long-context agentic model for multi-step work, tools, and evidence-heavy documents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.30 / MTok | \$1.20 / MTok | \$0.06 / MTok | \$0.30 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0027. Billing is metered per token. Prices are live at `GET /api/v1/models/solar-pro4`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "solar-pro4",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="solar-pro4",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"solar-pro4","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `solar-pro4` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `solar-pro4` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"solar-pro4"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("solar-pro4");
if (!model.servable) throw new Error("solar-pro4 is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Step 3.7 Flash
Source: https://docs.ninjachat.ai/api-reference/models/chat/step-3-7-flash
step-3.7-flash on NinjaChat — StepFun's efficient Step 3.7 Flash reasoning and coding model for fast, high-volume agents. $0.20 / MTok input, $1.15 / MTok output.
`step-3.7-flash`
StepFun — served by GMI Cloud, DeepInfra, Novita AI
256,000-token context window · 131,072 max output tokens
Streaming, JSON mode, Tool calling, Reasoning, Long context, Multilingual
StepFun's efficient Step 3.7 Flash reasoning and coding model for fast, high-volume agents.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.20 / MTok | \$1.15 / MTok | \$0.02 / MTok | \$0.20 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0022. Billing is metered per token. Prices are live at `GET /api/v1/models/step-3.7-flash`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "step-3.7-flash",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="step-3.7-flash",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"step-3.7-flash","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `tools`, `tool_choice`, `response_format`, `reasoning`, `reasoning_effort`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `step-3.7-flash` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `step-3.7-flash` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"step-3.7-flash"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("step-3.7-flash");
if (!model.servable) throw new Error("step-3.7-flash is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Uncensored AI
Source: https://docs.ninjachat.ai/api-reference/models/chat/uncensored-ai
uncensored-ai on NinjaChat — NinjaChat's uncensored model for creative and unrestricted use cases. $0.25 / MTok input, $2.00 / MTok output.
`uncensored-ai`
NinjaChat — served by BytePlus (Seed)
32,000-token context window · 4,096 max output tokens
Streaming, JSON mode, Uncensored
NinjaChat's uncensored model for creative and unrestricted use cases.
## Pricing
| Input | Output | Cached input | Cache write |
| :------------ | :------------ | :------------ | :------------ |
| \$0.25 / MTok | \$2.00 / MTok | \$0.05 / MTok | \$0.25 / MTok |
Typical request (5K input / 1K output tokens): \~\$0.0033. Billing is metered per token. Prices are live at `GET /api/v1/models/uncensored-ai`; the values above were read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "uncensored-ai",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
});
console.log(completion.choices[0].message.content);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="uncensored-ai",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"uncensored-ai","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Supported parameters
`messages`, `temperature`, `max_completion_tokens`, `top_p`, `stop`, `frequency_penalty`, `presence_penalty`, `seed`, `stream`, `user`, `routing`, `response_format`
Send only parameters from this list. `routing.require_parameters` (default `true`) skips any provider rail that cannot honor every requested parameter, so unsupported parameters reduce the rails eligible to serve the request.
## Routing & fallbacks
Pin `uncensored-ai` with `model` when you want this model's behavior, or list it in an ordered `models` array. With `ninja/auto` first, the router's top pick runs first and `uncensored-ai` is the explicit fallback; `ninja/auto` acts as the router only when it is the first entry.
```json theme={null}
{
"models": [
"ninja/auto",
"uncensored-ai"
],
"messages": [
{
"role": "user",
"content": "Explain edge caching in one paragraph."
}
],
"routing": {
"allow_fallbacks": true
}
}
```
You are billed at the resolved model's token rates, and only for the successful execution.
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("uncensored-ai");
if (!model.servable) throw new Error("uncensored-ai is temporarily unavailable");
console.log({
contextWindow: model.contextWindow,
maxOutputTokens: model.maxOutputTokens,
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Text generation](/chat) · [Fallbacks](/fallback-chains) · [Smart routing](/smart-routing) · [Pricing](/pricing) · [All models](/models-overview)
# Bria 3.2
Source: https://docs.ninjachat.ai/api-reference/models/image/bria-3-2
bria-3.2 on NinjaChat — Bria's 3.2 licensed-data text-to-image model. $0.04 per image.
`bria-3.2`
Bria — served by DeepInfra
\$0.04 per image
Text to image
Bria's 3.2 licensed-data text-to-image model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.04 |
Billed per image. Prices are live at `GET /api/v1/models/bria-3.2`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "bria-3.2",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="bria-3.2",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"bria-3.2","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("bria-3.2");
if (!model.servable) throw new Error("bria-3.2 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Bria FIBO
Source: https://docs.ninjachat.ai/api-reference/models/image/bria-fibo
bria-fibo on NinjaChat — Bria's FIBO licensed-data text-to-image model. $0.04 per image.
`bria-fibo`
Bria — served by DeepInfra
\$0.04 per image
Text to image
Bria's FIBO licensed-data text-to-image model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.04 |
Billed per image. Prices are live at `GET /api/v1/models/bria-fibo`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "bria-fibo",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="bria-fibo",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"bria-fibo","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("bria-fibo");
if (!model.servable) throw new Error("bria-fibo is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX 1.1 Pro
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-1-1-pro
flux-1.1-pro on NinjaChat — Black Forest Labs' FLUX 1.1 Pro for high-quality text-to-image. $0.04 per image.
`flux-1.1-pro`
Black Forest Labs — served by DeepInfra
\$0.04 per image
Text to image
Black Forest Labs' FLUX 1.1 Pro for high-quality text-to-image.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.04 |
Billed per image. Prices are live at `GET /api/v1/models/flux-1.1-pro`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-1.1-pro",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-1.1-pro",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-1.1-pro","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-1.1-pro");
if (!model.servable) throw new Error("flux-1.1-pro is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.1 Dev
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-1-dev
flux-1-dev on NinjaChat — Black Forest Labs' open-weight FLUX.1 Dev. $0.009 per image.
`flux-1-dev`
Black Forest Labs — served by DeepInfra
\$0.009 per image
Text to image
Black Forest Labs' open-weight FLUX.1 Dev.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.009 |
Billed per image. Prices are live at `GET /api/v1/models/flux-1-dev`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-1-dev",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-1-dev",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-1-dev","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-1-dev");
if (!model.servable) throw new Error("flux-1-dev is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX 1.1 Pro Ultra
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-1-pro-ultra
flux-1-pro-ultra on NinjaChat — Black Forest Labs' FLUX 1.1 Pro Ultra for up to 4MP output. $0.06 per image.
`flux-1-pro-ultra`
Black Forest Labs
\$0.06 per image
Text to image
Black Forest Labs' FLUX 1.1 Pro Ultra for up to 4MP output.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.06 |
Billed per image. Prices are live at `GET /api/v1/models/flux-1-pro-ultra`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-1-pro-ultra",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-1-pro-ultra",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-1-pro-ultra","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-1-pro-ultra");
if (!model.servable) throw new Error("flux-1-pro-ultra is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.2 Dev
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-2-dev
flux-2-dev on NinjaChat — Black Forest Labs' open-weight FLUX.2 Dev for text-to-image with reference images. $0.024 per image.
`flux-2-dev`
Black Forest Labs — served by Replicate, DeepInfra
\$0.024 per image
Image reference
Black Forest Labs' open-weight FLUX.2 Dev for text-to-image with reference images.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.024 |
Billed per image. Prices are live at `GET /api/v1/models/flux-2-dev`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-2-dev",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-2-dev",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-2-dev","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-2-dev");
if (!model.servable) throw new Error("flux-2-dev is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.2 Flex
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-2-flex
flux-2-flex on NinjaChat — Black Forest Labs' FLUX.2 Flex with reference-image control and tunable detail. $0.06 per image.
`flux-2-flex`
Black Forest Labs — served by Replicate
\$0.06 per image
Image reference
Black Forest Labs' FLUX.2 Flex with reference-image control and tunable detail.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.06 |
Billed per image. Prices are live at `GET /api/v1/models/flux-2-flex`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-2-flex",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-2-flex",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-2-flex","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-2-flex");
if (!model.servable) throw new Error("flux-2-flex is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.2 Klein
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-2-klein
flux-2-klein on NinjaChat — Black Forest Labs' fastest, lowest-cost FLUX.2 model. $0.014 per image.
`flux-2-klein`
Black Forest Labs
\$0.014 per image
Text to image
Black Forest Labs' fastest, lowest-cost FLUX.2 model.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.014 |
Billed per image. Prices are live at `GET /api/v1/models/flux-2-klein`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-2-klein",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-2-klein",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-2-klein","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-2-klein");
if (!model.servable) throw new Error("flux-2-klein is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.2 Klein 4B
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-2-klein-4b
flux-2-klein-4b on NinjaChat — Black Forest Labs' 4B FLUX.2 Klein for the cheapest drafts. $0.014 per image.
`flux-2-klein-4b`
Black Forest Labs — served by DeepInfra
\$0.014 per image
Text to image
Black Forest Labs' 4B FLUX.2 Klein for the cheapest drafts.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.014 |
Billed per image. Prices are live at `GET /api/v1/models/flux-2-klein-4b`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-2-klein-4b",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-2-klein-4b",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-2-klein-4b","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-2-klein-4b");
if (!model.servable) throw new Error("flux-2-klein-4b is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.2 Klein 9B
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-2-klein-9b
flux-2-klein-9b on NinjaChat — Black Forest Labs' 9B FLUX.2 Klein for fast, low-cost generation. $0.015 per image.
`flux-2-klein-9b`
Black Forest Labs — served by DeepInfra
\$0.015 per image
Text to image
Black Forest Labs' 9B FLUX.2 Klein for fast, low-cost generation.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.015 |
Billed per image. Prices are live at `GET /api/v1/models/flux-2-klein-9b`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-2-klein-9b",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-2-klein-9b",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-2-klein-9b","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-2-klein-9b");
if (!model.servable) throw new Error("flux-2-klein-9b is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.2 Max
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-2-max
flux-2-max on NinjaChat — Black Forest Labs' highest-quality FLUX.2 model. $0.07 per image.
`flux-2-max`
Black Forest Labs — served by DeepInfra
\$0.07 per image
Text to image
Black Forest Labs' highest-quality FLUX.2 model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.07 |
Billed per image. Prices are live at `GET /api/v1/models/flux-2-max`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-2-max",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-2-max",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-2-max","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-2-max");
if (!model.servable) throw new Error("flux-2-max is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.2 Pro
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-2-pro
flux-2-pro on NinjaChat — Black Forest Labs' balanced FLUX.2 model for production text-to-image. $0.03 per image.
`flux-2-pro`
Black Forest Labs — served by Black Forest Labs, DeepInfra
\$0.03 per image
Text to image
Black Forest Labs' balanced FLUX.2 model for production text-to-image.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.03 |
Billed per image. Prices are live at `GET /api/v1/models/flux-2-pro`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-2-pro",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-2-pro",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-2-pro","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-2-pro");
if (!model.servable) throw new Error("flux-2-pro is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.1 Kontext Dev
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-kontext-dev
flux-kontext-dev on NinjaChat — Black Forest Labs' open-weight Kontext editor; a reference image is required. $0.025 per image.
`flux-kontext-dev`
Black Forest Labs — served by Replicate
\$0.025 per image
Image editing, Image reference
Black Forest Labs' open-weight Kontext editor; a reference image is required.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.025 |
Billed per image. Prices are live at `GET /api/v1/models/flux-kontext-dev`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
This is an editing model: pass the source image as a public HTTPS URL in `image`.
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-kontext-dev",
prompt: "Replace the background with a clean studio backdrop",
image: "https://your-cdn.example/source.png",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-kontext-dev",
prompt="Replace the background with a clean studio backdrop",
image="https://your-cdn.example/source.png",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-kontext-dev","prompt":"Replace the background with a clean studio backdrop","image":"https://your-cdn.example/source.png"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-kontext-dev");
if (!model.servable) throw new Error("flux-kontext-dev is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.1 Kontext Max
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-kontext-max
flux-kontext-max on NinjaChat — Black Forest Labs' highest-fidelity Kontext editing model. $0.08 per image.
`flux-kontext-max`
Black Forest Labs
\$0.08 per image
Image reference
Black Forest Labs' highest-fidelity Kontext editing model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.08 |
Billed per image. Prices are live at `GET /api/v1/models/flux-kontext-max`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-kontext-max",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-kontext-max",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-kontext-max","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-kontext-max");
if (!model.servable) throw new Error("flux-kontext-max is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# FLUX.1 Kontext Pro
Source: https://docs.ninjachat.ai/api-reference/models/image/flux-kontext-pro
flux-kontext-pro on NinjaChat — Black Forest Labs' context-aware image editing with text instructions. $0.04 per image.
`flux-kontext-pro`
Black Forest Labs
\$0.04 per image
Image reference
Black Forest Labs' context-aware image editing with text instructions.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.04 |
Billed per image. Prices are live at `GET /api/v1/models/flux-kontext-pro`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "flux-kontext-pro",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="flux-kontext-pro",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-kontext-pro","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("flux-kontext-pro");
if (!model.servable) throw new Error("flux-kontext-pro is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# GPT Image 2
Source: https://docs.ninjachat.ai/api-reference/models/image/gpt-image-2
gpt-image-2 on NinjaChat — OpenAI's GPT Image 2 for instruction-following image generation and editing. $0.128 per image.
`gpt-image-2`
OpenAI
\$0.128 per image
Image reference
OpenAI's GPT Image 2 for instruction-following image generation and editing.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.128 |
Billed per image. Prices are live at `GET /api/v1/models/gpt-image-2`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "gpt-image-2",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="gpt-image-2",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-image-2","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("gpt-image-2");
if (!model.servable) throw new Error("gpt-image-2 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Grok Imagine
Source: https://docs.ninjachat.ai/api-reference/models/image/grok-imagine
grok-imagine on NinjaChat — xAI's Grok Imagine text-to-image model. $0.02 per image.
`grok-imagine`
xAI
\$0.02 per image
Image reference
xAI's Grok Imagine text-to-image model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.02 |
Billed per image. Prices are live at `GET /api/v1/models/grok-imagine`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "grok-imagine",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="grok-imagine",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-imagine","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-imagine");
if (!model.servable) throw new Error("grok-imagine is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Grok Imagine Image 2.0
Source: https://docs.ninjachat.ai/api-reference/models/image/grok-imagine-image-2-0
grok-imagine-image-2.0 on NinjaChat — xAI's second-generation Grok Imagine image model. $0.04 per image.
`grok-imagine-image-2.0`
xAI
\$0.04 per image
Text to image
xAI's second-generation Grok Imagine image model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.04 |
Billed per image. Prices are live at `GET /api/v1/models/grok-imagine-image-2.0`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "grok-imagine-image-2.0",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="grok-imagine-image-2.0",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-imagine-image-2.0","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-imagine-image-2.0");
if (!model.servable) throw new Error("grok-imagine-image-2.0 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Grok Imagine Image Quality
Source: https://docs.ninjachat.ai/api-reference/models/image/grok-imagine-image-quality
grok-imagine-image-quality on NinjaChat — xAI's highest-fidelity Grok Imagine image tier. $0.05 per image.
`grok-imagine-image-quality`
xAI
\$0.05 per image
Text to image
xAI's highest-fidelity Grok Imagine image tier.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.05 |
Billed per image. Prices are live at `GET /api/v1/models/grok-imagine-image-quality`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "grok-imagine-image-quality",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="grok-imagine-image-quality",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-imagine-image-quality","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-imagine-image-quality");
if (!model.servable) throw new Error("grok-imagine-image-quality is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Nano Banana
Source: https://docs.ninjachat.ai/api-reference/models/image/nano-banana
nano-banana on NinjaChat — Google's Gemini 2.5 Flash Image for fast conversational image generation and editing. $0.02 per image.
`nano-banana`
Google
\$0.02 per image
Image reference
Google's Gemini 2.5 Flash Image for fast conversational image generation and editing.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.02 |
Billed per image. Prices are live at `GET /api/v1/models/nano-banana`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "nano-banana",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="nano-banana",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nano-banana","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nano-banana");
if (!model.servable) throw new Error("nano-banana is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Nano Banana 2
Source: https://docs.ninjachat.ai/api-reference/models/image/nano-banana-2
nano-banana-2 on NinjaChat — Google's Gemini 3.1 Flash Image with 4K output and strong text rendering. $0.045 per image.
`nano-banana-2`
Google
\$0.045 per image
Image reference
Google's Gemini 3.1 Flash Image with 4K output and strong text rendering.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.045 |
Billed per image. Prices are live at `GET /api/v1/models/nano-banana-2`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "nano-banana-2",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="nano-banana-2",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nano-banana-2","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nano-banana-2");
if (!model.servable) throw new Error("nano-banana-2 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Nano Banana 2 Lite
Source: https://docs.ninjachat.ai/api-reference/models/image/nano-banana-2-lite
nano-banana-2-lite on NinjaChat — Google's lightest Nano Banana 2 tier for high-volume image generation. $0.034 per image.
`nano-banana-2-lite`
Google — served by DeepInfra
\$0.034 per image
Text to image
Google's lightest Nano Banana 2 tier for high-volume image generation.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.034 |
Billed per image. Prices are live at `GET /api/v1/models/nano-banana-2-lite`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "nano-banana-2-lite",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="nano-banana-2-lite",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nano-banana-2-lite","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nano-banana-2-lite");
if (!model.servable) throw new Error("nano-banana-2-lite is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Nano Banana Pro
Source: https://docs.ninjachat.ai/api-reference/models/image/nano-banana-pro
nano-banana-pro on NinjaChat — Google's Gemini 3 Pro Image for complex, multi-element compositions at 4K. $0.08 per image.
`nano-banana-pro`
Google
\$0.08 per image
Image reference
Google's Gemini 3 Pro Image for complex, multi-element compositions at 4K.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.08 |
Billed per image. Prices are live at `GET /api/v1/models/nano-banana-pro`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "nano-banana-pro",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="nano-banana-pro",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nano-banana-pro","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("nano-banana-pro");
if (!model.servable) throw new Error("nano-banana-pro is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Pruna P-Image
Source: https://docs.ninjachat.ai/api-reference/models/image/pruna-p-image
pruna-p-image on NinjaChat — Pruna AI's P-Image for very low-cost drafts. $0.005 per image.
`pruna-p-image`
Pruna AI — served by DeepInfra
\$0.005 per image
Text to image
Pruna AI's P-Image for very low-cost drafts.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.005 |
Billed per image. Prices are live at `GET /api/v1/models/pruna-p-image`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "pruna-p-image",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="pruna-p-image",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"pruna-p-image","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("pruna-p-image");
if (!model.servable) throw new Error("pruna-p-image is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen Image 2512
Source: https://docs.ninjachat.ai/api-reference/models/image/qwen-image-2512
qwen-image-2512 on NinjaChat — Qwen's December 2025 Image release with reference-image support. $0.02 per image.
`qwen-image-2512`
Qwen — served by Replicate
\$0.02 per image
Image reference
Qwen's December 2025 Image release with reference-image support.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.02 |
Billed per image. Prices are live at `GET /api/v1/models/qwen-image-2512`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "qwen-image-2512",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="qwen-image-2512",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-image-2512","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-image-2512");
if (!model.servable) throw new Error("qwen-image-2512 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen Image Edit 2511
Source: https://docs.ninjachat.ai/api-reference/models/image/qwen-image-edit-2511
qwen-image-edit-2511 on NinjaChat — Qwen's November 2025 image editor; a reference image is required. $0.03 per image.
`qwen-image-edit-2511`
Qwen — served by Replicate
\$0.03 per image
Image editing, Image reference
Qwen's November 2025 image editor; a reference image is required.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.03 |
Billed per image. Prices are live at `GET /api/v1/models/qwen-image-edit-2511`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
This is an editing model: pass the source image as a public HTTPS URL in `image`.
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "qwen-image-edit-2511",
prompt: "Replace the background with a clean studio backdrop",
image: "https://your-cdn.example/source.png",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="qwen-image-edit-2511",
prompt="Replace the background with a clean studio backdrop",
image="https://your-cdn.example/source.png",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-image-edit-2511","prompt":"Replace the background with a clean studio backdrop","image":"https://your-cdn.example/source.png"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-image-edit-2511");
if (!model.servable) throw new Error("qwen-image-edit-2511 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen Image Edit Max
Source: https://docs.ninjachat.ai/api-reference/models/image/qwen-image-edit-max
qwen-image-edit-max on NinjaChat — Qwen's highest-quality image editor; a reference image is required. $0.075 per image.
`qwen-image-edit-max`
Qwen — served by DeepInfra
\$0.075 per image
Image editing, Image reference
Qwen's highest-quality image editor; a reference image is required.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.075 |
Billed per image. Prices are live at `GET /api/v1/models/qwen-image-edit-max`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
This is an editing model: pass the source image as a public HTTPS URL in `image`.
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "qwen-image-edit-max",
prompt: "Replace the background with a clean studio backdrop",
image: "https://your-cdn.example/source.png",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="qwen-image-edit-max",
prompt="Replace the background with a clean studio backdrop",
image="https://your-cdn.example/source.png",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-image-edit-max","prompt":"Replace the background with a clean studio backdrop","image":"https://your-cdn.example/source.png"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-image-edit-max");
if (!model.servable) throw new Error("qwen-image-edit-max is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Qwen Image Max
Source: https://docs.ninjachat.ai/api-reference/models/image/qwen-image-max
qwen-image-max on NinjaChat — Qwen's highest-quality Image tier. $0.075 per image.
`qwen-image-max`
Qwen — served by DeepInfra
\$0.075 per image
Text to image
Qwen's highest-quality Image tier.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.075 |
Billed per image. Prices are live at `GET /api/v1/models/qwen-image-max`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "qwen-image-max",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="qwen-image-max",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-image-max","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("qwen-image-max");
if (!model.servable) throw new Error("qwen-image-max is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Recraft V3
Source: https://docs.ninjachat.ai/api-reference/models/image/recraft-v3
recraft-v3 on NinjaChat — Recraft V3 for brand-grade vector and raster design assets. $0.04 per image.
`recraft-v3`
Recraft — served by Replicate
\$0.04 per image
Text to image
Recraft V3 for brand-grade vector and raster design assets.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.04 |
Billed per image. Prices are live at `GET /api/v1/models/recraft-v3`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "recraft-v3",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="recraft-v3",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"recraft-v3","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("recraft-v3");
if (!model.servable) throw new Error("recraft-v3 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Runway Gen-4 Image Turbo
Source: https://docs.ninjachat.ai/api-reference/models/image/runway-gen4-image-turbo
runway-gen4-image-turbo on NinjaChat — Runway's Gen-4 Image Turbo; requires one to three reference images. $0.02 per image.
`runway-gen4-image-turbo`
Runway
\$0.02 per image
Image editing, Image reference
Runway's Gen-4 Image Turbo; requires one to three reference images.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.02 |
Billed per image. Prices are live at `GET /api/v1/models/runway-gen4-image-turbo`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
This is an editing model: pass the source image as a public HTTPS URL in `image`.
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "runway-gen4-image-turbo",
prompt: "Replace the background with a clean studio backdrop",
image: "https://your-cdn.example/source.png",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="runway-gen4-image-turbo",
prompt="Replace the background with a clean studio backdrop",
image="https://your-cdn.example/source.png",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"runway-gen4-image-turbo","prompt":"Replace the background with a clean studio backdrop","image":"https://your-cdn.example/source.png"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("runway-gen4-image-turbo");
if (!model.servable) throw new Error("runway-gen4-image-turbo is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# SDXL Turbo
Source: https://docs.ninjachat.ai/api-reference/models/image/sdxl-turbo
sdxl-turbo on NinjaChat — Stability AI's SDXL Turbo for near-free single-step drafts. $0.0002 per image.
`sdxl-turbo`
Stability AI — served by DeepInfra
\$0.0002 per image
Text to image
Stability AI's SDXL Turbo for near-free single-step drafts.
## Pricing
| Unit | Price |
| :-------- | :------- |
| Per image | \$0.0002 |
Billed per image. Prices are live at `GET /api/v1/models/sdxl-turbo`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "sdxl-turbo",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="sdxl-turbo",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"sdxl-turbo","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("sdxl-turbo");
if (!model.servable) throw new Error("sdxl-turbo is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Seedream 4.5
Source: https://docs.ninjachat.ai/api-reference/models/image/seedream
seedream on NinjaChat — ByteDance's Seedream 4.5 for fast, high-fidelity text-to-image. $0.04 per image.
`seedream`
ByteDance — served by BytePlus
\$0.04 per image
Image reference
ByteDance's Seedream 4.5 for fast, high-fidelity text-to-image.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.04 |
Billed per image. Prices are live at `GET /api/v1/models/seedream`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "seedream",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="seedream",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedream","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seedream");
if (!model.servable) throw new Error("seedream is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Seedream 4.5
Source: https://docs.ninjachat.ai/api-reference/models/image/seedream-4-5
seedream-4.5 on NinjaChat — ByteDance's Seedream 4.5 text-to-image model. $0.04 per image.
`seedream-4.5`
ByteDance — served by DeepInfra
\$0.04 per image
Text to image
ByteDance's Seedream 4.5 text-to-image model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.04 |
Billed per image. Prices are live at `GET /api/v1/models/seedream-4.5`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "seedream-4.5",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="seedream-4.5",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedream-4.5","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seedream-4.5");
if (!model.servable) throw new Error("seedream-4.5 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Seedream 5.0 Lite
Source: https://docs.ninjachat.ai/api-reference/models/image/seedream-5-lite
seedream-5-lite on NinjaChat — ByteDance's lower-cost Seedream 5.0 tier. $0.035 per image.
`seedream-5-lite`
ByteDance — served by BytePlus
\$0.035 per image
Image reference
ByteDance's lower-cost Seedream 5.0 tier.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per image | \$0.035 |
Billed per image. Prices are live at `GET /api/v1/models/seedream-5-lite`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "seedream-5-lite",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="seedream-5-lite",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedream-5-lite","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seedream-5-lite");
if (!model.servable) throw new Error("seedream-5-lite is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Seedream 5.0 Pro
Source: https://docs.ninjachat.ai/api-reference/models/image/seedream-5-pro
seedream-5-pro on NinjaChat — ByteDance's flagship Seedream 5.0 text-to-image model. $0.09 per image.
`seedream-5-pro`
ByteDance — served by BytePlus
\$0.09 per image
Image reference
ByteDance's flagship Seedream 5.0 text-to-image model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.09 |
Billed per image. Prices are live at `GET /api/v1/models/seedream-5-pro`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "seedream-5-pro",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="seedream-5-pro",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedream-5-pro","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seedream-5-pro");
if (!model.servable) throw new Error("seedream-5-pro is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Stable Diffusion 3.5 Large
Source: https://docs.ninjachat.ai/api-reference/models/image/stable-diffusion-3-5-large
stable-diffusion-3.5-large on NinjaChat — Stability AI's Stable Diffusion 3.5 Large. $0.08 per image.
`stable-diffusion-3.5-large`
Stability AI — served by DigitalOcean Inference
\$0.08 per image
Text to image
Stability AI's Stable Diffusion 3.5 Large.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.08 |
Billed per image. Prices are live at `GET /api/v1/models/stable-diffusion-3.5-large`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "stable-diffusion-3.5-large",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="stable-diffusion-3.5-large",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"stable-diffusion-3.5-large","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("stable-diffusion-3.5-large");
if (!model.servable) throw new Error("stable-diffusion-3.5-large is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Wan 2.6 Image
Source: https://docs.ninjachat.ai/api-reference/models/image/wan-2-6-image
wan-2.6-image on NinjaChat — Alibaba's Wan 2.6 text-to-image model. $0.03 per image.
`wan-2.6-image`
Alibaba — served by DeepInfra
\$0.03 per image
Text to image
Alibaba's Wan 2.6 text-to-image model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.03 |
Billed per image. Prices are live at `GET /api/v1/models/wan-2.6-image`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "wan-2.6-image",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="wan-2.6-image",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"wan-2.6-image","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("wan-2.6-image");
if (!model.servable) throw new Error("wan-2.6-image is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Wan 2.7 Image Edit
Source: https://docs.ninjachat.ai/api-reference/models/image/wan-2-7-image-edit
wan-2.7-image-edit on NinjaChat — Alibaba's Wan 2.7 image editor; a reference image is required. $0.03 per image.
`wan-2.7-image-edit`
Alibaba — served by DeepInfra
\$0.03 per image
Image reference
Alibaba's Wan 2.7 image editor; a reference image is required.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.03 |
Billed per image. Prices are live at `GET /api/v1/models/wan-2.7-image-edit`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "wan-2.7-image-edit",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="wan-2.7-image-edit",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"wan-2.7-image-edit","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("wan-2.7-image-edit");
if (!model.servable) throw new Error("wan-2.7-image-edit is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Z-Image Turbo
Source: https://docs.ninjachat.ai/api-reference/models/image/z-image-turbo
z-image-turbo on NinjaChat — Alibaba Tongyi's Z-Image Turbo for very low-cost text-to-image drafts. $0.01 per image.
`z-image-turbo`
Alibaba — served by Replicate
\$0.01 per image
Text to image
Alibaba Tongyi's Z-Image Turbo for very low-cost text-to-image drafts.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per image | \$0.01 |
Billed per image. Prices are live at `GET /api/v1/models/z-image-turbo`; the value above was read from that endpoint when this page was generated.
## Use this model
The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const image = await client.images.generate({
model: "z-image-turbo",
prompt: "Editorial product photograph, precise studio lighting",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
image = client.images.generate(
model="z-image-turbo",
prompt="Editorial product photograph, precise studio lighting",
)
print(image["data"][0]["url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/images/generations \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"z-image-turbo","prompt":"Editorial product photograph, precise studio lighting"}'
```
## Supported parameters
`prompt`, `model`, `n`, `size`, `aspect_ratio`, `image`, `width`, `height`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("z-image-turbo");
if (!model.servable) throw new Error("z-image-turbo is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Image generation](/image-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Grok Imagine Video
Source: https://docs.ninjachat.ai/api-reference/models/video/grok-imagine-video
grok-imagine-video on NinjaChat — xAI's Grok Imagine text- and image-to-video model. $0.75 per video.
`grok-imagine-video`
xAI
\$0.75 per video
Image reference
xAI's Grok Imagine text- and image-to-video model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per video | \$0.75 |
Billed per video. Prices are live at `GET /api/v1/models/grok-imagine-video`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "grok-imagine-video",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="grok-imagine-video",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-imagine-video","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-imagine-video");
if (!model.servable) throw new Error("grok-imagine-video is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Grok Imagine Video 1.5
Source: https://docs.ninjachat.ai/api-reference/models/video/grok-imagine-video-1-5
grok-imagine-video-1.5 on NinjaChat — xAI's Grok Imagine Video 1.5. $1.20 per video.
`grok-imagine-video-1.5`
xAI
\$1.20 per video
Image reference
xAI's Grok Imagine Video 1.5.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per video | \$1.20 |
Billed per video. Prices are live at `GET /api/v1/models/grok-imagine-video-1.5`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "grok-imagine-video-1.5",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="grok-imagine-video-1.5",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-imagine-video-1.5","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("grok-imagine-video-1.5");
if (!model.servable) throw new Error("grok-imagine-video-1.5 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Kling 2.6 Pro
Source: https://docs.ninjachat.ai/api-reference/models/video/kling-video
kling-video on NinjaChat — Kuaishou's Kling 2.6 Pro for fluid text- and image-to-video with audio. $1.40 per video.
`kling-video`
Kuaishou — served by Replicate
\$1.40 per video
Image reference, Audio output
Kuaishou's Kling 2.6 Pro for fluid text- and image-to-video with audio.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per video | \$1.40 |
Billed per video. Prices are live at `GET /api/v1/models/kling-video`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "kling-video",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="kling-video",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"kling-video","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`, `generate_audio`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("kling-video");
if (!model.servable) throw new Error("kling-video is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Runway Gen-4.5
Source: https://docs.ninjachat.ai/api-reference/models/video/runway-gen4-5
runway-gen4.5 on NinjaChat — Runway's Gen-4.5 text- and image-to-video model. $1.20 per video.
`runway-gen4.5`
Runway
\$1.20 per video
Image reference
Runway's Gen-4.5 text- and image-to-video model.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per video | \$1.20 |
Billed per video. Prices are live at `GET /api/v1/models/runway-gen4.5`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "runway-gen4.5",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="runway-gen4.5",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"runway-gen4.5","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("runway-gen4.5");
if (!model.servable) throw new Error("runway-gen4.5 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Seedance 2.0
Source: https://docs.ninjachat.ai/api-reference/models/video/seedance-2
seedance-2 on NinjaChat — ByteDance's Seedance 2.0 references-to-video model with audio. $3.636 per video.
`seedance-2`
ByteDance — served by BytePlus
\$3.636 per video
Image reference, Audio output
ByteDance's Seedance 2.0 references-to-video model with audio.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per video | \$3.636 |
Billed per video. Prices are live at `GET /api/v1/models/seedance-2`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "seedance-2",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="seedance-2",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedance-2","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`, `generate_audio`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seedance-2");
if (!model.servable) throw new Error("seedance-2 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Seedance 2.0 Fast
Source: https://docs.ninjachat.ai/api-reference/models/video/seedance-2-0-fast
seedance-2.0-fast on NinjaChat — ByteDance's speed tier of Seedance 2.0. $0.63 per video.
`seedance-2.0-fast`
ByteDance — served by BytePlus
\$0.63 per video
Image reference, Audio output
ByteDance's speed tier of Seedance 2.0.
## Pricing
| Unit | Price |
| :-------- | :----------------- |
| Per video | $0.63 (list $0.84) |
Limited offer: 25% off the list price through 2026-09-08. After that the list price applies.
Billed per video. Prices are live at `GET /api/v1/models/seedance-2.0-fast`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "seedance-2.0-fast",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="seedance-2.0-fast",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedance-2.0-fast","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`, `generate_audio`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seedance-2.0-fast");
if (!model.servable) throw new Error("seedance-2.0-fast is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Seedance 2.0 Mini
Source: https://docs.ninjachat.ai/api-reference/models/video/seedance-2-mini
seedance-2-mini on NinjaChat — ByteDance's compact Seedance 2.0 with audio. $0.4221 per video.
`seedance-2-mini`
ByteDance — served by BytePlus
\$0.4221 per video
Image reference, Audio output
ByteDance's compact Seedance 2.0 with audio.
## Pricing
| Unit | Price |
| :-------- | :--------------------- |
| Per video | $0.4221 (list $1.0552) |
Limited offer: 60% off the list price through 2026-09-08. After that the list price applies.
Billed per video. Prices are live at `GET /api/v1/models/seedance-2-mini`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "seedance-2-mini",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="seedance-2-mini",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedance-2-mini","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`, `generate_audio`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seedance-2-mini");
if (!model.servable) throw new Error("seedance-2-mini is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Seedance 1 Lite
Source: https://docs.ninjachat.ai/api-reference/models/video/seedance-lite
seedance-lite on NinjaChat — ByteDance's low-cost first-generation Seedance. $0.432 per video.
`seedance-lite`
ByteDance — served by Replicate
\$0.432 per video
Image reference
ByteDance's low-cost first-generation Seedance.
## Pricing
| Unit | Price |
| :-------- | :------ |
| Per video | \$0.432 |
Billed per video. Prices are live at `GET /api/v1/models/seedance-lite`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "seedance-lite",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="seedance-lite",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedance-lite","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seedance-lite");
if (!model.servable) throw new Error("seedance-lite is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Seedance 1 Pro
Source: https://docs.ninjachat.ai/api-reference/models/video/seedance-pro
seedance-pro on NinjaChat — ByteDance's first-generation Seedance Pro at 1080p. $1.80 per video.
`seedance-pro`
ByteDance — served by Replicate
\$1.80 per video
Image reference, End frame
ByteDance's first-generation Seedance Pro at 1080p.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per video | \$1.80 |
Billed per video. Prices are live at `GET /api/v1/models/seedance-pro`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "seedance-pro",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="seedance-pro",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedance-pro","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`, `end_image_url`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("seedance-pro");
if (!model.servable) throw new Error("seedance-pro is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Veo 3.1
Source: https://docs.ninjachat.ai/api-reference/models/video/veo-3-1
veo-3.1 on NinjaChat — Google's Veo 3.1 for cinematic text- and image-to-video with native audio. $3.20 per video.
`veo-3.1`
Google
\$3.20 per video
Image reference
Google's Veo 3.1 for cinematic text- and image-to-video with native audio.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per video | \$3.20 |
Billed per video. Prices are live at `GET /api/v1/models/veo-3.1`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "veo-3.1",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="veo-3.1",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"veo-3.1","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("veo-3.1");
if (!model.servable) throw new Error("veo-3.1 is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Veo 3.1 Fast
Source: https://docs.ninjachat.ai/api-reference/models/video/veo-3-1-fast
veo-3.1-fast on NinjaChat — Google's speed-optimized Veo 3.1. $1.20 per video.
`veo-3.1-fast`
Google
\$1.20 per video
Image reference
Google's speed-optimized Veo 3.1.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per video | \$1.20 |
Billed per video. Prices are live at `GET /api/v1/models/veo-3.1-fast`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "veo-3.1-fast",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="veo-3.1-fast",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"veo-3.1-fast","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`, `image_url`, `reference_images`, `reference_video`, `reference_audio`, `watermark`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("veo-3.1-fast");
if (!model.servable) throw new Error("veo-3.1-fast is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Wan 2.2 T2V A14B
Source: https://docs.ninjachat.ai/api-reference/models/video/wan-2-2-t2v-a14b
wan-2.2-t2v-a14b on NinjaChat — Alibaba's open-weight Wan 2.2 with 14B active parameters for fixed 5-second clips. $0.60 per video.
`wan-2.2-t2v-a14b`
Alibaba — served by DigitalOcean Inference
\$0.60 per video
Text to video
Alibaba's open-weight Wan 2.2 with 14B active parameters for fixed 5-second clips.
## Pricing
| Unit | Price |
| :-------- | :----- |
| Per video | \$0.60 |
Billed per video. Prices are live at `GET /api/v1/models/wan-2.2-t2v-a14b`; the value above was read from that endpoint when this page was generated.
## Use this model
Video is asynchronous: `videos.generate` returns a queued job, and `waitFor` / `wait_for` polls `GET /videos/{id}` until it completes. The SDK examples assume you have [created a server-side client](/sdks#create-a-client).
```typescript TypeScript SDK theme={null}
const job = await client.videos.generate({
model: "wan-2.2-t2v-a14b",
prompt: "A cinematic aerial push across a desert at blue hour",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
job = client.videos.generate(
model="wan-2.2-t2v-a14b",
prompt="A cinematic aerial push across a desert at blue hour",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/videos \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"wan-2.2-t2v-a14b","prompt":"A cinematic aerial push across a desert at blue hour"}'
# then poll until status is "completed"
curl https://www.ninjachat.ai/api/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
## Supported parameters
`prompt`, `model`, `duration`, `aspect_ratio`
## Check live support
```typescript TypeScript SDK theme={null}
const model = await client.models.retrieve("wan-2.2-t2v-a14b");
if (!model.servable) throw new Error("wan-2.2-t2v-a14b is temporarily unavailable");
console.log({
capabilities: model.capabilities,
supportedParameters: model.supportedParameters,
pricing: model.pricing,
providers: model.providers,
});
```
**Guides:** [Video generation](/video-generation) · [Pricing](/pricing) · [All models](/models-overview)
# Record an authenticated model ranking
Source: https://docs.ninjachat.ai/api-reference/record-an-authenticated-model-ranking
/openapi.json post /battles
# Run a batch of chat requests
Source: https://docs.ninjachat.ai/api-reference/run-a-batch-of-chat-requests
/openapi.json post /batch
# Run a saved preset
Source: https://docs.ninjachat.ai/api-reference/run-a-saved-preset
/openapi.json post /presets/{slug}/chat/completions
Chat completion using a preset's saved model, routing, system prompt, and parameters. Send only your messages; pass model/models to override the preset's chain for this call. Response headers include X-Ninja-Preset and X-Ninja-Preset-Version.
# Search the web
Source: https://docs.ninjachat.ai/api-reference/search-the-web
/openapi.json post /search
# Send a test webhook
Source: https://docs.ninjachat.ai/api-reference/send-a-test-webhook
/openapi.json post /webhooks/test
Send one synthetic event immediately so you can verify signature handling before relying on live jobs.
# Authentication
Source: https://docs.ninjachat.ai/authentication
One header on every request.
```
Authorization: Bearer nj_sk_YOUR_API_KEY
```
## Get a key
Create one at [Developers → Keys](https://www.ninjachat.ai/developers/keys). Keys start with `nj_sk_` and are shown **once** — copy immediately.
Browsing and estimates are free. Paid calls draw from your **Developer Balance** — top up at [Developers → Billing](https://www.ninjachat.ai/developers/billing), or verify your phone on your first paid action to unlock a \$0.50 starter balance.
## Use it
```typescript TypeScript SDK theme={null}
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({
apiKey: process.env.NINJACHAT_API_KEY!,
});
const response = await client.responses.create({
model: "ninja/auto",
input: "Hello",
});
```
```python Python SDK theme={null}
import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
response = client.responses.create(
model="ninja/auto",
input="Hello",
)
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/responses \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ninja/auto","input":"Hello"}'
```
## Keep it secret
Environment variables, never hardcoded:
```bash theme={null}
export NINJACHAT_API_KEY="nj_sk_YOUR_API_KEY" # or a .env file in .gitignore
```
And never in frontend code — CORS is open on `/api/v1/*`, but a key in the browser is a key stolen. Proxy through your backend:
```python theme={null}
@app.post("/api/chat")
def proxy(req):
return client.responses.create(
model="ninja/auto",
input=req.json["message"],
)
```
## Key management
* Up to **25 active keys** per account — use separate keys for dev / staging / prod; once you hit the cap, revoke one to create another
* Revoke instantly from [Developers → Keys](https://www.ninjachat.ai/developers/keys); revoked keys stop **immediately**
* The same key works for the [MCP server](/mcp/overview) — agents and code share one balance
## Auth errors
| Status | Error | Fix |
| ------ | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 401 | `missing_api_key` | Add the `Authorization: Bearer nj_sk_...` header |
| 401 | `invalid_api_key` | Key is malformed or revoked — create a new one |
| 401 | `expired_api_key` | Key passed its expiry date — create a new one |
| 403 | `read_only_key` | Key was created read-only and can't make billable requests — use a full-access key |
| 403 | `insufficient_scope` | The credential can't call this endpoint (a Continue with NinjaChat wallet token can only spend on inference, not read usage, sessions, webhooks, or battles) — use a regular `nj_sk_` key |
# Batch
Source: https://docs.ninjachat.ai/batch
Run up to 20 independent chat requests in one call, held up front and settled to actual token usage.
`POST /api/v1/batch` fans out up to 20 chat requests, runs them in parallel, and returns every result — or streams each one as it finishes. It is a raw REST endpoint; the SDKs don't wrap it. Use it when you have a pile of independent prompts (classification, extraction, per-row summaries) and want one hold, one request ID, and one settlement instead of twenty.
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/batch \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: batch-2026-09-01-0001" \
-d '{
"requests": [
{ "model": "gpt-5.4", "messages": [{ "role": "user", "content": "Classify: \"My order never arrived.\"" }], "max_tokens": 32 },
{ "model": "claude-sonnet-5", "messages": [{ "role": "user", "content": "Classify: \"How do I reset my password?\"" }], "max_tokens": 32 }
],
"fail_on_any_error": false
}'
```
## Request
| Parameter | Type | Default | Description |
| ------------------------ | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `requests` | array | required | 1–20 jobs. |
| `requests[].model` | string | `gpt-5` | A chat model ID from [`GET /models`](/models). |
| `requests[].messages` | array | required | 1–30 `system`, `user`, or `assistant` messages; string content up to 50,000 chars. |
| `requests[].temperature` | number | `0.7` | 0–2. |
| `requests[].max_tokens` | integer | `2048` | Output ceiling per job, 1–8,192. Also sizes the hold. |
| `fail_on_any_error` | boolean | `false` | When `true`, one failed job fails the whole batch (`500 batch_request_failed` with `failed_index`) and the entire hold is refunded. |
| `stream` | boolean | `false` | Stream results over SSE as jobs complete. |
Send an `Idempotency-Key` header so a retried batch replays instead of running twice. A streamed batch can't be replayed — reusing its key returns `409 stream_not_replayable`.
## Response
```json theme={null}
{
"results": [
{
"index": 0,
"success": true,
"model": "gpt-5.4",
"requested_model": "gpt-5.4",
"content": "shipping",
"cost_cents": 0.02,
"latency_ms": 640,
"tokens": { "prompt": 18, "completion": 2, "total": 20 },
"usage": { "inputTokens": 18, "outputTokens": 2, "present": true }
},
{
"index": 1,
"success": false,
"model": "claude-sonnet-5",
"requested_model": "claude-sonnet-5",
"error": "...",
"cost_cents": 0,
"latency_ms": 1200
}
],
"succeeded": 1,
"failed": 1,
"total_cost_cents": 0.02,
"total_cost": "$0.0002",
"balance": "$24.99",
"metadata": { "total_latency_ms": 1250, "batch_size": 2, "parallelism": 2 },
"request_id": "req_..."
}
```
`results` is ordered by `index`. Each job keeps the same silent model-fallback chain a single chat request has, so `model` is the model that actually served the job and `requested_model` is the one you asked for. A success result carries `usage_estimated: true` when the provider didn't report usage and the tokens were estimated. `balance_warning` appears when your balance is at or below \$5.
### Streaming
With `stream: true` the response is `text/event-stream`. Each finished job arrives as a `data:` frame with `type: "result"` and the same fields as above; a final `type: "summary"` frame carries `succeeded`, `failed`, `total_cost_cents`, `total_cost`, and `request_id`, followed by `data: [DONE]`.
## Billing and limits
* **Hold, then settle.** Before any job runs, the gateway holds the sum of every job's metered maximum (input estimate plus `max_tokens` at that model's rates). Each successful job bills its actual metered usage at the serving model's rates; failed jobs cost nothing; the unused hold is refunded when the batch completes. If your balance can't cover the hold you get `402 insufficient_credits` with `estimated_cost` and `balance`; a project or key spend limit returns `402 spend_limit_exceeded`.
* **Rate limits.** A batch of N jobs consumes N units of the chat requests-per-minute and concurrency budgets and the summed token estimate of the tokens-per-minute budget, so it draws on the same 60-per-minute-per-key pool as `/chat/completions`. A `429` from this route adds `units` (the fan-out size). See [Rate limits](/rate-limits).
* **Body size.** The whole request must fit the batch route's JSON limit; keep long documents to a few jobs per call.
One prompt, several models, ranked results.
Estimate holds before you send.
# Spend controls
Source: https://docs.ninjachat.ai/budget-routing
Set a per-request maximum while preserving intelligent routing and fallbacks.
Pass `routing.max_cost_usd` to reject routes whose published execution envelope exceeds your request budget. Keep the model decision explicit with `model` or `models`; use `ninja/auto` when you want NinjaChat to choose.
```typescript TypeScript SDK theme={null}
const response = await client.responses.create({
model: "ninja/auto",
input: "Translate to Spanish: Hello world",
max_output_tokens: 80,
routing: {
strategy: "cost",
max_cost_usd: 0.005,
allow_fallbacks: true,
},
});
console.log(response.cost_usd, response.routing.resolved_model);
```
```python Python SDK theme={null}
response = client.responses.create(
model="ninja/auto",
input="Translate to Spanish: Hello world",
max_output_tokens=80,
routing={"strategy": "cost", "max_cost_usd": 0.005, "allow_fallbacks": True},
)
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/responses \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ninja/auto","input":"Translate to Spanish: Hello world","routing":{"strategy":"cost","max_cost_usd":0.005}}'
```
## Parameters
| Parameter | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `routing.max_cost_usd` | Maximum allowed cost in US dollars for the routed execution. Positive, up to `1000`. |
| `routing.strategy` | Use `cost` to prefer the least expensive eligible model (with `ninja/auto`) or rail (with a pinned model). |
| `max_output_tokens` | Bound generated output and therefore the largest variable part of token spend — and of the pre-authorization hold. |
## How the cap is enforced
1. **Before any provider call**, the gateway computes the maximum token hold for the request: your input estimate plus the output ceiling, priced at the candidate models' metered rates. If that hold is above `max_cost_usd`, the request is rejected with `400 max_cost_exceeded` and nothing runs:
```json theme={null}
{
"error": {
"message": "The maximum token hold is $0.012000, above routing.max_cost_usd=$0.005000.",
"type": "invalid_request_error",
"code": "max_cost_exceeded",
"param": "routing.max_cost_usd"
},
"maximum_hold_usd": 0.012
}
```
Lower `max_output_tokens`, pick cheaper candidates, or raise the cap.
2. **At settle time**, the metered charge is capped at `max_cost_usd`. Usage priced above the cap is absorbed by NinjaChat — it is logged, never billed to you.
The cap is a guardrail, not a prediction of the final charge. Actual billing uses measured tokens and is returned as `cost_usd`. Read [live model pricing](/pricing) when you need to forecast a workload.
## Where it shines
Cost control per request without maintaining a model list. A tiered product can map plan → budget — treat these as starting points, not guarantees: a plan's real headroom still depends on how long its users' messages run.
```python Python SDK theme={null}
BUDGETS = {"free": 0.005, "pro": 0.05, "enterprise": 0.50} # USD per request
def chat_for(plan: str, message: str):
return client.responses.create(
model="ninja/auto",
input=message,
routing={"strategy": "cost", "max_cost_usd": BUDGETS[plan]},
)
```
As new models and rails launch, `ninja/auto` can improve without changing your integration while the cap remains fixed.
# Text generation
Source: https://docs.ninjachat.ai/chat
Generate text, use vision and tools, and route across providers with the SDK or raw REST.
NinjaChat has two text APIs on the same model network. **Responses** is recommended for new applications; **Chat Completions** is the OpenAI-compatible interface for role-based messages.
Best for new text, vision, tools, structured output, and typed streaming integrations.
Best when your application already uses OpenAI-style role messages or an OpenAI client.
## Responses API
```typescript TypeScript SDK theme={null}
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const response = await client.responses.create({
model: "ninja/auto",
instructions: "Be concise and concrete.",
input: "Explain edge caching in one paragraph.",
max_output_tokens: 200,
});
console.log(response.output_text);
console.log(response.cost_usd, response.request_id);
```
```python Python SDK theme={null}
import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
response = client.responses.create(
model="ninja/auto",
instructions="Be concise and concrete.",
input="Explain edge caching in one paragraph.",
max_output_tokens=200,
)
print(response["output_text"])
print(response["cost_usd"], response["request_id"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/responses \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ninja/auto","input":"Explain edge caching in one paragraph.","max_output_tokens":200}'
```
## Chat Completions
```typescript TypeScript SDK theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.6-luna",
messages: [
{ role: "system", content: "Be concise and concrete." },
{ role: "user", content: "Explain edge caching in one paragraph." },
],
max_completion_tokens: 200,
});
console.log(completion.choices[0].message.content);
console.log(completion.resolved_model, completion.provider);
```
```python Python SDK theme={null}
completion = client.chat.completions.create(
model="gpt-5.6-luna",
messages=[
{"role": "system", "content": "Be concise and concrete."},
{"role": "user", "content": "Explain edge caching in one paragraph."},
],
max_completion_tokens=200,
)
print(completion["choices"][0]["message"]["content"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-luna","messages":[{"role":"user","content":"Explain edge caching in one paragraph."}]}'
```
## Parameters
The two endpoints share routing, billing, and most sampling controls, but not every field exists on both. The **API** column says where a parameter is accepted; sending a field to the other endpoint returns `400 unsupported_parameter`.
| Parameter | API | Type | Default | Description |
| ----------------------- | --------- | ---------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model` | Both | string | — | One concrete [model ID](/models) or `ninja/auto`. Mutually exclusive with `models`. |
| `models` | Both | array | — | 1–15 ordered candidates for [fallback routing](/fallback-chains). `ninja/auto` is allowed only as the first entry. Mutually exclusive with `model`. |
| `input` | Responses | string or array | required | Text, or 1–100 typed items (`message`, `function_call`, `function_call_output`). |
| `instructions` | Responses | string | — | Developer instruction sent ahead of `input`. |
| `messages` | Chat | array | required | 1–100 `developer`, `system`, `user`, `assistant`, or `tool` messages. |
| `max_output_tokens` | Responses | integer | — | Output ceiling, up to 131,072. |
| `max_completion_tokens` | Chat | integer | — | Output ceiling, up to 131,072. `max_tokens` is accepted as an alias — see [OpenAI compatibility](/openai-compatibility). |
| `temperature` | Both | number | provider default | 0–2. |
| `top_p` | Both | number | — | Nucleus sampling (0–1). |
| `stop` | Chat | string or array | — | Up to 4 stop sequences. |
| `frequency_penalty` | Chat | number | — | -2 to 2. Penalizes tokens by how often they've already appeared. |
| `presence_penalty` | Chat | number | — | -2 to 2. Penalizes tokens that have appeared at all. |
| `seed` | Chat | integer | — | Best-effort deterministic sampling seed. |
| `n` | Chat | integer | `1` | Only `1` is accepted; anything else is `400 unsupported_value`. |
| `stream` | Both | boolean | `false` | Typed SSE iteration in both SDKs — [Streaming](/streaming). |
| `stream_options` | Chat | object | — | `{ "include_usage": true }`. Responses streams always finish with usage. |
| `response_format` | Chat | object | — | `{"type": "text" \| "json_object" \| "json_schema"}`; `json_schema` wraps `{ name, schema, strict }` under `json_schema`. |
| `text.format` | Responses | object | — | Same three formats, flat: `{"type": "json_schema", "name": "...", "schema": {...}, "strict": true}`. |
| `tools` | Both | array | — | Up to 32 function tools. The shapes differ — see [Function calling](#function-calling). |
| `tool_choice` | Both | string or object | — | `"auto"`, `"none"`, `"required"`, or one named function. The object shapes differ — see [Function calling](#function-calling). |
| `parallel_tool_calls` | Both | boolean | — | Let the model emit several tool calls in one turn. |
| `store` | Responses | boolean | `false` | Only `false` is accepted. `true` returns `400 store_unsupported`; `previous_response_id` returns `400 previous_response_unsupported`. |
| `metadata` | Responses | object | — | String map (values ≤ 512 chars) echoed back on the response object. |
| `user` | Both | string | — | Opaque end-user identifier for your own tracking (max 256 chars). |
| `routing` | Both | object | project defaults | Strategy, provider allow/exclude/order, fallbacks, data policy, caching, and `max_cost_usd` (max `1000`). |
### Spend cap
`routing.max_cost_usd` is checked twice. Before any provider call the gateway computes the **maximum token hold** — your input estimate plus the output ceiling at the candidate models' metered rates — and rejects the request with `400 max_cost_exceeded` (the body includes `maximum_hold_usd`) if that hold is above the cap. At settle time the metered charge is capped at `max_cost_usd`; usage priced above it is absorbed by NinjaChat, never billed to you. See [Spend controls](/budget-routing).
### Structured output
Ask for JSON with `response_format` (Chat Completions) or `text.format` (Responses). `json_object` returns any valid JSON; `json_schema` constrains it to your schema (`strict` defaults to `true`). Models without JSON mode return `400 model_not_json_capable` — filter on the `json_mode` capability in [`GET /models`](/models).
## Multi-turn conversations
Two ways to carry a conversation:
Send the conversation items your application stores. NinjaChat API v1 is stateless and does not retain response bodies.
```typescript theme={null}
const response = await client.responses.create({
model: "gpt-5.6-luna",
input: conversationItems,
store: false,
});
```
[State management →](/sessions)
Pass the full conversation every request:
```json theme={null}
{
"model": "gpt-5.6-luna",
"messages": [
{"role": "user", "content": "What is photosynthesis?"},
{"role": "assistant", "content": "Photosynthesis converts sunlight..."},
{"role": "user", "content": "How does it compare to solar panels?"}
]
}
```
## Vision input
Any [vision-capable model](/models) accepts images by sending `content` as an array of parts instead of a plain string — mix `text` and `image_url` parts in one message:
```json theme={null}
{
"model": "gpt-5.6-luna",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "What's in this image?"},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg", "detail": "auto"}}
]
}
]
}
```
`image_url.url` accepts a public HTTPS URL or a base64 data URL. `detail` is optional (`auto`, `low`, or `high`). Sending images to a model that isn't vision-capable returns a `model_not_vision_capable` error listing which models support it.
## Function calling
Pass OpenAI-style `tools` and NinjaChat routes the model's tool calls back to you the same way OpenAI does — the model doesn't execute anything itself, it just tells you what to call:
```json theme={null}
{
"model": "gpt-5.6-luna",
"messages": [{"role": "user", "content": "What's the weather in Austin?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]
}
}
}],
"tool_choice": "auto"
}
```
Only [tool-capable models](/models) accept `tools` — passing them to a model that doesn't support tool calling returns a `model_not_tool_capable` error.
On `/responses` the definition is flat (no `function` wrapper) and `tool_choice` names the function directly:
```json theme={null}
{
"model": "gpt-5.6-luna",
"input": "What's the weather in Austin?",
"tools": [{
"type": "function",
"name": "get_weather",
"description": "Get the current weather for a city",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]
}
}],
"tool_choice": {"type": "function", "name": "get_weather"}
}
```
The same forced choice on Chat Completions is `{"type": "function", "function": {"name": "get_weather"}}`. Tool calls come back as `function_call` output items on Responses and as `tool_calls` on Chat Completions; send results back as `function_call_output` input items or `tool` messages respectively. Only `function` tools are supported — a built-in tool type returns `400 unsupported_tool`.
## Routing is explicit
Everything else about the request stays the same — only the model and routing fields change:
| Field | Behavior |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `model: "gpt-5.6-luna"` | That exact model |
| `model: "ninja/auto"` | Use the Ninja Router (`ninja/auto`). |
| `routing.strategy: "latency"` | Prefer the fastest eligible provider rail. |
| `routing.strategy: "cost"` | Prefer the lowest-cost eligible provider rail. |
| `models: ["claude-sonnet-5", "gpt-5.6-luna"]` | Try an explicit ordered fallback set. |
| `routing.max_cost_usd: 0.05` | Reject the request (`400 max_cost_exceeded`) if the maximum token hold exceeds the cap, and cap the settled charge at it. |
| `routing.data_policy: "zero_retention"` | Require rails matching that data policy. |
Try any of these live in the [Playground](https://www.ninjachat.ai/developers/playground) — every run shows the exact request that made it.
# Model compare
Source: https://docs.ninjachat.ai/compare
Run one prompt against 2–8 models in parallel and get the results ranked by quality, speed, cost, or a balance of all three.
`POST /api/v1/compare` sends the same messages to several concrete models at once and returns every answer with a ranking, a winner, and per-model quality, latency, and cost. It is a raw REST endpoint; the SDKs don't wrap it. Use it to pick a model for a workload with real prompts instead of benchmarks.
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/compare \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: compare-2026-09-01-0001" \
-d '{
"messages": [{ "role": "user", "content": "Rewrite this release note for a non-technical audience: ..." }],
"models": ["gpt-5.4", "claude-sonnet-5", "gemini-3.7-flash"],
"rank_by": "balanced",
"max_tokens": 512
}'
```
## Request
| Parameter | Type | Default | Description |
| ------------------------ | ------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `messages` | array | required | 1–20 `system`, `user`, or `assistant` messages; string content up to 50,000 chars. |
| `models` | array | server default set | 2–8 **concrete** chat model IDs, each at most once. `ninja/auto` and other virtual IDs are rejected; a duplicate returns `400 validation_error`. Omit it to compare a built-in default set. |
| `rank_by` | string | `balanced` | `quality`, `speed`, `cost`, or `balanced`. |
| `max_tokens` | integer | `1024` | Output ceiling per model, 1–8,192. Also sizes the hold. |
| `temperature` | number | `0.7` | 0–2, applied to every model. |
| `include_full_responses` | boolean | `true` | `false` truncates each `content` to 200 characters. |
| `stream` | boolean | `false` | Stream per-model results over SSE. |
Send an `Idempotency-Key` so a retry replays instead of re-running every model. A streamed comparison can't be replayed — reusing its key returns `409 stream_not_replayable`.
## Response
```json theme={null}
{
"request_id": "req_...",
"winner": { "model": "gemini-3.7-flash", "name": "Gemini 3.7 Flash", "reason": "Best balance of quality (0.91), speed (1180ms), and cost ($0.0009)" },
"results": [
{
"rank": 1,
"model": "gemini-3.7-flash",
"content": "...",
"error": null,
"quality": { "confidence": 0.91, "flags": [], "suggested_retry": false },
"latency_ms": 1180,
"cost_cents": 0.09,
"tokens": { "prompt": 140, "completion": 96, "total": 236 },
"success": true
}
],
"failed": [],
"summary": {
"fastest": { "model": "gemini-3.7-flash", "latency_ms": 1180 },
"highest_quality": { "model": "claude-sonnet-5", "confidence": 0.94 },
"cheapest": { "model": "gemini-3.7-flash", "cost_cents": 0.09 },
"best_value": { "model": "gemini-3.7-flash" }
},
"ranked_by": "balanced",
"models_compared": 3,
"succeeded": 3,
"total_cost_cents": 0.41,
"total_cost": "$0.0041",
"balance": "$24.95",
"compared_at": "2026-09-01T18:20:00.000Z",
"metadata": { "latency_ms": 2400 }
}
```
`results` holds the successful models in rank order; `failed` holds any model that errored or returned an empty completion (`error: "empty_completion"`), at zero cost. `quality` is the [quality score](/quality-scoring) computed for that answer. `best_value` is the highest quality-per-cent ratio. `balance_warning` appears when your balance is at or below \$5. The numbers in the sample are illustrative.
### How ranking works
| `rank_by` | Score |
| ---------- | --------------------------------------------------------- |
| `quality` | The quality score's `confidence` |
| `speed` | Relative latency against the slowest model in the set |
| `cost` | Relative cost against the most expensive model in the set |
| `balanced` | 50% quality + 30% speed + 20% cost |
### Streaming
With `stream: true` the response is `text/event-stream`. Frames are `data:` JSON objects whose `type` is `start`, then `delta` and `model_done` (or `model_error`) per model as tokens arrive, and finally `rankings` once every model has settled.
## Billing and limits
* **Hold, then settle.** The gateway holds the sum of each model's metered maximum (input estimate plus `max_tokens` at that model's rates) before fan-out. Each model then bills its own actual metered usage; failed or empty models cost nothing; the unused hold is refunded. A balance that can't cover the hold returns `402 insufficient_credits` with `estimated_cost` and `balance`.
* **Rate limits.** Comparing M models consumes M units of the chat requests-per-minute and concurrency budgets and M × the prompt estimate of the tokens-per-minute budget. A `429` from this route adds `units`. See [Rate limits](/rate-limits).
* **Unpriced models.** A model with no metered price returns `400 unpriced_model` before anything runs.
How `quality.confidence` and `flags` are computed.
Many prompts, one call.
# Error handling
Source: https://docs.ninjachat.ai/error-handling
Every error code, what it means, and what to do about it.
Errors use the OpenAI-compatible shape — an `error` object with `message`, `type`,
`code`, and `param`. The same `message` and `code` are mirrored at the top
level, alongside a `request_id` for support. Some errors add extra top-level
fields (`retry_after` on a `429`; `scope`, `limit`, and `spent` on a spend-limit
`402`; `maximum_hold_usd` on `max_cost_exceeded`):
```json theme={null}
{
"error": {
"message": "No API credits. Add credits at https://www.ninjachat.ai/developers/billing — docs: https://docs.ninjachat.ai",
"type": "insufficient_quota",
"code": "insufficient_credits",
"param": null
},
"message": "No API credits. Add credits at https://www.ninjachat.ai/developers/billing — docs: https://docs.ninjachat.ai",
"code": "insufficient_credits",
"request_id": "req_abc123",
"balance": "$0.00"
}
```
That's the zero-balance case, checked before the body is read. If you have a
balance but it can't cover this request's pre-authorization hold, chat returns
the same code with a dynamic message: `"Insufficient credits for the maximum
token hold of $0.012345."` The hold is a reserve sized from your input plus the
output ceiling; a completed request settles to actual usage.
## Error reference
### 400 — fix the request
| Code | What's wrong | What to do |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `invalid_json` | Body isn't valid JSON | Fix your JSON syntax |
| `validation_error` | A field is missing, the wrong type, or out of range; `param` names it | Check the message against [Parameters](/chat#parameters) |
| `unsupported_parameter` | An unknown field (request schemas are strict), or a real use of `logprobs` / `logit_bias` on `/chat/completions` | Remove the field — see [OpenAI compatibility](/openai-compatibility#whats-rejected) |
| `conflicting_parameters` | `max_tokens` and `max_completion_tokens` both sent with different values | Send one of them |
| `unsupported_value` | `n` other than `1` | Send separate requests |
| `invalid_parameter` | `metadata` isn't an object with at most 32 keys | Fix the value |
| `invalid_model` | Retired id or syntax — `ensemble*`, `auto-*`, `a>b` chains, `model:suffix` — or `ninja/auto` after the first entry of `models` | Use `ninja/auto`, `models`, and `routing` |
| `unknown_model` | `model` isn't in the catalog | Copy a canonical ID from [`GET /models`](/models) |
| `model_not_vision_capable` | Image input sent to a model without vision | Use a vision-capable model |
| `model_not_tool_capable` | `tools` sent to a model without tool calling | Use a tool-capable model |
| `model_not_json_capable` | `response_format` / `text.format` JSON sent to a model without structured output | Use a model with the `json_mode` capability |
| `max_cost_exceeded` | The maximum token hold is above `routing.max_cost_usd` (`maximum_hold_usd` is returned) | Raise the cap, lower the output ceiling, or pick cheaper candidates — [Spend controls](/budget-routing) |
| `unpriced_model` | A model in a [`/compare`](/compare) or [`/batch`](/batch) request has no metered price; returned before anything runs (`param` names it, and batch adds `failed_index`) | Pick a model with `pricing` on [`GET /models`](/models) |
| `store_unsupported` | `store: true` on `/responses` | Responses are stateless; omit it or send `false` |
| `previous_response_unsupported` | `previous_response_id` on `/responses` | Include the complete input instead |
| `unsupported_tool` | A non-`function` tool type on `/responses` | Only function tools are supported |
| `invalid_image` | An `image_url` couldn't be fetched, isn't an image, or exceeds limits | Send a public HTTPS URL or a base64 data URL |
| `invalid_period` | `period` isn't `1d`, `7d`, or `30d` (usage endpoint) | Pass a supported period |
### 401 / 403 — fix the credential
| Status | Code | What's wrong | What to do |
| ------ | -------------------- | --------------------------------------- | --------------------------------------------------------------------------------- |
| 401 | `missing_api_key` | No auth header | Add `Authorization: Bearer nj_sk_...` |
| 401 | `invalid_api_key` | Bad or revoked key | Create a new one in [Developers → Keys](https://www.ninjachat.ai/developers/keys) |
| 401 | `expired_api_key` | Key passed its expiry | Create a new key |
| 403 | `read_only_key` | Key is read-only | Use a full-access key for billable requests |
| 403 | `insufficient_scope` | The credential can't call this endpoint | Use a regular `nj_sk_` API key |
### 402 — add credits or raise a limit
| Code | What's wrong | What to do |
| ---------------------- | ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `insufficient_credits` | Zero balance, or the balance can't cover the hold for this request | [Add credits](https://www.ninjachat.ai/developers/billing) |
| `spend_limit_exceeded` | A monthly account, key, or project spend limit is reached; `scope`, `limit`, and `spent` are returned | Raise it at [Developers → Billing](https://www.ninjachat.ai/developers/billing) or wait for the period to reset |
### 404, 409, 410, 413, 429
| Status | Code | What's wrong | What to do |
| ------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| 404 | `not_found` | Video job, request trace, webhook, or session doesn't exist or isn't yours | Check the ID and API-key ownership |
| 404 | `model_not_found` | `GET /models/{id}` for an id that isn't in the catalog | See `GET /models` |
| 409 | `idempotency_conflict` | The `Idempotency-Key` was already used with a different request body | Use a new key for new content |
| 409 | `request_in_flight` | A request with this `Idempotency-Key` is still running (or failed before completing) | Retry after `Retry-After` (5s) |
| 409 | `stream_replay_unsupported` | The key already completed as a stream; streams can't be replayed | Use a new key |
| 409 | `stream_not_replayable` | The same case on [`/compare`](/compare) and [`/batch`](/batch): the `Idempotency-Key` already completed as a streamed comparison or batch, which can't be replayed | Use a new key |
| 410 | `endpoint_retired` | A retired legacy route; the body carries `successor` and `docs_url` | Move to the successor |
| 413 | `payload_too_large` | Body exceeds the route's byte limit | Shrink the request |
| 429 | `rate_limit_exceeded` | Too many requests — `limit` and `scope` say which layer | Wait `Retry-After` seconds — [Rate limits](/rate-limits) |
### 5xx — retry
| Status | Code | What's wrong | What to do |
| ------ | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| 500 | `internal_error` | Server error | Retry — **not charged** |
| 500 | `model_not_priced` | A requested model has no metered price in the runtime catalog | Pick another model and report it |
| 500 | `batch_request_failed` | A [`/batch`](/batch) sent with `fail_on_any_error: true` had one job fail; `failed_index` names it and the entire hold is refunded | Fix or drop that request and retry — **not charged** |
| 502 | `all_providers_failed` | Every eligible model and rail failed before producing output (on a `stream: true` request this arrives as an in-band error frame on the already-open `200` stream, then `[DONE]`) | Retry or widen `models` — **not charged** |
| 502 | `generation_failed` | Image or video generation failed upstream | Retry — **not charged**; video jobs are refunded |
| 502 | `search_failed` | Search providers temporarily unavailable | Retry — **not charged** |
| 502 | `status_check_failed` | Polling the video provider for job status failed | Retry |
| 503 | `idempotency_unavailable` | The idempotency store is unreachable; no work was started | Retry with the same `Idempotency-Key` after `Retry-After` |
| 503 | `no_eligible_model` | No requested model is currently servable under this routing policy | Loosen `routing` or add candidates |
| 503 | `service_unavailable` | Video provider not configured | Try again later |
Streams can also fail after the HTTP status has been sent. In that case the last data frame is an error object — `partial_stream` (some output was delivered; only delivered tokens are billed) or `stream_error` (nothing was delivered; not charged). See [Streaming](/streaming).
## Error handling code
The official SDKs retry `429` and `500`/`502`/`503`/`504` when the request is safe to replay, honor `Retry-After`, and generate an `Idempotency-Key` for billed requests so a retry can only replay. A `409 request_in_flight` is retried only when the request carried an idempotency key; `408` is never retried. The clients expose typed errors:
```typescript TypeScript SDK theme={null}
import { NinjaChatError } from "@ninjachat/sdk";
try {
await client.responses.create({
model: "gpt-5.6-luna",
input: "Summarize this incident.",
});
} catch (error) {
if (error instanceof NinjaChatError) {
console.error(error.status, error.code, error.requestId);
}
throw error;
}
```
```python Python SDK theme={null}
from ninjachat import NinjaChatError
try:
client.responses.create(
model="gpt-5.6-luna",
input="Summarize this incident.",
)
except NinjaChatError as error:
print(error.status, error.code, error.request_id)
raise
```
## Common mistakes
| Symptom | Cause | Fix |
| ------------------------------ | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| `unknown_model` | Typo in model ID | Check [available models](/models) for exact IDs |
| `unsupported_parameter` | A field from another API (or `session_id` on a canonical endpoint) | Compare against the [parameter table](/chat#parameters) |
| `validation_error` on messages | Missing `role` or `content` field | Each message needs `{"role": "user", "content": "..."}` |
| `insufficient_credits` | Balance is \$0.00, or too low for this request's hold | [Add credits](https://www.ninjachat.ai/developers/billing) |
| `invalid_api_key` | Key revoked or copied incorrectly | Keys start with `nj_sk_`. Create a new one in [Developers → Keys](https://www.ninjachat.ai/developers/keys) |
| Empty streaming response | Not reading SSE correctly, or treating `:` keepalive lines as data | See [streaming guide](/streaming) |
## Monitor before a `402`
Query `client.balance()` on a schedule and register a signed `balance.low` webhook for the prepaid `$5` and `$1` thresholds. Project spend limits also emit `budget.alert` at 50%, 80%, and 100%.
See [Observability](/observability) for the complete operating loop and signature verification.
## Quick debug
```bash theme={null}
# Test if your key works (should print 200)
curl -s -o /dev/null -w "%{http_code}" \
-X POST https://www.ninjachat.ai/api/v1/responses \
-H "Authorization: Bearer nj_sk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-luna","input":"hi","max_output_tokens":8}'
```
| Output | Meaning |
| ------ | -------------------------------- |
| `200` | Working |
| `401` | Bad, missing, or expired API key |
| `403` | Read-only key |
| `402` | No credits |
# Cost estimation
Source: https://docs.ninjachat.ai/estimate
Price a chat request before you send it — the same pricing engine and token estimator that bill real traffic, with no key and no charge.
`POST /api/v1/estimate` returns what a chat request would cost at today's metered rates. It is **public** — no API key — and never deducts credits. Estimates come from the same pricing tables and token estimator that settle real requests, so an estimate can't disagree with your bill by construction. The SDKs don't wrap it; call it as raw REST.
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/estimate \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"messages": [{"role": "user", "content": "Summarize the attached incident report in five bullets."}],
"max_tokens": 1024,
"count": 1000,
"models": ["gemini-3.7-flash", "claude-sonnet-5"]
}'
```
## Parameters
| Parameter | Type | Default | Description |
| ------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model` | string | required | A chat model ID from [`GET /models`](/models). |
| `messages` | array | — | Up to 10 `system`, `user`, or `assistant` messages (content ≤ 8,000 chars each) used for the prompt-token estimate. Omit it to price a 5,000-token reference input. |
| `max_tokens` | integer | — | Output bound for the maximum estimate (1–16,384). Also caps the typical completion. |
| `count` | integer | `1` | Multiply the estimate by this many requests (1–10,000). |
| `models` | array | — | Up to 10 additional model IDs to price the same payload against. |
## Response
```json theme={null}
{
"model": "gpt-5.4",
"model_name": "GPT-5.4",
"provider": "openai",
"tier": "premium",
"pricing_version": "2026-09-01.provider-rails.1",
"billing": "metered",
"rates": { "input_per_mtok": 2.5, "output_per_mtok": 15, "cached_input_per_mtok": 0.25 },
"estimated_tokens": { "prompt": 24, "completion": 64 },
"estimated_cents": 0.1,
"estimated_cost": "$0.0010",
"estimated_max_cents": 1.54,
"estimated_max": "$0.0154",
"for_count": 1000,
"total_estimated_cents": 100,
"total_estimated": "$1.00",
"cheaper_alternatives": [
{ "id": "gemini-3-flash", "name": "Gemini 3 Flash", "estimated_cents": 0.02, "savings_percent": 80, "capabilities": ["..."] }
],
"monthly_estimate": { "at_100": "$0.10", "at_1000": "$1.00", "at_10000": "$10.00", "at_100000": "$100.00" },
"model_comparison": [
{ "model": "gemini-3.7-flash", "estimated_cents": 0.05, "total_estimated_cents": 50 },
{ "model": "claude-sonnet-5", "estimated_cents": 0.07, "total_estimated_cents": 70 }
],
"note": "Billing is per token ($/MTok input + output). Requests preauthorize estimated_max and settle to actual usage; estimates here use the same engine and estimator that bill real traffic."
}
```
Two numbers matter:
* **`estimated_cents` / `estimated_cost`** — a realistic mid-point. The completion side uses a heuristic of 40% of the prompt tokens (at least 64), capped at `max_tokens` or 2,048.
* **`estimated_max_cents` / `estimated_max`** — the pre-authorization **hold** a real request with these messages and `max_tokens` would reserve. The hold is a reserve, not a ceiling: the request settles to actual usage and the unused portion is returned. Use it to size `routing.max_cost_usd` — a cap below the hold is rejected with `400 max_cost_exceeded`. See [Spend controls](/budget-routing).
`cheaper_alternatives` lists up to three catalog models that would cost less at this exact payload, sorted by savings. `model_comparison` appears only when you pass `models`. The numbers in the sample are illustrative; the endpoint returns live values.
## Limits
* 30 requests per minute per client IP (`429 rate_limit_exceeded` with `retry_after` and a `Retry-After` header).
* Unknown model IDs return `400 validation_error` with the closest matching ID in the message.
`GET /api/v1/pricing` for every model's metered rates.
`routing.max_cost_usd` turns an estimate into a hard ceiling.
# Fallbacks
Source: https://docs.ninjachat.ai/fallback-chains
Provide ordered model candidates and let NinjaChat fail over across models and provider rails.
Pass an ordered `models` array and enable fallbacks. NinjaChat first tries the strongest eligible rail for the first model, then advances safely when a provider or model cannot serve the request.
```mermaid theme={null}
flowchart LR
A["claude-sonnet-5"] -->|"rail unavailable"| B["gpt-5.6-terra"]
B -->|"success"| R["Response"]
B -.->|"if unavailable"| C["gemini-3.1-pro"]
```
```typescript TypeScript SDK theme={null}
const response = await client.responses.create({
models: ["claude-sonnet-5", "gpt-5.6-terra", "gemini-3.1-pro"],
input: "Review this contract clause for hidden risk.",
routing: {
strategy: "quality",
allow_fallbacks: true,
require_parameters: true,
},
});
console.log(response.routing.requested_models);
console.log(response.routing.resolved_model, response.provider);
```
```python Python SDK theme={null}
response = client.responses.create(
models=["claude-sonnet-5", "gpt-5.6-terra", "gemini-3.1-pro"],
input="Review this contract clause for hidden risk.",
routing={
"strategy": "quality",
"allow_fallbacks": True,
"require_parameters": True,
},
)
print(response["routing"]["resolved_model"], response["provider"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/responses \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"models":["claude-sonnet-5","gpt-5.6-terra","gemini-3.1-pro"],
"input":"Review this contract clause for hidden risk.",
"routing":{"strategy":"quality","allow_fallbacks":true,"require_parameters":true}
}'
```
You are billed only for the successful execution. Failed infrastructure attempts do not become customer usage.
## Parameters
| Parameter | Default | Description |
| ---------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `models` | — | 1–15 ordered candidate model IDs. Use instead of `model`. `ninja/auto` may appear only as the **first** entry — anywhere else is `400 invalid_model`. |
| `routing.allow_fallbacks` | `true` | Permit the router to advance across eligible rails and models. A project routing policy can change the default for keys in that project. |
| `routing.require_parameters` | `true` | Skip rails that cannot honor every requested parameter or capability. Set `false` to let a rail serve on a best-effort basis. |
| `routing.providers` | — | Constrain or order the infrastructure providers behind the model IDs (`only`, `exclude`, `order`; up to 20 each — `only` and `exclude` can't be combined). |
If every candidate fails before producing output you get `502 all_providers_failed` and are not charged; if no candidate is currently servable under your routing policy you get `503 no_eligible_model`. With `stream: true` the connection is already open (the gateway commits the `200` and starts sending `:` keepalive comments as soon as your request is admitted), so the same failure arrives as an in-band error frame — `data: {"error": {"code": "all_providers_failed", ...}}` followed by `data: [DONE]` — exactly as a mid-stream failure would.
**Billing:** metered usage comes from the successful resolved model and provider shown in the response.
Fallbacks protect reliability. Use [Smart routing](/smart-routing) when you also want the router to choose the model class.
# Image generation
Source: https://docs.ninjachat.ai/image-generation
Frontier image generation and editing models behind one typed endpoint.
One request, one image URL back. Everything below was generated through these models:
```json POST /api/v1/images/generations theme={null}
{
"model": "flux-2-klein",
"prompt": "A golden retriever puppy in autumn leaves, soft lighting, photorealistic",
"size": "1920x1920",
"n": 1
}
```
```json Response theme={null}
{
"created": 1787529600,
"model": "flux-2-klein",
"provider": "...",
"data": [{"url": "https://cdn.../generated-abc123.webp", "revised_prompt": "..."}],
"usage": {"images_generated": 1},
"cost_usd": 0.014,
"request_id": "req_...",
"routing": {"provider_attempts": ["..."], "retries": 0}
}
```
Your image is at `data[0].url` — download it or hotlink it. `provider` names the rail that rendered it, and `routing.provider_attempts` lists every rail tried (with `retries` counting the failed ones) — a silent fallback never bills above the price of the model you requested.
## Parameters
| Parameter | Default | Description |
| -------------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
| `prompt` | required | Be specific — subject, style, lighting, composition. Max 4,000 chars. |
| `model` | `nano-banana-2` | See the table below. |
| `size` | `1920x1920` | Exactly one of `1920x1920` (square), `2560x1440` (landscape), `1440x2560` (portrait). |
| `n` | `1` | 1–4 images; each is billed. |
| `image` | — | Public HTTPS reference URL for image-to-image. |
| `aspect_ratio` | — | Aspect ratio for models that support it directly, e.g. `16:9`, `1:1` (Nano Banana, Imagen 4, FLUX.2 Flex). |
| `width` | — | Image width in pixels, 256–2048 (FLUX models only). |
| `height` | — | Image height in pixels, 256–2048 (FLUX models only). |
`size` is a strict enum — `1024x1024` and other values are rejected with `validation_error`. Pick one of the three.
## Which model?
Fetch `client.models.list()` and filter `modality` to `image` or `image_edit` for the current catalog. The shortlist below covers common starting points; it is not a frozen inventory.
Three answers cover most cases:
`flux-2-klein` — \$0.014, the fast tier
`nano-banana-2` — \$0.045, great text rendering
`flux-kontext-max` — \$0.08, premium editing
Prices are `pricing.perUnitUsd` from `GET /models` at the time of writing; `n` images cost `n` × the price.
| Model | ID | Cost | Best for |
| -------------------------- | ---------------------------- | ------- | ---------------------------------------- |
| GPT Image 2 | `gpt-image-2` | \$0.128 | OpenAI quality, prompt adherence |
| Seedream 5 Pro | `seedream-5-pro` | \$0.09 | Top-tier Seedream generation |
| FLUX Kontext Max | `flux-kontext-max` | \$0.08 | Premium editing, max fidelity |
| Nano Banana Pro | `nano-banana-pro` | \$0.08 | Professional assets |
| FLUX.2 Flex | `flux-2-flex` | \$0.06 | Maximum quality generation |
| FLUX.1 Pro Ultra | `flux-1-pro-ultra` | \$0.06 | Ultra-high resolution (4MP) |
| Grok Imagine Image Quality | `grok-imagine-image-quality` | \$0.05 | xAI's quality tier |
| Nano Banana 2 | `nano-banana-2` | \$0.045 | Best value, text rendering (the default) |
| Recraft V3 | `recraft-v3` | \$0.04 | Design, illustrations |
| Google Imagen 4 | `google-imagen-4` | \$0.04 | Photorealism, text rendering |
| Seedream | `seedream` | \$0.04 | Realistic, artistic styles |
| FLUX Kontext Pro | `flux-kontext-pro` | \$0.04 | Image editing, style transfer |
| Grok Imagine Image 2.0 | `grok-imagine-image-2.0` | \$0.04 | xAI's standard tier |
| Seedream 5 Lite | `seedream-5-lite` | \$0.035 | Lower-cost Seedream 5 |
| FLUX.2 Pro | `flux-2-pro` | \$0.03 | Balanced quality/speed |
| Qwen Image Edit 2511 | `qwen-image-edit-2511` | \$0.03 | Image editing (`image_edit` modality) |
| FLUX Kontext Dev | `flux-kontext-dev` | \$0.025 | Budget editing (`image_edit` modality) |
| FLUX.2 Dev | `flux-2-dev` | \$0.024 | Budget FLUX.2 generation |
| Nano Banana | `nano-banana` | \$0.02 | Fast, budget-friendly |
| Grok Imagine | `grok-imagine` | \$0.02 | xAI's budget tier |
| Qwen Image 2512 | `qwen-image-2512` | \$0.02 | Budget generation |
| Runway Gen-4 Image Turbo | `runway-gen4-image-turbo` | \$0.02 | Fast editing (`image_edit` modality) |
| FLUX.2 Klein | `flux-2-klein` | \$0.014 | Fastest, batch work |
| Z-Image Turbo | `z-image-turbo` | \$0.01 | Cheapest servable model |
## In code
```typescript TypeScript SDK theme={null}
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const image = await client.images.generate({
model: "flux-2-klein",
prompt: "A mountain landscape at sunset",
size: "1920x1920",
});
console.log(image.data[0].url);
```
```python Python SDK theme={null}
import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
image = client.images.generate(
model="flux-2-klein",
prompt="A mountain landscape at sunset",
size="1920x1920",
)
print(image["data"][0]["url"])
```
Try prompts live in the [Playground](https://www.ninjachat.ai/developers/playground) — every run shows the exact request. Or let an agent drive: the [MCP server](/mcp/overview) gives any connected client these same models conversationally.
# NinjaChat Developers
Source: https://docs.ninjachat.ai/index
Every model, two ways in — a REST API for your code, an MCP server for your agent.
NinjaChat API
One API. Every model.
Chat, images, video, and search through one typed API.
# Billing & limits
Source: https://docs.ninjachat.ai/mcp/billing
Pass-through prices, hard budgets, automatic refunds.
MCP spend comes out of your **Developer Balance** — shared with the REST API, separate from consumer subscription credits. Top up at [Developers → Billing](https://www.ninjachat.ai/developers/billing), or let the agent do it: `add_credits` returns a Stripe `checkout_url` right in the conversation.
Browsing is free — connect and ask questions without a balance. Your first paid action can unlock **\$0.50 starter balance** with a quick phone verify, and NinjaChat subscribers get **\$1.00 of MCP allowance every month**. The allowance is granted lazily — the first time a charge would otherwise fail, or when `get_account_balance` is called — to accounts on a paid plan (a mobile plan must still be active).
## Prices
Model prices are the providers' own rates, passed through unchanged. NinjaChat's margin is a single **8% service fee added when you fund credits** — \$25 of credit costs \$27 at checkout — never a markup hidden inside a model's price.
| Image model | Per output |
| ------------------------- | -------------- |
| `flux-schnell` | 0.3¢ |
| `z-image-turbo` | 1¢ |
| `nano-banana` | 2¢ |
| `grok-imagine` | 2¢ |
| `runway-gen4-image-turbo` | 2¢ (edit-only) |
| `flux-2-pro` | 3¢ |
| `qwen-image-edit-plus` | 3¢ (edit-only) |
| `seedream` | 4¢ |
| `recraft-v3` | 4¢ |
| `nano-banana-2` | 4.5¢ |
| `nano-banana-pro` | 8¢ |
| `gpt-image-2` | 12.8¢ |
Multiply by `n` for multi-output calls.
| Video model | 4s | 8s (default) | How length is billed |
| ------------------- | ------ | ------------ | --------------------------------------- |
| `seedance-lite` | 14.4¢ | 28.8¢ | 3.6¢/s, capped at 12s |
| `kling-2.5-turbo` | 35¢ | 70¢ | 5s = 35¢ · 10s = 70¢ |
| `runway-gen4.5` | 48¢ | 96¢ | 12¢/s, capped at 10s |
| `seedance-pro` | 60¢ | \$1.20 | 15¢/s, capped at 12s |
| `veo-3.1-fast` | 60¢ | \$1.20 | 4s / 6s / 8s = 60¢ / 90¢ / \$1.20 |
| `google-veo-3-fast` | 60¢ | \$1.20 | 4s / 6s / 8s = 60¢ / 90¢ / \$1.20 |
| `kling-video` | 70¢ | \$1.40 | 5s = 70¢ · 10s = \$1.40 |
| `seedance-2` | \$1.21 | \$2.42 | 30.3¢/s, capped at 12s |
| `veo-3.1` | \$1.60 | \$3.20 | 4s / 6s / 8s = \$1.60 / \$2.40 / \$3.20 |
| `google-veo-2` | \$2.50 | \$4.00 | 5s / 6s / 8s = \$2.50 / \$3.00 / \$4.00 |
Every video model has its own duration curve. Per-second models (`seedance-lite`, `seedance-pro`, `seedance-2`, `runway-gen4.5`) bill each second up to their cap; bucketed models (Veo, Kling) bill the nearest supported length — 7 seconds on `veo-3.1-fast` costs the 6-second price, 8 seconds on `kling-video` the 10-second price. Any `duration` from 4 to 15 is accepted, but seconds past a model's cap are billed at the cap. `estimate_cost` is free and returns the exact price before anything runs — pass `duration` for video.
## Money is safe by design
`max_spend_cents` (1–2000) on any call, `total_budget_cents` (5–100) on bakeoffs — tools return `budget_too_low` instead of exceeding them, before any money moves.
Image and bakeoff failures refund inline. A video job that fails after being charged is refunded when polled — and a server-side sweeper checks every minute even if nobody polls. You never pay for output you didn't get.
Pass an `idempotency_key` — the same key + body never double-bills.
Set an account cap in [Developers → Billing](https://www.ninjachat.ai/developers/billing) — the OAuth consent screen also sets one the first time an agent connects. It's reserved *before* deduction — an over-limit call never touches your balance.
### What a charge actually does
Every billed call runs the same sequence: idempotency claim → `max_spend_cents` gate → account monthly-limit reserve → per-key budget reserve → deduct → generate → settle against the model that actually ran → store the response for replay. If generation fails, the refund lands *before* the error tells you that you weren't charged, and every reservation is released in reverse order.
* **Settlement is exact.** `auto` may reroute to another model when a provider fails; the charge is adjusted to that model's price, and `cost.charged_cents` in the response is what you actually paid.
* **Two spend caps.** `spend_limit_exceeded` is the account cap from Developers → Billing. `key_budget_exceeded` is a per-key monthly budget (Developers → Keys → Manage) that applies to API-key callers and covers everything the key does, REST and MCP alike. Both errors return the limit and this month's spend; neither touches your balance.
* **Empty balance.** `insufficient_credits` returns `balance_cents`, `estimated_cost_cents` and `top_up_url`. The fix is `add_credits`, then retry.
### Idempotency
* Keys are scoped to your account and bound to a hash of the billable inputs (prompt, model, count, aspect ratio, references, duration…). They live for 1 hour.
* Same key, same body → the stored response is replayed, images re-rendered inline, nothing charged.
* Same key, different body → `idempotency_conflict`. Use a fresh key for new content.
* Same key while the first attempt is still running → `generation_pending` with `retry_after_seconds: 10`.
* A failed generation releases the key, so a retry with the same key runs (and is charged) once more.
* If the idempotency store is unreachable the call fails closed with `idempotency_unavailable` — no work is started, nothing is charged; retry in a few seconds with the **same** key.
### Refunds
| Code | Meaning |
| ------------------------------------- | ---------------------------------------------------------------------------- |
| `generation_failed_refunded` | Failed and refunded — retry freely |
| `generation_failed_refund_pending` | Failed; the refund is recorded and retried automatically |
| `generation_failed_refund_unrecorded` | Failed and the refund couldn't be recorded — contact support before retrying |
Video jobs carry the exact settled charge, so an async refund always returns what was actually paid. `get_generation_status` on a refunded job keeps reporting the failure — a refunded job never later serves a video.
## Topping up
* **`add_credits`** mints a Stripe Checkout link for a **\$25** (default), **\$100** or **\$250** pack — the agent pastes `checkout_url`, the user pays, the agent retries. The [Billing page](https://www.ninjachat.ai/developers/billing) is the fallback and also takes custom whole-dollar amounts.
* **Auto-reload is opt-in** and only ever switched on from the Billing page — buying a pack never enables it. Once on, it defaults to adding **\$100 when the balance falls below \$10** (both adjustable).
* Every purchase carries the 8% service fee: `add_credits` with `amount_usd: 25` charges \$27 and credits \$25.
## Rate limits
Counted per API key — or, for OAuth clients, per client + user — so one busy agent can't starve another. Per minute unless noted:
| Tool class | Limit |
| --------------------------------------------------------------------------------------------- | ---------------- |
| Read (search, estimates, status, balance, saved names) | 60 |
| Image generation (`create_media`, `generate_image`, `edit_image`) | 10 |
| Uploads | 10 |
| Video generation (`generate_video`, `image_to_video`, and `create_media` when it makes video) | 3 |
| Model comparisons | 2 |
| Scroll-cinema encoding (`prepare_scrub_video`) | 3 |
| Page publishing (`publish_page`) | 6 |
| `add_credits` | 6 per 10 minutes |
Limited calls return `rate_limited` with `retry_after_seconds` — agents wait and retry.
## Agents
Every MCP client — Cursor, Claude Code, Codex, VS Code, claude.ai, ChatGPT, Hermes, OpenClaw, and anything else on the same server — draws from the same Developer Balance and the same monthly limit. Rate limits are counted per connected client. Review or disconnect anytime in [Developers → Agents](https://www.ninjachat.ai/developers/agents).
# Client setup
Source: https://docs.ninjachat.ai/mcp/clients
One endpoint, eight clients. Pick yours.
Every client uses the same URL:
```text theme={null}
https://www.ninjachat.ai/api/mcp
```
Web clients sign in with OAuth — no key. Editor and CLI clients need an `nj_sk_` key from [Developers → Keys](https://www.ninjachat.ai/developers/keys). MCP calls are billable, so a key marked read-only is rejected — mint a full-access key.
**Settings → Connectors → Add custom connector.** Name it `NinjaChat`, paste the URL, sign in when prompted. No API key.
**Settings → Connectors → Advanced → enable developer mode.** Then **Create** a connector, name it `NinjaChat`, paste the URL, and approve the OAuth sign-in. Enable it in the composer.
```json ~/.cursor/mcp.json theme={null}
{
"mcpServers": {
"ninjachat": {
"url": "https://www.ninjachat.ai/api/mcp",
"headers": {
"Authorization": "Bearer nj_sk_YOUR_KEY"
}
}
}
}
```
**Cursor Settings → MCP** should show `ninjachat` with a green dot. If not, reload the window.
```bash theme={null}
claude mcp add --transport http ninjachat https://www.ninjachat.ai/api/mcp \
--header "Authorization: Bearer nj_sk_YOUR_KEY"
```
Verify with `/mcp`. Add `--scope user` to use it in every project.
Listed as failed? Use `--transport http` (not `sse`) and keep the whole `"Authorization: Bearer …"` string as one shell argument.
```toml ~/.codex/config.toml theme={null}
[mcp_servers.ninjachat]
url = "https://www.ninjachat.ai/api/mcp"
http_headers = { "Authorization" = "Bearer nj_sk_YOUR_KEY" }
```
Restart the session — config loads at launch.
TOML is picky: `[mcp_servers.ninjachat]` with an underscore, and `http_headers` as an inline table.
```json .vscode/mcp.json theme={null}
{
"servers": {
"ninjachat": {
"type": "http",
"url": "https://www.ninjachat.ai/api/mcp",
"headers": {
"Authorization": "Bearer nj_sk_YOUR_KEY"
}
}
}
}
```
Click the **Start** code lens above the entry, then use it in Copilot Chat's agent mode.
```yaml ~/.hermes/config.yaml theme={null}
mcp_servers:
ninjachat:
url: "https://www.ninjachat.ai/api/mcp"
headers:
Authorization: "Bearer nj_sk_YOUR_KEY"
enabled: true
```
Start a new session — the dashboard's MCP panel shows the connection.
```bash theme={null}
openclaw mcp add ninjachat \
--url https://www.ninjachat.ai/api/mcp \
--transport streamable-http \
--header "Authorization: Bearer nj_sk_YOUR_KEY"
```
Restart the gateway to load it.
Review or disconnect OAuth agents anytime in [Developers → Agents](https://www.ninjachat.ai/developers/agents).
## Building your own OAuth client
NinjaChat is a full OAuth 2.1 authorization server, so any MCP client that speaks the standard flow connects without an API key:
* **Discovery.** An unauthenticated request to the endpoint returns `401` with a `WWW-Authenticate` challenge pointing at `https://www.ninjachat.ai/.well-known/oauth-protected-resource/api/mcp`; the authorization-server metadata is at `https://www.ninjachat.ai/.well-known/oauth-authorization-server`.
* **Registration.** Open Dynamic Client Registration at `https://www.ninjachat.ai/api/oauth/register`. Clients are public — there is no client secret — and the `redirect_uri` you authorize with must be one you registered. A client unused for 90 days is garbage-collected.
* **Authorization.** `https://www.ninjachat.ai/oauth/authorize` with `code_challenge_method=S256`. PKCE is mandatory and `plain` is rejected; authorization codes expire after 60 seconds. The only scope is `mcp`.
* **Tokens.** `https://www.ninjachat.ai/api/oauth/token` supports `authorization_code` and `refresh_token`. Access tokens (`nj_at_…`) last **1 hour**; refresh tokens (`nj_rt_…`) last **30 days** and **rotate on every use** — replaying a rotated refresh token revokes the whole token family. Revoke either token at `https://www.ninjachat.ai/api/oauth/revoke`.
## Test it
Free, and proves auth end to end:
```text theme={null}
Use NinjaChat to check my balance.
```
Then make something:
```text theme={null}
Use NinjaChat to generate a poster of a neon koi fish,
comparing 3 models under $0.25.
```
Treat `nj_sk_` keys like passwords — prefer user-level config over committed files, and revoke anything that leaks.
# NinjaChat MCP
Source: https://docs.ninjachat.ai/mcp/overview
Your agent can make images and video. Connect once, then just ask.
Connect any MCP client to NinjaChat — Cursor, Claude Code, Codex, VS Code, claude.ai, ChatGPT, Hermes, OpenClaw, or anything that speaks the protocol — and it can create real images and video mid-conversation. One URL:
```text theme={null}
https://www.ninjachat.ai/api/mcp
```
## What it feels like
> "Give me 4 takes on a lighthouse in a storm."
> "I like the second one — make it a video."
## Connect in one minute
Paste the URL, sign in once. No API key.
One config snippet with your `nj_sk_` key — Codex, VS Code, Hermes, OpenClaw, and any other client.
## Prices you can say out loud
Images **\$0.003–\$0.128** · video **\$0.14–\$4.00** by model and length · questions, searches, and estimates **free**. Model prices are the providers' own, passed through; the only margin is an 8% service fee when you fund credits. Failed jobs refund themselves. [Billing →](/mcp/billing)
## Go deeper
One front-door tool, 17 specialists — 18 in all
Websites, campaigns, product shots
Balance, limits, refunds
# MCP quickstart
Source: https://docs.ninjachat.ai/mcp/quickstart
Connect an agent and make your first image in under a minute.
**Settings → Connectors → Add custom connector**. Name it `NinjaChat`, paste:
```text theme={null}
https://www.ninjachat.ai/api/mcp
```
Claude opens NinjaChat's sign-in. Approve — done forever.
```text theme={null}
Use NinjaChat to create four campaign directions for a
futuristic sneaker, then animate the strongest one.
```
Grab an `nj_sk_` key from [Developers → Keys](https://www.ninjachat.ai/developers/keys).
```bash theme={null}
claude mcp add --transport http ninjachat https://www.ninjachat.ai/api/mcp \
--header "Authorization: Bearer nj_sk_YOUR_KEY"
```
```text theme={null}
Generate a 16:9 hero image for this landing page
and save it to /public.
```
Every image returns a URL, a ready-to-commit filename, and its MIME type — the agent downloads and places the file itself.
## Then keep talking
Continuity is automatic — no URLs, no IDs, no re-prompting:
| You say | What happens |
| ------------------------ | --------------------------------- |
| "Make it red" | Edits the last result |
| "Animate the second one" | Turns pick #2 into video |
| "More like #3" | New generations in that direction |
Cursor, ChatGPT, Codex, VS Code…
Every tool and parameter
Real multi-step workflows
# Recipes
Source: https://docs.ninjachat.ai/mcp/recipes
Real workflows, no special tools — generate once, then edit and reference.
Everything below composes `create_media`, continuity (`source`), and creative memory (`use`). All images here were made through these exact flows.
## Pick the aspect from the destination
| Going to | Use |
| -------------------------- | -------------- |
| Hero, banner, OG card | `16:9` |
| TikTok, Reels, Story | `9:16` |
| Post, avatar, product tile | `1:1` |
| Poster, portrait | `2:3` or `3:4` |
## Campaign
One product reference keeps the bottle identical across every direction.
> "I'm launching a sparkling yuzu drink called KIYO — give me 4 campaign directions."
> "The second one. Make it a wide banner."
1. Lock the product: `upload_asset` or `reference_image_urls`, "keep packaging unchanged"
2. Four directions: `create_media` `action: "options"` with `max_spend_cents`
3. Winner → placements via edits of the keeper
4. Animate the strongest with `image_to_video`
## Website
1. Brief → `options` → user picks a direction
2. Hero at `16:9`, continuing from the pick (`source: "2"`)
3. Supporting shots via `source` so the look stays coherent
4. Files land by `filename` — the agent downloads and commits
## Product photography
1. Reference the exact product → `save_creation_as` `{type: "product"}`
2. Studio / editorial / lifestyle / outdoor variants with `use: [""]`
## Motion
Reference-locked keyframes first, then film.
The one rule: **generate once, then edit and reference.** Continuing from a keeper is cheaper and more consistent than re-prompting from zero.
# Tool reference
Source: https://docs.ninjachat.ai/mcp/tools
One front-door tool does almost everything. Seventeen specialists for fine control.
## create\_media — the front door
Say what you want. NinjaChat classifies it (make / edit / animate / options), picks the model, and stays inside your budget.
```json theme={null}
{
"brief": "hero shot of a matte-black espresso machine, dramatic light",
"quality": "balanced",
"aspect_ratio": "16:9"
}
```
| Parameter | Default | Description |
| ---------------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| `brief` | — | **Required.** What you want, in plain language (1–4,000 chars) |
| `quality` | `fast` | `fast` · `balanced` · `best` — no model names needed. `fast` keeps the first picture cheap and immediate |
| `aspect_ratio` | `1:1` | `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` — video collapses to `16:9` or `9:16` |
| `count` | `1` | 1–4 outputs, each billed |
| `max_spend_cents` | — | Hard budget, integer 1–2000. With `quality: "best"`: the best model that fits under it |
| `action` | `auto` | Force `make` / `edit` / `animate` / `options` |
| `source` | — | Continue from a previous result ↓ (≤200 chars) |
| `reference_image_urls` | — | Up to 14 public HTTPS URLs. Text-to-video keeps the first 4; `animate` uses only the `source` |
| `use` | — | Up to 3 saved characters/products/styles ↓ |
| `duration` | `8` | 4–15 seconds — video only |
| `idempotency_key` | — | ≤128 chars; same key + body never double-bills |
What `quality` does underneath: for images it biases the auto-router (`fast` → speed, `best` → quality); for `options` it picks the model spread and the default budget (12¢ / 30¢ / 45¢ when `max_spend_cents` is omitted, always clamped to 5–100¢); for video it picks `google-veo-3-fast` / auto / `veo-3.1`.
## Continuity — say it like a person
The server remembers recent results, so nobody re-pastes URLs:
| `source` | Means |
| -------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `"last"` (also `"latest"`, `"it"`, `"this"`) | The newest output |
| `"2"` | Pick #2 from the last numbered gallery |
| a generation ID (`img_…`, `cmp_…`, `vid_…`) | Any past creation — older than the recent window, it's looked up in your durable history |
| an `https://` URL | Passed through as-is |
Recents are kept per user **and** per client for 24 hours — a Cursor session doesn't see what Claude Code made an hour ago, but generation IDs always resolve.
> "Give me 4 directions for the game world."
> "Now a courier character in the style of the second one."
## Creative memory — survives sessions
Name a keeper once, reuse it forever:
```json theme={null}
{ "tool": "save_creation_as", "name": "Maya", "type": "character", "source": "2" }
```
Then `use: ["Maya"]` on any creation tool applies her reference images automatically. Types: `project` · `character` · `product` · `style`. Saving the same name again adds another reference (each name keeps up to 8; the oldest rotates out). Forgot the name? `list_creative_entities`.
## Ship-ready outputs
Every image returns three fields — download, commit, done:
```json theme={null}
{ "url": "https://cdn...", "filename": "espresso-hero-1.webp", "mime": "image/webp" }
```
## All 18 tools
| Tool | Cost | One-liner |
| ------------------------ | ------ | ----------------------------------------------------------------------------------------------- |
| `create_media` | billed | Anything media — the default |
| `generate_image` | billed | Images with a specific model |
| `edit_image` | billed | Recolor, restyle, inpaint |
| `generate_video` | billed | Text → video |
| `image_to_video` | billed | Still → motion |
| `compare_models` | billed | One prompt, 2–6 models, strict budget |
| `upload_asset` | free | Push a local file up for edits/video |
| `save_creation_as` | free | Name a keeper |
| `list_creative_entities` | free | List saved names |
| `search_creations` | free | Search everything ever made |
| `get_creation` | free | One past creation, full metadata |
| `get_generation_status` | free | Poll a video job |
| `search_models` | free | Find models by task/style/price |
| `estimate_cost` | free | Exact price before running |
| `prepare_scrub_video` | free | Turn a finished video into a scroll-cinema kit — scrub-optimized MP4s, posters, boundary frames |
| `publish_page` | free | Publish a complete HTML page live to your ninja.site subdomain |
| `get_account_balance` | free | Balance + limit headroom |
| `add_credits` | free | Mint a Stripe Checkout link for \$25 / \$100 / \$250 (never enables auto-reload) |
Every tool answers with JSON — `{ "ok": true, … }` or `{ "ok": false, "error": { "code", "message", "recoverable", "next_steps", … } }` — so the agent can read and recover from the payload. The one exception is argument validation: a missing or out-of-range parameter is rejected before the tool runs, as a plain-text result flagged `isError: true` (`Input validation error: Invalid arguments for tool …`) rather than the JSON envelope. Nothing is charged either way.
## Specialist parameters
| Parameter | Default | Description |
| ---------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `prompt` | — | **Required.** 1–4,000 chars |
| `model` | `auto` | Slug from `search_models`, or `auto` |
| `n` | `1` | 1–4 outputs, each billed |
| `aspect_ratio` | `1:1` | Same enum as `create_media` |
| `reference_image_urls` | — | Up to 14 public HTTPS URLs. Each model's own ceiling is `max_references` in `search_models` — past it you get `too_many_references` |
| `source` | — | Continuity (≤200 chars). `edit_image` needs a `source`, a reference URL, or a `use` entity |
| `use` | — | Up to 3 saved entities |
| `quality_vs_speed` | `balanced` | `quality` · `balanced` · `speed` — biases `auto` only: `speed` steers to `nano-banana`, `quality` to `nano-banana-pro` |
| `max_spend_cents` | — | Integer 1–2000; returns `budget_too_low` instead of exceeding it |
| `idempotency_key` | — | ≤128 chars; same key + body never double-bills |
An explicit `model` is a contract — no silent substitution. `auto` may reroute to a compatible model if a provider fails, and the charge settles on the model that ran. Edit-only models (`runway-gen4-image-turbo`, `qwen-image-edit-plus`) return `model_requires_reference` without a reference.
| Parameter | Default | Description |
| ---------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt` | — | **Required.** What the video shows (1–4,000 chars) |
| `model` | `auto` | Video slug or `auto` |
| `duration` | `8` | 4–15 seconds — billed on each model's own curve, see [Billing](/mcp/billing) |
| `aspect_ratio` | `16:9` | `16:9` or `9:16` |
| `reference_image_urls` | — | Up to 4 public HTTPS URLs for subject/style consistency |
| `use` | — | Up to 3 saved entities (they share the 4-reference ceiling) |
| `generate_audio` | `false` | Audio track — honored by `seedance-2` and `kling-video`; other models ignore it |
| `max_spend_cents` | — | Integer 1–2000 |
| `idempotency_key` | — | ≤128 chars |
| `image_url` | — | `image_to_video` only — public HTTPS URL of the still to animate |
| `source` | — | `image_to_video` only — animate a previous result instead of passing `image_url` |
| `end_image_url` | — | `image_to_video` only — lock the final frame. Requires `image_url`; works on `seedance-pro` (what `auto` picks for it) or `kling-2.5-turbo`, `invalid_model` on anything else |
Video is async: the call returns a `generation_id` and `eta_seconds`, and the agent polls `get_generation_status` (\~15s apart). Render time depends on the model — from 20–90 seconds on `seedance-lite` to 2–6 minutes on `kling-video`; `search_models` lists each model's `eta_seconds`. Failures refund automatically.
| Parameter | Default | Description |
| -------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt` | — | **Required.** The prompt to race (1–4,000 chars) |
| `models` | `z-image-turbo` `nano-banana-2` `seedream` `gpt-image-2` | 2–6 image slugs. Edit-only models are rejected |
| `total_budget_cents` | — | **Required.** Integer 5–100. Models are added cheapest-first until the budget is spent; the rest come back as `skipped`. Fewer than two fit → `budget_too_low` |
| `aspect_ratio` | `1:1` | Same enum as `create_media` |
| `idempotency_key` | — | ≤128 chars |
Results come back numbered in pick order — choose one and continue from it with `source`. A model that fails inside the bakeoff costs nothing; you're charged for the ones that delivered.
| Parameter | Default | Description |
| --------------- | ------- | --------------------------------------------------------------------- |
| `generation_id` | — | **Required.** The `vid_…` id from `generate_video` / `image_to_video` |
Returns `pending` (with `progress_percent` and `eta_seconds`), `succeeded` (with the playable URL), or a refunded failure. Images finish synchronously and never need polling.
`search_creations`:
| Parameter | Default | Description |
| --------- | ------- | ------------------------------------------------ |
| `kind` | `all` | `image` · `video` · `all` |
| `query` | — | Substring match on prompt and model (≤200 chars) |
| `limit` | `20` | 1–50 |
`get_creation`:
| Parameter | Default | Description |
| --------------- | ------- | -------------------------------------------------------------------------- |
| `generation_id` | — | **Required.** Any id from a generation or `search_creations` (1–200 chars) |
`save_creation_as`:
| Parameter | Default | Description |
| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------ |
| `name` | — | **Required.** 1–80 chars — the name you'll reuse |
| `type` | — | **Required.** `project` · `character` · `product` · `style` |
| `source` | `last` | Which image to save: `last`, an output number, or a generation id. Videos can't be saved — save the still they came from |
| `description` | — | Optional note (≤500 chars) |
`list_creative_entities`:
| Parameter | Default | Description |
| --------- | ------- | ---------------------------------- |
| `type` | — | Optional filter to one entity type |
`search_models`:
| Parameter | Default | Description |
| ------------------ | ------- | ---------------------------------------------------------- |
| `kind` | — | `image` or `video` |
| `query` | — | Free-text match on name and strengths (≤200 chars) |
| `max_price_cents` | — | Integer ≥1 — only models at or under this per-output price |
| `needs_references` | — | `true` → only image models that accept reference images |
Each result carries `price_cents` (image: per output; video: the 4-second "from" price). Video results also carry `price_cents_at_default_duration` and `default_duration_seconds` (8) — the amount you are billed when you accept the tool defaults — plus `eta_seconds`.
`estimate_cost`:
| Parameter | Default | Description |
| -------------------- | ------- | ------------------------------------------------------------------------------------------------------ |
| `tool` | — | **Required.** `generate_image` · `edit_image` · `generate_video` · `image_to_video` · `compare_models` |
| `prompt` | — | Needed when `model` is `auto` (≤4,000 chars) |
| `model` | `auto` | Slug or `auto` — the response names the model `auto` would pick, and why |
| `n` | `1` | 1–4 |
| `duration` | `8` | 4–15 seconds — video tools |
| `models` | — | `compare_models` only, up to 6 |
| `total_budget_cents` | — | `compare_models` only (assumes 25 when omitted) |
| `has_references` | `false` | Tells the router a reference image will be attached |
The estimate also reports `within_balance` and `within_spend_limit`.
| Parameter | Default | Description |
| -------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `content_type` | — | **Required.** `image/png` · `image/jpeg` · `image/webp` · `video/mp4` · `audio/mpeg` · `audio/wav` |
| `size_bytes` | — | **Required.** Exact byte count — the signed URL rejects any other `Content-Length`. Caps: images 25 MiB, MP4 100 MiB, audio 30 MiB |
| `file_name` | — | For your own bookkeeping (≤200 chars); the storage key is server-chosen |
Returns `upload_url` (HTTP PUT, valid for 10 minutes) and the permanent `public_url` to pass as a reference.
`prepare_scrub_video` — pass one of:
| Parameter | Default | Description |
| --------------- | ------- | --------------------------------------------------------------------------- |
| `generation_id` | — | A **completed** `vid_…` generation (`generation_pending` until it is) |
| `video_url` | — | A NinjaChat generation URL or an `upload_asset` `public_url` (≤2,000 chars) |
`publish_page`:
| Parameter | Default | Description |
| --------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
| `title` | — | **Required.** 1–120 chars |
| `html` | — | **Required.** Complete self-contained document, up to 400,000 chars |
| `slug` | — | 3–32 chars (`a-z`, `0-9`, hyphens). Reuse a slug you own to update that page in place; omit for a generated name |
| `site_username` | — | Claim a ninja.site handle on first publish (3–20 chars). Ignored once the account has one — handles are permanent |
`add_credits`:
| Parameter | Default | Description |
| ------------ | ------- | ----------------------------------------------- |
| `amount_usd` | `25` | `25` · `100` · `250` — nothing else is accepted |
Returns a Stripe `checkout_url` for the user to open. It never turns auto-reload on.
`get_account_balance` takes no parameters and returns the balance, what it buys, this month's spend against your limit, and the subscriber allowance state.
# Model catalog API
Source: https://docs.ninjachat.ai/models
Quick guide to picking the right model for your use case.
**Not sure which model to pick?** Set `model: "ninja/auto"` and NinjaChat chooses from the current catalog. [Learn more about smart routing](/smart-routing)
## Pick a model
Chat bills per token. The rates below are the live **input · output \$/MTok** at the time of writing; see [Pricing](/pricing) for the full sheet and [`GET /api/v1/pricing`](/pricing#live-price-sheet) for a machine-readable copy.
| I want to... | Model | Price | ID |
| -------------------------------------- | --------------------------------------------------------------- | --------------------- | ------------------ |
| Let NinjaChat decide | Ninja Router | resolved model's rate | `ninja/auto` |
| Hardest reasoning and coding | [GPT-5.6 Sol](/api-reference/models/chat/gpt-5-6-sol) | \$4 · \$20 /MTok | `gpt-5.6-sol` |
| Highest-capability long-running agents | [Claude Fable 5](/api-reference/models/chat/claude-fable-5) | \$10 · \$50 /MTok | `claude-fable-5` |
| Build production coding agents | [Claude Sonnet 5](/api-reference/models/chat/claude-sonnet-5) | \$2 · \$10 /MTok | `claude-sonnet-5` |
| Run high-capability agents | [Claude Opus 5](/api-reference/models/chat/claude-opus-5) | \$5 · \$25 /MTok | `claude-opus-5` |
| Fast multimodal work | [Gemini 3.7 Flash](/api-reference/models/chat/gemini-3-7-flash) | \$1.50 · \$7.50 /MTok | `gemini-3.7-flash` |
| Long-context multimodal reasoning | [Gemini 3.1 Pro](/api-reference/models/chat/gemini-3-1-pro) | \$2 · \$12 /MTok | `gemini-3.1-pro` |
| Cost-efficient reasoning | [DeepSeek V4 Pro](/api-reference/models/chat/deepseek-v4-pro) | \$1.74 · \$3.48 /MTok | `deepseek-v4-pro` |
| Low-cost long-context agents | [MiniMax M2.7](/api-reference/models/chat/minimax-m2-7) | \$0.30 · \$1.20 /MTok | `minimax-m2.7` |
| Generate images | [Nano Banana 2](/api-reference/models/image/nano-banana-2) | \$0.045/img | `nano-banana-2` |
| Generate video | [Veo 3.1 Fast](/api-reference/models/video/veo-3-1-fast) | \$1.20/video | `veo-3.1-fast` |
| Search the web | [Web Search](/search) | \$0.05/query | — |
Browse all models with full specs, context windows, and pricing in the [Models tab](/models-overview).
## Fetch models via API
```typescript TypeScript SDK theme={null}
const models = await client.models.list();
const gpt = await client.models.retrieve("gpt-5.6-sol");
```
```python Python SDK theme={null}
models = client.models.list()
gpt = client.models.retrieve("gpt-5.6-sol")
```
```bash cURL theme={null}
curl "https://www.ninjachat.ai/api/v1/models?modality=text&capability=tools"
```
`GET /models` and `GET /models/{id}` are public — no API key needed. Each model carries `id`, `name`, `modality` (`text`, `image`, `image_edit`, `video`), `status`, `servable`, `brand`, `description`, `capabilities`, `contextWindow`, `maxOutputTokens`, `pricing` (`meteredPromptPerToken`, `meteredCachedPromptPerToken`, and `meteredCompletionPerToken` for chat; `perUnitUsd` for media), `providers` (each rail with `role`, `available`, `trainsOnData`, `zeroRetentionAvailable`), `supply` (rail counts and redundancy), and `supportedParameters`. `ninja/auto` additionally reports `virtual: true` and its `router.candidates`.
Filter with query parameters: `modality`, `provider`, `capability`, `availability`, and `virtual=false` to hide the router entry.
# Models
Source: https://docs.ninjachat.ai/models-overview
Choose a model by workload, or let ninja/auto route across the live catalog.
## Choose in 10 seconds
Use `ninja/auto` for a balanced model and healthy provider route without maintaining a catalog in your application.
Start with `gpt-5.6-sol` for difficult coding, analysis, and long-horizon agent work.
Start with `gpt-5.6-luna` or `gemini-3.7-flash` for interactive and high-volume workloads.
Start with `gemini-3.1-pro` or `claude-sonnet-5` for million-token multimodal context and `claude-fable-5` for the longest-running agents.
Start with `deepseek-v4-pro`, `glm-5.2`, or `minimax-m2.7` when unit economics matter.
Browse image editing and generation, or jump to asynchronous video models.
Query `client.models.list()` or `GET /models` at runtime. The response is the source of truth for servability, pricing, context, capabilities, supported parameters, and provider availability.
## Frontier models
These are the headline model families surfaced by NinjaChat. Pin a model when behavior matters; use `ninja/auto` when availability and operating simplicity matter more than a specific family.
Prices are live **input · output \$/MTok** from `GET /models/{id}` at the time of writing.
| Model | ID | \$/MTok | Best for |
| :---------------------------------------------------------------- | :------------------ | :-------------- | :----------------------------------------------------------- |
| [GPT-5.6 Sol](/api-reference/models/chat/gpt-5-6-sol) | `gpt-5.6-sol` | \$4 · \$20 | Hardest reasoning, coding, and long-horizon agents |
| [GPT-5.6 Terra](/api-reference/models/chat/gpt-5-6-terra) | `gpt-5.6-terra` | \$2 · \$12 | Balanced frontier agents and professional work |
| [GPT-5.6 Luna](/api-reference/models/chat/gpt-5-6-luna) | `gpt-5.6-luna` | \$0.20 · \$1.20 | Fast, high-volume multimodal agents |
| [GPT-5.5 Pro](/api-reference/models/chat/gpt-5-5-pro) | `gpt-5.5-pro` | \$30 · \$180 | Maximum-effort reasoning when cost is secondary |
| [Claude Fable 5](/api-reference/models/chat/claude-fable-5) | `claude-fable-5` | \$10 · \$50 | Anthropic's highest-capability model for long-running agents |
| [Claude Opus 5](/api-reference/models/chat/claude-opus-5) | `claude-opus-5` | \$5 · \$25 | Complex agents, refactors, and knowledge work |
| [Claude Sonnet 5](/api-reference/models/chat/claude-sonnet-5) | `claude-sonnet-5` | \$2 · \$10 | Agentic coding and enterprise workflows |
| [Claude Opus 4.8](/api-reference/models/chat/claude-opus-4-8) | `claude-opus-4.8` | \$5 · \$25 | Deep reasoning and visual analysis |
| [Gemini 3.7 Flash](/api-reference/models/chat/gemini-3-7-flash) | `gemini-3.7-flash` | \$1.50 · \$7.50 | Fast multimodal and high-volume execution |
| [Gemini 3.1 Pro](/api-reference/models/chat/gemini-3-1-pro) | `gemini-3.1-pro` | \$2 · \$12 | Million-token multimodal reasoning |
| [Grok 4.6](/api-reference/models/chat/grok-4-6) | `grok-4.6` | \$2 · \$6 | Reasoning, current knowledge, and tools |
| [DeepSeek V4 Pro](/api-reference/models/chat/deepseek-v4-pro) | `deepseek-v4-pro` | \$1.74 · \$3.48 | Cost-efficient code and reasoning |
| [DeepSeek V4 Flash](/api-reference/models/chat/deepseek-v4-flash) | `deepseek-v4-flash` | \$0.14 · \$0.28 | Cheapest million-token context |
| [GLM 5.2](/api-reference/models/chat/glm-5-2) | `glm-5.2` | \$1.40 · \$4.40 | Agentic engineering and tool use |
| [MiniMax M2.7](/api-reference/models/chat/minimax-m2-7) | `minimax-m2.7` | \$0.30 · \$1.20 | Low-cost long-context agents |
| [Qwen3 Coder Next](/api-reference/models/chat/qwen3-coder-next) | `qwen3-coder-next` | \$0.20 · \$1.50 | Budget coding agents |
```typescript TypeScript SDK theme={null}
const catalog = await client.models.list();
const available = catalog.data.filter((model) => model.servable);
```
```python Python SDK theme={null}
catalog = client.models.list()
available = [model for model in catalog["data"] if model["servable"]]
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/models
```
## Image Models
| Model | ID | Best for |
| :--------------------------------------------------------------- | :----------------- | :------------------------------------------ |
| [GPT Image 2](/api-reference/models/image/gpt-image-2) | `gpt-image-2` | High-fidelity generation and text rendering |
| [FLUX Kontext Max](/api-reference/models/image/flux-kontext-max) | `flux-kontext-max` | Premium instruction-led edits |
| [Nano Banana Pro](/api-reference/models/image/nano-banana-pro) | `nano-banana-pro` | Fast, polished multimodal edits |
| [FLUX.2 Flex](/api-reference/models/image/flux-2-flex) | `flux-2-flex` | Flexible style and composition control |
| [Recraft V3](/api-reference/models/image/recraft-v3) | `recraft-v3` | Design assets, illustration, and brand work |
| [Google Imagen 4](/api-reference/models/image/google-imagen-4) | `google-imagen-4` | Photorealistic generation |
| [Seedream](/api-reference/models/image/seedream) | `seedream` | General creative generation |
| [Nano Banana 2](/api-reference/models/image/nano-banana-2) | `nano-banana-2` | Fast everyday generation and editing |
| [FLUX.2 Klein](/api-reference/models/image/flux-2-klein) | `flux-2-klein` | Low-latency image workflows |
[See every image model →](/image-generation)
## Video Models
| Model | ID | Best for |
| :------------------------------------------------------- | :------------- | :------------------------------------ |
| [Veo 3.1](/api-reference/models/video/veo-3-1) | `veo-3.1` | Highest-quality cinematic generation |
| [Veo 3.1 Fast](/api-reference/models/video/veo-3-1-fast) | `veo-3.1-fast` | Faster Veo iteration |
| [Seedance 2](/api-reference/models/video/seedance-2) | `seedance-2` | Motion, style, and longer clips |
| [Kling Video](/api-reference/models/video/kling-video) | `kling-video` | Character and camera-motion workflows |
| [Google Veo 2](/api-reference/models/video/google-veo-2) | `google-veo-2` | Stable legacy Veo workloads |
[See the async video workflow →](/video-generation)
## Smart Routing
| ID | Strategy | Billed at |
| :---------------------------- | :--------------------------------------------------------- | :----------------------------- |
| `ninja/auto` | Choose an eligible model, then route to a healthy provider | Resolved model and rail's rate |
| `routing.strategy: "latency"` | Prefer the fastest eligible rail | Resolved rail's rate |
| `routing.strategy: "cost"` | Prefer the least expensive eligible rail | Resolved rail's rate |
| `routing.strategy: "quality"` | Prefer the highest-quality eligible rail | Resolved rail's rate |
| `models: [...]` | Ordered model fallbacks | Successful execution only |
[How smart routing works](/smart-routing)
# Observability
Source: https://docs.ninjachat.ai/observability
Connect request IDs, routing traces, usage, balance, health, and signed webhooks into one operating loop.
Every generated response includes a `request_id`. Treat it as the join key between your application logs, NinjaChat usage, and the provider route that served the request.
## What to record
| Signal | Source | Keep it for |
| ----------------------- | ----------------------------- | ----------------------------------------------- |
| `request_id` | Every response and error | Support, incident correlation, and trace lookup |
| `model` and `provider` | Response or request trace | Route attribution and provider regressions |
| `cost_usd` | Successful generated response | Per-feature and per-customer spend |
| latency and TTFB | `GET /requests/{id}` | Streaming and generation SLOs |
| status and `error_code` | Error plus request trace | Alert grouping and retry analysis |
| balance | `GET /balance` | Low-credit protection |
Do not log prompts, response bodies, API keys, or webhook signing secrets by default.
## Trace one request
Store the response `request_id`, then retrieve the normalized trace when you need routing detail.
```typescript TypeScript theme={null}
const response = await client.responses.create({
model: "ninja/auto",
input: "Summarize this incident report.",
});
const trace = await client.requests.get(response.request_id);
logger.info("ai.request", {
requestId: trace.request_id,
model: trace.model,
provider: trace.provider,
latencyMs: trace.latency_ms,
ttfbMs: trace.ttfb_ms,
retries: trace.retries,
costCents: trace.cost_cents,
statusCode: trace.status_code,
});
```
```python Python theme={null}
response = client.responses.create(
model="ninja/auto",
input="Summarize this incident report.",
)
trace = client.requests.get(response["request_id"])
logger.info("ai.request", extra={
"request_id": trace["request_id"],
"model": trace["model"],
"provider": trace["provider"],
"latency_ms": trace["latency_ms"],
"ttfb_ms": trace["ttfb_ms"],
"retries": trace["retries"],
"cost_cents": trace["cost_cents"],
"status_code": trace["status_code"],
})
```
The trace also contains the requested candidates, routing policy, excluded rails, each attempt, and the final `served_by` route. Use it for debugging; use aggregated usage for dashboards.
## Build the operating loop
Add `request_id` to the same structured log or trace span as your user action or background job.
Query `client.usage("1d" | "7d" | "30d")` for requests, spend, per-model latency, and endpoint volume.
Query `client.balance()` and subscribe to `balance.low` so a prepaid balance does not surprise production traffic.
Register signed webhooks for video and pipeline completion, failed jobs, project-budget thresholds, and low balance.
```typescript TypeScript theme={null}
const [usage, balance, health] = await Promise.all([
client.usage("7d"),
client.balance(),
client.health(),
]);
console.log(usage.total_requests, usage.total_cost, usage.by_model);
console.log(balance.balance, balance.currency);
console.log(health);
```
## Health and alerting
`client.health()` reads the public gateway-health endpoint. It is appropriate for an external availability check, but it does not replace a real request canary.
Use two checks:
* Poll `client.health()` (or `GET /api/v1/health` without an SDK) for gateway reachability.
* Run a small authenticated generation against your normal model policy on a slower cadence to verify auth, balance, routing, and provider execution together.
Alert on customer impact: elevated `5xx`, repeated `429`, latency or TTFB regression, fallback exhaustion, low balance, and webhook delivery failures. Do not page on one provider rail if fallbacks are still serving traffic successfully.
## Webhook events and delivery
| Event | Fires when |
| -------------------- | ----------------------------------------------------------- |
| `video.completed` | An async video job finished and its `video_url` is ready |
| `video.failed` | A video job failed (the charge is refunded) |
| `pipeline.completed` | A `/pipelines` job finished |
| `pipeline.failed` | A pipeline failed |
| `budget.alert` | A project spend limit crossed 50%, 80%, or 100% |
| `balance.low` | Your prepaid balance dropped below \$5, and again below \$1 |
Each account can register up to **5** endpoints. URLs must be `https` on a public host. Omit `events` when creating an endpoint to subscribe to all six. Register in [Developers → Webhooks](https://www.ninjachat.ai/developers/webhooks) or via `POST /webhooks`.
Every delivery is a `POST` with `Content-Type: application/json` and this body:
```json theme={null}
{
"id": "6f1c…",
"event": "video.completed",
"created": 1787529600,
"data": { "request_id": "req_…", "...": "event-specific fields" }
}
```
| Header | Value |
| ------------------- | ---------------------------------------------------------------------------------- |
| `X-Ninja-Signature` | Hex HMAC-SHA256 of `"${timestamp}.${rawBody}"` using the endpoint's signing secret |
| `X-Ninja-Timestamp` | Unix seconds when the delivery was signed |
| `X-Ninja-Event` | The event name |
Delivery is at-least-once. A non-2xx response or a 10-second timeout is retried with backoff of 1 minute, 5 minutes, 15 minutes, 1 hour, then 6 hours — **6 attempts** in total — after which the delivery is marked `dead`. `GET /webhooks/deliveries` lists the last 30 days with each row's `status` (`pending`, `retrying`, `delivered`, `dead`), `attempts`, `last_error`, and `request_id`.
## Verify signed webhooks
Verify the raw request body before parsing JSON. The SDK rejects invalid signatures and timestamps older than five minutes by default.
```typescript TypeScript theme={null}
import { verifyWebhookSignature } from "@ninjachat/sdk";
const rawBody = await request.text();
const valid = await verifyWebhookSignature(
rawBody,
request.headers.get("x-ninja-signature") ?? "",
request.headers.get("x-ninja-timestamp") ?? "",
process.env.NINJACHAT_WEBHOOK_SECRET!,
);
if (!valid) return new Response("Invalid signature", { status: 401 });
const event = JSON.parse(rawBody);
```
```python Python theme={null}
from ninjachat import verify_webhook_signature
raw_body = request.get_data()
valid = verify_webhook_signature(
raw_body,
request.headers.get("X-Ninja-Signature", ""),
request.headers.get("X-Ninja-Timestamp", ""),
os.environ["NINJACHAT_WEBHOOK_SECRET"],
)
if not valid:
abort(401)
event = request.get_json()
```
After creating an endpoint, call `client.webhooks.test(endpoint.id)` and inspect `client.webhooks.listDeliveries({ endpointId: endpoint.id })` before relying on live events. In Python, use `client.webhooks.list_deliveries(endpoint_id=endpoint["id"])`.
## Useful links
Full trace response and routing-attempt schema.
Periods, model aggregation, latency, and cost fields.
Endpoint creation, event types, deliveries, and test sends.
Typed errors, retry behavior, and support correlation.
# OpenAI compatibility
Source: https://docs.ninjachat.ai/openai-compatibility
Use the official OpenAI SDKs with NinjaChat — just change the base URL and API key.
NinjaChat exposes an OpenAI-compatible `/chat/completions` endpoint. Point any
OpenAI SDK at NinjaChat by setting two things:
* **Base URL:** `https://www.ninjachat.ai/api/v1`
* **API key:** your `nj_sk_...` key
Everything else — request shape, streaming, tool calls, and error format — matches the OpenAI API.
Starting a new integration? The [official NinjaChat SDKs](/sdks) add typed routing, images, video polling, usage, request traces, and webhook helpers. Keep the OpenAI SDK when you want the smallest possible migration.
```python Python theme={null}
from openai import OpenAI
client = OpenAI(
base_url="https://www.ninjachat.ai/api/v1",
api_key="nj_sk_YOUR_API_KEY",
)
resp = client.chat.completions.create(
model="gpt-5.6-luna",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)
```
```javascript Node.js theme={null}
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://www.ninjachat.ai/api/v1",
apiKey: "nj_sk_YOUR_API_KEY",
});
const resp = await client.chat.completions.create({
model: "gpt-5.6-luna",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);
```
### Env-var setup
The OpenAI SDKs also pick up `OPENAI_API_KEY` and `OPENAI_BASE_URL` from the
environment, so you can skip the constructor arguments entirely:
```bash theme={null}
export OPENAI_API_KEY='nj_sk_YOUR_API_KEY'
export OPENAI_BASE_URL='https://www.ninjachat.ai/api/v1'
```
```python Python theme={null}
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY / OPENAI_BASE_URL
```
Use `www.ninjachat.ai`, not the bare `ninjachat.ai` apex domain. The apex
redirects and strips the `Authorization` header along the way, so every
request would arrive unauthenticated.
## What works
* **Any model** — pass any [model ID](/models), or `ninja/auto` to let NinjaChat pick.
* **Streaming** — set `stream: true` for token-by-token server-sent events.
* **Tool calling** — standard `tools` / `tool_choice` with `function.parameters`.
* **Sampling** — `temperature`, `top_p`, `max_tokens` (or `max_completion_tokens`), `stop`, `seed`, `frequency_penalty`, `presence_penalty`.
```python theme={null}
# Streaming
for chunk in client.chat.completions.create(
model="ninja/auto",
messages=[{"role": "user", "content": "Write a haiku about the sea."}],
stream=True,
):
print(chunk.choices[0].delta.content or "", end="")
```
`/api/v1/chat/completions` is the OpenAI-compatible message interface. For new native integrations, use `/api/v1/responses`; both share authentication, routing, and billing.
## What's rejected
The request schema is strict. Standard OpenAI SDK fields that have no effect on NinjaChat are dropped silently; anything that would change the meaning of the request fails with a `400` instead of being ignored:
| You send | What happens |
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| A field NinjaChat doesn't know | `400 unsupported_parameter` — the message names the field |
| `max_tokens` | Folded into `max_completion_tokens`. If you send both they must match, or you get `400 conflicting_parameters` |
| `n` other than `1` | `400 unsupported_value` — send separate requests when you need several choices |
| `logprobs: true` | `400 unsupported_parameter` (`logprobs: false` is ignored) |
| Non-empty `logit_bias` | `400 unsupported_parameter` (an empty object is ignored) |
| `metadata` | Ignored on `/chat/completions`, unless it isn't an object or has more than 32 keys — `400 invalid_parameter` |
| `model: "auto"` | Accepted as an alias of `ninja/auto`; the response reports the canonical id |
| `model: "ensemble"`, `auto-fast`, `a>b` chains, `model:suffix` | `400 invalid_model` — retired syntax. Use `models` for ordered fallbacks and `routing` for strategy and providers |
## NinjaChat extras
The native [Responses API](/chat) adds optional features OpenAI doesn't have —
[smart routing](/smart-routing), [fallbacks](/fallback-chains),
[spend controls](/budget-routing), explicit provider policy, and per-response `cost_usd`
and request traces. Adopt the official NinjaChat SDK when you need those typed primitives.
# Pipelines
Source: https://docs.ninjachat.ai/pipelines
Chain up to five chat, image, and video steps into one durable async job — billed once, polled once.
A pipeline runs up to **five dependent steps** across chat, image, and video as a
single asynchronous job. Later steps read earlier results through
`{{stepId.field}}` templates, so you describe the chain once instead of
orchestrating three endpoints and holding state yourself.
Use it when one output feeds the next — write a scene, illustrate it, animate
the illustration — and you want one request, one bill, and one job to poll.
## Create a pipeline
```bash theme={null}
curl https://www.ninjachat.ai/api/v1/pipelines \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"steps": [
{
"id": "script",
"type": "chat",
"model": "claude-sonnet-4.6",
"params": { "input": "Describe a lighthouse at dawn in one vivid sentence." }
},
{
"id": "still",
"type": "image",
"model": "flux-2-pro",
"params": { "prompt": "{{script.output}}", "aspect_ratio": "16:9" }
},
{
"id": "clip",
"type": "video",
"model": "veo-3.1-fast",
"params": { "prompt": "{{script.output}}", "image_url": "{{still.url}}" }
}
]
}'
```
The response returns a pipeline `id` and its initial state. Poll it:
```bash theme={null}
curl https://www.ninjachat.ai/api/v1/pipelines/$PIPELINE_ID \
-H "Authorization: Bearer $NINJACHAT_API_KEY"
```
Register a [webhook](/observability) instead of polling and you receive
`pipeline.completed` when the job finishes.
## Steps
| Field | Notes |
| ----------------------------------------- | ------------------------------------------------------------ |
| `id` | Your name for the step. Referenced by later steps. |
| `type` | `chat`, `image`, or `video`. |
| `model` | Any model ID servable for that type — see [Models](/models). |
| `params.input` / `params.system` | Chat steps. |
| `params.prompt` | Image and video steps. |
| `params.aspect_ratio`, `params.image_url` | Image and video steps. |
Steps run **sequentially**, so a template may only reference an earlier step.
| Template | Produced by |
| ------------------- | ----------------------------------------- |
| `{{stepId.output}}` | `chat` steps — the completion text |
| `{{stepId.url}}` | `image` and `video` steps — the asset URL |
Referencing a later step, an unknown field, or `{{x.output}}` on an image step
is rejected at validation time with a message naming the offending step, before
anything is billed.
## Billing
The **whole pipeline is reserved up front** — the sum of each step's ordinary
standalone price — before any provider work begins. Steps settle as they
complete, and anything unsettled is refunded automatically if the pipeline
fails. You are never charged for steps that did not run.
## Durability
Pipeline state is stored server-side, so execution survives a dropped
connection or a serverless timeout. Polling the job or letting the sweeper run
will continue a pipeline whose original driver died — you do not need to retry
or rebuild state on your side.
# Presets
Source: https://docs.ninjachat.ai/presets
Save a model, routing policy, system prompt, and parameters behind a slug — then send only messages.
A preset is a **saved, versioned configuration** — model or model chain,
routing policy, system prompt, and sampling parameters — addressed by a slug.
Your application sends only the messages; the preset supplies everything else.
That means you can change the model, tighten a routing policy, or edit a system
prompt without shipping a code change.
## Call a preset
```bash theme={null}
curl https://www.ninjachat.ai/api/v1/presets/support-triage/chat/completions \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "My invoice shows two charges for March." }
]
}'
```
The request body is the ordinary [Chat Completions](/chat) body with one
difference: `messages` is the only required field. The preset's saved model,
routing, system prompt, and parameters are applied for you.
The response is a standard chat completion, plus headers identifying which
preset and version served the request:
| Header | Meaning |
| ------------------------ | ---------------------------------------- |
| `X-Ninja-Preset` | The preset slug that served this request |
| `X-Ninja-Preset-Version` | The exact saved version applied |
Log the version header — it tells you which configuration produced a given
response after the preset has moved on.
## Overriding per call
Pass `model` or `models` to override the preset's chain for a single request;
every other Chat Completions parameter (`temperature`, `max_completion_tokens`,
`stream`, `stop`, `seed`, and the rest) is accepted and takes precedence over
the saved value.
```json theme={null}
{
"messages": [{ "role": "user", "content": "Summarise this thread." }],
"models": ["claude-sonnet-4.6", "gpt-5.6-sol"],
"temperature": 0
}
```
Streaming, tool calling, and [fallback chains](/fallback-chains) behave exactly
as they do on `/chat/completions`.
## Managing presets
Create and version presets in the
[developer console](https://www.ninjachat.ai/developers). Publishing a new
version changes what the slug serves on the next request — no redeploy on your
side.
# Pricing
Source: https://docs.ninjachat.ai/pricing
Chat bills per token — exact $/MTok, no flat tiers. Images, video, and search stay flat per unit.
| What | Cost |
| ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- |
| Chat | metered \$/MTok (input + output; discounted rate for cached input) — see the rate table below |
| Images | \$0.01 – \$0.128/image |
| Video | \$0.42 – \$4.00/video |
| Search | \$0.05/query |
| Model list, price sheet, cost estimates, video polling, balance, usage, health | Free |
Every response prices itself — no spreadsheet required:
```json theme={null}
{ "cost_usd": 0.0187, "request_id": "req_abc123" }
```
Text is billed by exact token usage, not a flat request fee. Read [`GET /api/v1/pricing`](#live-price-sheet) for the live machine-readable rate sheet, or `pricing` on each [`GET /api/v1/models`](/models) record; the same tables drive routing and billing.
## Developer Balance
You prepay a balance and requests draw from it — the same balance covers the REST API and the [MCP server](/mcp/overview), and it never expires. Add funds at [Developers → Billing](https://www.ninjachat.ai/developers/billing) — any amount from \$5 to \$2,000, with \$25, \$100, and \$250 presets — or verify your phone on your first paid action to unlock a **\$0.50 starter balance** free. Every top-up carries an 8% service fee (\$25 of credit costs \$27 at checkout); model prices carry no hidden markup.
**What a pack buys:** it depends on the selected model, prompt size, cached input, and output length. Run [`POST /api/v1/estimate`](/estimate) against your real prompts and enforce `routing.max_cost_usd` when a request needs a hard ceiling.
### Text — `POST /api/v1/responses` or `/chat/completions`
Billed per token: input at the metered input rate, provider-cache-read tokens at the cached-input rate, output at the metered output rate. Models with a long-context tier bill the **whole request** at the higher tier once the prompt passes the threshold. Rates below are `GET /api/v1/pricing` (`pricing_version` `2026-09-01.provider-rails.1`) filtered to models that are servable right now; always read live numbers before you budget.
| Frontier family | Current public IDs |
| --------------- | ------------------------------------------------------------------------------------------ |
| OpenAI | `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5-pro`, `gpt-5.4` |
| Anthropic | `claude-fable-5`, `claude-opus-5`, `claude-sonnet-5`, `claude-opus-4.8`, `claude-opus-4.7` |
| Google | `gemini-3.7-flash`, `gemini-3.1-pro` |
| xAI | `grok-4.6` |
| Open frontier | `deepseek-v4-pro`, `deepseek-v4-flash`, `glm-5.2`, `minimax-m2.7`, `qwen3-coder-next` |
| Model ID | Input \$/MTok | Cached input \$/MTok | Output \$/MTok | Long-context tier (input / output) |
| ------------------------- | ------------- | -------------------- | -------------- | ---------------------------------- |
| `claude-fable-5` | 10 | 1 | 50 | — |
| `claude-fable-5.1` | 10 | 0.25 | 50 | — |
| `claude-haiku-4.5` | 1 | 0.1 | 5 | — |
| `claude-opus-4.6` | 5 | 0.5 | 25 | — |
| `claude-opus-4.7` | 5 | 0.5 | 25 | — |
| `claude-opus-4.8` | 5 | 0.5 | 25 | — |
| `claude-opus-5` | 5 | 0.5 | 25 | — |
| `claude-sonnet-4.5` | 3 | 0.3 | 15 | — |
| `claude-sonnet-4.6` | 3 | 0.3 | 15 | — |
| `claude-sonnet-5` | 2 | 0.2 | 10 | — |
| `codestral-2508` | 0.3 | 0.03 | 0.9 | — |
| `command-a` | 2.5 | 0.25 | 10 | — |
| `command-r` | 0.15 | 0.015 | 0.6 | — |
| `command-r7b` | 0.0375 | 0.00375 | 0.15 | — |
| `deepseek-r1-0528` | 0.57 | 0.057 | 2.29 | — |
| `deepseek-v3` | 1.74 | 0.174 | 3.48 | — |
| `deepseek-v3-0324` | 0.24 | 0.024 | 0.9 | — |
| `deepseek-v3.1` | 0.25 | 0.13 | 0.95 | — |
| `deepseek-v3.2` | 0.56 | 0.056 | 0.84 | — |
| `deepseek-v4-flash` | 0.14 | 0.014 | 0.28 | — |
| `deepseek-v4-flash-0731` | 0.22 | 0.007 | 0.66 | — |
| `deepseek-v4-pro` | 1.74 | 0.174 | 3.48 | — |
| `deepseek-v4-pro-0813` | 1.32 | 0.132 | 3.96 | — |
| `euryale-70b` | 0.85 | 0.085 | 0.85 | — |
| `gemini-2.5-flash` | 0.3 | 0.03 | 2.5 | — |
| `gemini-2.5-pro` | 1.25 | 0.125 | 10 | over 200K: 2.5 / 15 |
| `gemini-3-flash` | 0.5 | 0.05 | 3 | — |
| `gemini-3-pro` | 2 | 0.2 | 12 | over 200K: 4 / 18 |
| `gemini-3.1-flash-lite` | 0.25 | 0.025 | 1.5 | — |
| `gemini-3.1-pro` | 2 | 0.2 | 12 | over 200K: 4 / 18 |
| `gemini-3.5-flash` | 1.5 | 0.15 | 9 | — |
| `gemini-3.5-flash-lite` | 0.3 | 0.03 | 2.5 | — |
| `gemini-3.6-flash` | 1.5 | 0.15 | 7.5 | — |
| `gemini-3.7-flash` | 1.5 | 0.15 | 7.5 | — |
| `gemini-3.8-flash` | 1.5 | 0.15 | 7.5 | — |
| `gemma-3-12b` | 0.05 | 0.005 | 0.15 | — |
| `gemma-3-27b` | 0.08 | 0.008 | 0.16 | — |
| `gemma-3-4b` | 0.05 | 0.005 | 0.1 | — |
| `gemma-4-26b-a4b` | 0.13 | 0.013 | 0.4 | — |
| `gemma-4-31b` | 0.18 | 0.018 | 0.5 | — |
| `gemma-4-31b-turbo` | 0.09 | 0.009 | 0.34 | — |
| `gemma-4-31b-ultra` | 0.27 | 0.027 | 0.76 | — |
| `gemma-4-e4b` | 0.02 | 0.002 | 0.1 | — |
| `glm-4.6` | 0.5 | 0.05 | 2 | — |
| `glm-4.7` | 0.6 | 0.06 | 2.2 | — |
| `glm-4.7-flash` | 0.06 | 0.006 | 0.4 | — |
| `glm-5` | 1 | 0.1 | 3.2 | — |
| `glm-5.1` | 1.4 | 0.14 | 4.4 | — |
| `glm-5.2` | 1.4 | 0.14 | 4.4 | — |
| `glm-5.2-fast` | 2.1 | 0.21 | 6.6 | — |
| `glm-5.3` | 1.4 | 0.26 | 4.4 | — |
| `glm-5.3-flash` | 0.15 | 0.03 | 0.5 | — |
| `gpt-4.1` | 2 | 0.5 | 8 | — |
| `gpt-4.1-mini` | 0.4 | 0.1 | 1.6 | — |
| `gpt-4o-mini` | 0.15 | 0.075 | 0.6 | — |
| `gpt-5` | 1.75 | 0.175 | 14 | — |
| `gpt-5-nano` | 0.05 | 0.005 | 0.4 | — |
| `gpt-5.3-codex` | 1.75 | 0.175 | 14 | — |
| `gpt-5.4` | 2.5 | 0.25 | 15 | over 272K: 5 / 22.5 |
| `gpt-5.4-mini` | 0.75 | 0.075 | 4.5 | — |
| `gpt-5.4-nano` | 0.2 | 0.02 | 1.25 | — |
| `gpt-5.4-pro` | 30 | 3 | 180 | over 272K: 60 / 270 |
| `gpt-5.5` | 5 | 0.5 | 30 | — |
| `gpt-5.5-pro` | 30 | 30 | 180 | over 272K: 60 / 270 |
| `gpt-5.6-luna` | 0.2 | 0.02 | 1.2 | — |
| `gpt-5.6-sol` | 4 | 0.4 | 20 | over 272K: 8 / 30 |
| `gpt-5.6-terra` | 2 | 0.2 | 12 | — |
| `gpt-oss-120b` | 0.35 | 0.035 | 0.75 | — |
| `gpt-oss-120b-turbo` | 0.15 | 0.015 | 0.6 | — |
| `gpt-oss-120b-ultra` | 0.2 | 0.02 | 0.95 | — |
| `gpt-oss-20b` | 0.075 | 0.0075 | 0.45 | — |
| `grok-4` | 1.25 | 0.125 | 2.5 | — |
| `grok-4.20` | 1.25 | 0.2 | 2.5 | over 200K: 2.5 / 5 |
| `grok-4.20-fast` | 1.25 | 0.2 | 2.5 | over 200K: 2.5 / 5 |
| `grok-4.3` | 1.25 | 0.2 | 2.5 | over 200K: 2.5 / 5 |
| `grok-4.5` | 2 | 0.3 | 6 | over 200K: 4 / 12 |
| `grok-4.6` | 2 | 0.2 | 6 | — |
| `grok-build-0.1` | 1 | 0.2 | 2 | over 200K: 2 / 4 |
| `hermes-3-405b` | 1 | 0.1 | 1 | — |
| `hermes-3-70b` | 0.7 | 0.07 | 0.7 | — |
| `hy3` | 0.14 | 0.014 | 0.58 | — |
| `inkling` | 1 | 0.1 | 4.05 | — |
| `inkling-small` | 0.5 | 0.05 | 1.2 | — |
| `kimi-k2.5` | 0.6 | 0.06 | 3 | — |
| `kimi-k2.6` | 0.95 | 0.095 | 4 | — |
| `kimi-k2.6-fast` | 2 | 0.3 | 8 | — |
| `kimi-k2.7-code` | 0.95 | 0.095 | 4 | — |
| `kimi-k2.7-code-fast` | 1.9 | 0.38 | 8 | — |
| `kimi-k3` | 3 | 0.3 | 15 | — |
| `kimi-k3-fast` | 4.5 | 0.45 | 22.5 | — |
| `ling-3.0-flash` | 0.06 | 0.006 | 0.18 | — |
| `llama-3.1-70b` | 0.4 | 0.04 | 0.4 | — |
| `llama-3.1-8b` | 0.06 | 0.006 | 0.06 | — |
| `llama-3.3-70b` | 0.1 | 0.01 | 0.32 | — |
| `llama-4-maverick` | 0.25 | 0.025 | 0.87 | — |
| `llama-4-scout` | 0.11 | 0.011 | 0.34 | — |
| `longcat-2.0` | 0.75 | 0.015 | 2.95 | — |
| `lunaris-8b` | 0.04 | 0.004 | 0.05 | — |
| `mimo-v2.5` | 0.14 | 0.014 | 0.28 | — |
| `mimo-v2.5-pro` | 0.435 | 0.0435 | 0.87 | — |
| `minimax-m2.5` | 0.3 | 0.03 | 1.2 | — |
| `minimax-m2.7` | 0.3 | 0.03 | 1.2 | — |
| `minimax-m2.7-turbo` | 0.38 | 0.07 | 1.7 | — |
| `minimax-m3` | 0.3 | 0.03 | 1.2 | — |
| `ministral-3-14b` | 0.2 | 0.02 | 0.2 | — |
| `ministral-3-3b` | 0.1 | 0.01 | 0.1 | — |
| `ministral-3-8b` | 0.15 | 0.015 | 0.15 | — |
| `mistral-large` | 2 | 0.2 | 6 | — |
| `mistral-large-3` | 0.5 | 0.05 | 1.5 | — |
| `mistral-medium-3.5` | 1.5 | 0.15 | 7.5 | — |
| `mistral-nemo-12b` | 0.019 | 0.0019 | 0.03 | — |
| `mistral-nemo-12b-tee` | 0.02 | 0.002 | 0.1 | — |
| `mistral-small-24b` | 0.05 | 0.005 | 0.08 | — |
| `mistral-small-3.2-24b` | 0.075 | 0.0075 | 0.2 | — |
| `mistral-small-4` | 0.15 | 0.015 | 0.6 | — |
| `muse-glimmer-30b` | 0.35 | 0.035 | 1.5 | — |
| `mythomax-13b` | 0.4 | 0.04 | 0.4 | — |
| `nemotron-3-nano` | 0.05 | 0.005 | 0.2 | — |
| `nemotron-3-nano-omni` | 0.5 | 0.05 | 0.9 | — |
| `nemotron-3-super` | 0.3 | 0.03 | 0.65 | — |
| `nemotron-3-ultra` | 0.9 | 0.09 | 2.4 | — |
| `nemotron-3.5-lightning` | 0.08 | 0.008 | 0.2 | — |
| `nemotron-nano-12b-v2-vl` | 0.2 | 0.02 | 0.6 | — |
| `nemotron-nano-9b-v2` | 0.06 | 0.006 | 0.23 | — |
| `nex-n2-pro` | 0.5 | 0.25 | 2.5 | — |
| `ninja-1` | 0.25 | 0.05 | 2 | over 128K: 0.5 / 4 |
| `o3-mini` | 1.1 | 0.11 | 4.4 | — |
| `phi-4` | 0.07 | 0.007 | 0.14 | — |
| `qwen-2.5-72b` | 0.36 | 0.036 | 0.4 | — |
| `qwen-3.5-122b-a10b` | 0.29 | 0.029 | 2.4 | — |
| `qwen-3.5-27b` | 0.26 | 0.026 | 2.6 | — |
| `qwen-3.5-35b-a3b` | 0.14 | 0.014 | 1 | — |
| `qwen-3.5-397b-a17b` | 0.55 | 0.055 | 3.5 | — |
| `qwen-3.5-9b` | 0.1 | 0.01 | 0.15 | — |
| `qwen-3.5-flash` | 0.1 | 0.01 | 0.4 | — |
| `qwen-3.6-27b` | 0.6 | 0.06 | 3.2 | — |
| `qwen-3.6-35b-a3b` | 0.1 | 0.01 | 0.95 | — |
| `qwen-3.6-flash` | 0.25 | 0.025 | 1.5 | over 256K: 1 / 4 |
| `qwen-3.6-plus` | 0.5 | 0.05 | 3 | over 256K: 2 / 6 |
| `qwen-3.7-flash` | 0.225 | 0.045 | 0.9 | — |
| `qwen-3.7-max` | 5 | 1 | 15 | over 128K: 6.25 / 18.5 |
| `qwen-3.7-plus` | 0.5 | 0.05 | 3 | — |
| `qwen-3.8-2.4t` | 2 | 0.2 | 6 | — |
| `qwen-3.8-27b` | 0.45 | 0.045 | 3.2 | — |
| `qwen-3.8-flash` | 0.15 | 0.015 | 0.47 | — |
| `qwen-3.8-max` | 2 | 0.2 | 6 | — |
| `qwen2.5-coder-3b` | 0.01 | 0.001 | 0.03 | — |
| `qwen2.5-coder-7b` | 0.01 | 0.001 | 0.03 | — |
| `qwen3-14b` | 0.12 | 0.012 | 0.24 | — |
| `qwen3-235b-instruct` | 0.2 | 0.02 | 0.6 | — |
| `qwen3-30b-a3b` | 0.12 | 0.012 | 0.5 | — |
| `qwen3-32b` | 0.08 | 0.008 | 0.28 | — |
| `qwen3-coder-480b-turbo` | 0.3 | 0.1 | 1 | — |
| `qwen3-coder-next` | 0.2 | 0.02 | 1.5 | — |
| `qwen3-max` | 1.2 | 0.24 | 6 | — |
| `qwen3-max-thinking` | 1.2 | 0.24 | 6 | — |
| `qwen3-next-80b-a3b` | 0.15 | 0.015 | 1.5 | — |
| `qwen3-vl-235b-a22b` | 0.2 | 0.02 | 0.88 | — |
| `qwen3-vl-30b-a3b` | 0.2 | 0.02 | 0.7 | — |
| `qwen3-vl-32b-instruct` | 0.16 | 0.016 | 0.64 | — |
| `qwq-32b` | 0.29 | 0.029 | 0.59 | — |
| `seed-1.8` | 0.25 | 0.05 | 2 | over 128K: 0.5 / 4 |
| `seed-2.0-code` | 1 | 0.1 | 6 | — |
| `seed-2.0-mini` | 0.2 | 0.02 | 0.8 | — |
| `seed-2.0-pro` | 1 | 0.1 | 6 | — |
| `seed-2.1-turbo` | 0.5 | 0.1 | 2.5 | — |
| `solar-pro4` | 0.3 | 0.06 | 1.2 | — |
| `step-3.7-flash` | 0.2 | 0.02 | 1.15 | — |
| `uncensored-ai` | 0.25 | 0.05 | 2 | over 128K: 0.5 / 4 |
`gpt-5.5-pro`'s cached-input rate equals its input rate on purpose: OpenAI offers no cached-input discount on that model, so it is passed through unchanged.
`ninja/auto` bills at whichever model it resolves to.
### Provider rails can price differently
Most models are served by more than one provider. The rate above is the
model's default rail — the one you normally get. When that provider is
unavailable and your request fails over, you are billed **the rail that
actually served**, at its own published rate, which can be higher or lower
than the default.
Each provider's rate is on the model record: `GET /api/v1/models/{id}`
returns a `providers` array, and any rail that prices differently from the
default carries its own `pricing`. Every response still reports what it
actually cost in `cost_usd`, and `routing.max_cost_usd` remains a hard
ceiling regardless of which rail serves.
### Images — `POST /api/v1/images/generations`
| Price | Models |
| ------- | ------------------------------------------------------------------------------------- |
| \$0.128 | `gpt-image-2` |
| \$0.09 | `seedream-5-pro` |
| \$0.08 | `flux-kontext-max` `nano-banana-pro` |
| \$0.06 | `flux-2-flex` `flux-1-pro-ultra` |
| \$0.05 | `grok-imagine-image-quality` |
| \$0.045 | `nano-banana-2` |
| \$0.04 | `recraft-v3` `google-imagen-4` `seedream` `flux-kontext-pro` `grok-imagine-image-2.0` |
| \$0.035 | `seedream-5-lite` |
| \$0.03 | `flux-2-pro` `qwen-image-edit-2511` |
| \$0.025 | `flux-kontext-dev` |
| \$0.024 | `flux-2-dev` |
| \$0.02 | `nano-banana` `grok-imagine` `qwen-image-2512` `runway-gen4-image-turbo` |
| \$0.014 | `flux-2-klein` |
| \$0.01 | `z-image-turbo` |
`n` images = `n` × the per-image price.
### Video — `POST /api/v1/videos`
| Price | Models |
| ------ | --------------------------------------------------------------------------- |
| \$4.00 | `google-veo-2` |
| \$3.64 | `seedance-2` |
| \$3.20 | `veo-3.1` |
| \$1.80 | `seedance-pro` |
| \$1.40 | `kling-video` |
| \$1.20 | `veo-3.1-fast` `google-veo-3-fast` `runway-gen4.5` `grok-imagine-video-1.5` |
| \$0.75 | `grok-imagine-video` |
| \$0.63 | `seedance-2.0-fast` — promotional (list \$0.84) through 2026-09-08 |
| \$0.43 | `seedance-lite` |
| \$0.42 | `seedance-2-mini` — promotional (list \$1.06) through 2026-09-08 |
Failed video jobs are refunded automatically.
### Search — `POST /api/v1/search`
\$0.05 per query.
## Live price sheet
`GET /api/v1/pricing` is public (no key) and returns the same tables billing uses:
```bash theme={null}
curl https://www.ninjachat.ai/api/v1/pricing
```
```json theme={null}
{
"object": "pricing",
"currency": "usd",
"pricing_version": "2026-09-01.provider-rails.1",
"chat": [
{
"id": "gpt-5.4",
"metered_input_per_mtok": 2.5,
"metered_output_per_mtok": 15,
"metered_cached_input_per_mtok": 0.25,
"long_context": { "threshold_tokens": 272000, "input_per_mtok": 5, "output_per_mtok": 22.5, "cached_input_per_mtok": 0.5 },
"typical_request_cents": 2.75,
"tier": "premium"
}
],
"images": [{ "id": "flux-2-klein", "per_image_cents": 1.4, "per_image": "$0.01" }],
"video": [{ "id": "veo-3.1-fast", "per_video_cents": 120, "per_video": "$1.20" }],
"search": { "per_query_cents": 5, "per_query": "$0.05" },
"cache_hit_fraction": 0.25,
"reference_usage": { "input_tokens": 5000, "output_tokens": 1000 },
"notes": { "chat": "...", "cache": "..." }
}
```
* `metered_input_per_mtok`, `metered_output_per_mtok`, and `metered_cached_input_per_mtok` are the billing rates. `long_context` is `null` for models without a tier; when present, the tier applies to the whole request once the prompt passes `threshold_tokens`.
* `typical_request_cents` is a derived 5,000-in / 1,000-out reference for comparison only (`flat_request_cents` is its deprecated alias). Requests pre-authorize an estimated maximum and settle to actual usage.
* **Cache hits:** gateway response-cache hits bill 25% (`cache_hit_fraction`) of the served response's metered price.
* The sheet lists every priced id, including models that are not currently servable. Check `servable` on [`GET /models`](/models) before pinning one.
## You'll never be surprised
Use `routing.max_cost_usd` with an explicit model or `ninja/auto`.
Signed `balance.low` webhooks fire at \$5 and \$1. Project `budget.alert` events fire at 50%, 80%, and 100%. Out of funds returns a clean `402` before execution.
Failed generated requests are not charged. Failed video jobs are refunded automatically.
Per-request logs and spend in the console.
## From code
```python Python SDK theme={null}
balance = client.balance()
usage = client.usage("30d")
models = client.models.list()
print(balance["balance"])
print(usage["total_cost"], usage["by_model"])
print(models["data"][0]["pricing"])
```
# Go live
Source: https://docs.ninjachat.ai/production-readiness
A compact production checklist for reliable, observable, and cost-bounded NinjaChat integrations.
Use this checklist after your first successful request and before sending customer traffic.
## Production baseline
Store `NINJACHAT_API_KEY` in your deployment platform or secret manager. Never ship it to a browser or mobile client.
Use the SDK defaults or configure bounded retries. The SDK honors `Retry-After` and safely replays billed requests with idempotency keys.
Use `ninja/auto` or an ordered `models` list so one provider incident does not become your incident.
Set `routing.max_cost_usd`, project limits, and balance alerts before traffic grows.
## Recommended client
The SDK is the shortest production-safe path because it includes typed errors, streaming helpers, retry handling, and idempotency behavior.
```typescript TypeScript theme={null}
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({
apiKey: process.env.NINJACHAT_API_KEY!,
maxRetries: 3,
timeoutMs: 120_000,
});
```
```python Python theme={null}
import os
from ninjachat import NinjaChat
client = NinjaChat(
api_key=os.environ["NINJACHAT_API_KEY"],
max_retries=3,
timeout=120,
)
```
## A resilient request
Use an ordered model set when you need predictable model families, or replace `models` with `model: "ninja/auto"` when NinjaChat should choose.
```typescript TypeScript theme={null}
const response = await client.responses.create({
models: ["gpt-5.6-luna", "claude-sonnet-5", "gemini-3.7-flash"],
input: "Classify this support request and explain the decision.",
max_output_tokens: 300,
routing: {
strategy: "balanced",
data_policy: "no_training",
max_cost_usd: 0.05,
},
});
console.log(response.output_text);
console.log(response.request_id, response.cost_usd);
```
```python Python theme={null}
response = client.responses.create(
models=["gpt-5.6-luna", "claude-sonnet-5", "gemini-3.7-flash"],
input="Classify this support request and explain the decision.",
max_output_tokens=300,
routing={
"strategy": "balanced",
"data_policy": "no_training",
"max_cost_usd": 0.05,
},
)
print(response["output_text"])
print(response["request_id"], response["cost_usd"])
```
## Before customer traffic
* Pin an SDK version and review release notes before upgrades.
* Send a stable end-user identifier in `user` for your own abuse and support workflows; do not put secrets or personal data in it.
* Bound concurrency with a worker pool instead of unbounded fan-out.
* Cancel abandoned streams and long-running client requests.
* Store the returned `request_id` beside your application trace or job record.
* Monitor usage, balance, latency, errors, and resolved providers.
* Use signed webhooks for completed or failed video jobs and spend alerts.
* Test `401`, `402`, `429`, timeout, and provider-failure paths before launch.
## Release gate
| Check | Pass condition |
| -------------- | ------------------------------------------------------------------ |
| Authentication | Keys are server-side, scoped, and rotatable |
| Reliability | Retries are bounded and at least one fallback is configured |
| Cost | Per-request and project limits match the product plan |
| Observability | Request IDs reach logs and a trace lookup is available |
| Async work | Video completion uses signed webhooks or bounded polling |
| Failure UX | Users receive a useful retry or fallback state for `429` and `5xx` |
Next: wire the [observability loop](/observability) and run the [quickstart](/quickstart) once from your deployment environment.
# Quality gates
Source: https://docs.ninjachat.ai/quality-scoring
Evaluate important outputs in your application and escalate to a stronger model when needed.
API v1 does not invent a universal confidence score. Quality is workload-specific, so evaluate important outputs against your own rubric and escalate only when the result fails.
```typescript TypeScript SDK theme={null}
const draft = await client.responses.create({
model: "gpt-5.6-luna",
input: customerPrompt,
});
const review = await client.responses.create({
model: "claude-sonnet-5",
input: `Score this answer from 0 to 1 for factual support and completeness.\n\n${draft.output_text}`,
text: {
format: {
type: "json_schema",
name: "quality_review",
strict: true,
schema: {
type: "object",
properties: {
score: { type: "number" },
reason: { type: "string" },
},
required: ["score", "reason"],
additionalProperties: false,
},
},
},
});
```
## Escalate only when needed
Parse the review and retry with a stronger frontier model when it falls below your threshold:
```typescript TypeScript SDK theme={null}
const quality = JSON.parse(review.output_text) as { score: number; reason: string };
const final = quality.score >= 0.85
? draft
: await client.responses.create({
model: "gpt-5.6-sol",
input: customerPrompt,
instructions: `Improve the answer. Reviewer feedback: ${quality.reason}`,
});
console.log(final.output_text);
console.log("Total cost:", draft.cost_usd + review.cost_usd + (final === draft ? 0 : final.cost_usd));
```
For deterministic checks—schema validity, required citations, policy rules, code compilation—run those before invoking a model judge. Store every NinjaChat `request_id` so failures remain traceable.
## When to use a gate
| Workload | Useful check |
| --------------------- | ---------------------------------------------- |
| Structured extraction | JSON Schema plus business validation |
| RAG | Citation presence and source coverage |
| Code generation | Typecheck, tests, and static analysis |
| Customer support | Policy compliance and escalation triggers |
| High-stakes synthesis | Independent model review with a written rubric |
For infrastructure reliability, use ordered [fallbacks](/fallback-chains). Quality gates are for output acceptance, not provider uptime.
# Quickstart
Source: https://docs.ninjachat.ai/quickstart
Install an official SDK and make your first NinjaChat API request in under a minute.
Create a key at [Developers → Keys](https://www.ninjachat.ai/developers/keys). Keys look like `nj_sk_...` and are shown once — copy immediately.
```bash TypeScript theme={null}
npm install @ninjachat/sdk
```
```bash Python theme={null}
pip install ninjachat
```
```bash theme={null}
export NINJACHAT_API_KEY='nj_sk_your-api-key-here'
```
Set `model` to `ninja/auto` and NinjaChat picks the best model for you.
```typescript TypeScript theme={null}
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({
apiKey: process.env.NINJACHAT_API_KEY!,
});
const response = await client.responses.create({
model: "ninja/auto",
input: "What is the capital of France?",
});
console.log(response.output_text);
```
```python Python theme={null}
import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
response = client.responses.create(
model="ninja/auto",
input="What is the capital of France?",
)
print(response["output_text"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-d '{
"model": "ninja/auto",
"input": "What is the capital of France?"
}'
```
Every response tells you which model and provider ran, what it cost, and how to trace the request:
```json theme={null}
{
"id": "resp_...",
"object": "response",
"status": "completed",
"model": "gemini-3-flash",
"output_text": "The capital of France is Paris.",
"cost_usd": 0.00003,
"provider": "google",
"request_id": "req_...",
"routing": {
"strategy": "balanced",
"requested_models": ["ninja/auto"],
"resolved_model": "gemini-3-flash",
"provider": "google",
"fallbacks_allowed": true,
"data_policy": "default",
"router": {
"id": "ninja/auto",
"task": "factual",
"classified_by": "regex",
"candidates": ["gemini-3-flash", "..."]
}
}
}
```
`model` is the concrete model the router chose — the same value as `routing.resolved_model` — while `routing.requested_models` keeps the `ninja/auto` you asked for. `routing.router` explains the pick: the detected task, how it was classified (`regex`, `llm`, or `llm-cached`), and the ranked candidate chain. The sample is trimmed; see [Smart routing](/smart-routing) for the full block.
Need streaming, images, video, usage, or request traces? Continue to the [SDK guide](/sdks). Already using the OpenAI SDK? [Change two lines](/openai-compatibility).
## Next steps
TypeScript and Python clients
`ninja/auto` plus cost, latency, and quality routing
Frontier chat, image, and video models
Request traces, usage, balance, health, and webhooks
Reliability, spend controls, and launch checks
Live token and media rates
# Rate limits
Source: https://docs.ninjachat.ai/rate-limits
Limits per endpoint, response headers, and retry patterns.
## Limits
Limits are enforced by the gateway's admission controller after your key is authenticated, in rolling 60-second windows, on two scopes at once: **per key** and **per account** (all of an account's keys together, so minting more keys never multiplies the ceiling).
| Layer | Per key | Per account | Applies to |
| --------------------------------------------- | -------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Requests per minute — chat, responses, search | 60 | 120 | `POST /responses`, `POST /chat/completions`, `POST /search`. `POST /batch` and `POST /compare` draw on the same pool, one unit per job or model. |
| Requests per minute — images | 30 | 60 | `POST /images/generations` |
| Requests per minute — video | 2 | 4 | `POST /videos` |
| Tokens per minute | 1,500,000 | 3,000,000 | Chat is weighed by its input estimate plus output ceiling; each image counts 100,000, each video 1,000,000, each search 20,000 |
| Concurrent in-flight requests | 20 | 40 | Every billed route. A slot is held for the whole request, including a streaming body |
| Server-side fallback attempts | 120 per minute | — | Silent model and provider fallbacks inside one request |
| Pre-auth flood cutoff | 600 per minute per key **and** per client IP | — | Checked before authentication; only sheds obvious floods |
RPM windows are kept per workload group (chat, images, video, search), so image traffic never consumes chat's slice. Per-key token and concurrency budgets are shared across every endpoint.
Not admission-limited: `GET /models`, `GET /pricing`, `GET /videos/{id}` (poll as often as you like), `GET /balance`, `GET /usage`, `GET /health`. `POST /estimate` has its own limit of 30 per minute per IP.
## Response headers
Included on every successful response from a billed route, and on admission `429`s. The `401` (missing/invalid key) and zero-balance `402` checks both run *before* the rate limiter, so those two error responses don't carry them.
| Header | What it tells you |
| ----------------------- | ------------------------------------------------------------------------------------------------- |
| `X-RateLimit-Limit` | Your per-key requests-per-minute ceiling for this endpoint group |
| `X-RateLimit-Remaining` | How many you have left in the current window |
| `X-RateLimit-Reset` | Seconds until the window resets |
| `Retry-After` | Seconds to wait — on `429`, and also on `409 request_in_flight` and `503 idempotency_unavailable` |
| `X-Idempotent-Replay` | `true` when a stored response was replayed for a reused `Idempotency-Key` |
## When you hit a limit
You get a `429` whose body names the layer you hit:
```json theme={null}
{
"error": {
"message": "Rate limit exceeded. Try again in 12 seconds.",
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"param": null
},
"message": "Rate limit exceeded. Try again in 12 seconds.",
"code": "rate_limit_exceeded",
"request_id": "req_abc123",
"retry_after": 12,
"limit": "key_rpm",
"scope": "key"
}
```
`limit` is one of `key_rpm`, `account_rpm`, `key_tpm`, `account_tpm`, `key_concurrency`, or `account_concurrency`; `scope` is `key` or `account`. Concurrency denials suggest a 2-second `retry_after`; window denials report the time until the window rolls over. Batch and compare add `units` (the fan-out size that was counted).
The pre-auth flood cutoff answers earlier and more tersely — `"Too many requests. Try again in N seconds."` with `retry_after` but no `request_id`, `limit`, or `scope` — because it runs before your key is looked up.
## Retry code
The SDK is the shortest safe implementation: it honors `Retry-After`, uses exponential backoff, retries `429` and `5xx` up to `maxRetries` (default `2`), and only retries billed requests when an idempotency key makes replay safe.
```typescript TypeScript SDK theme={null}
const client = new NinjaChat({
apiKey: process.env.NINJACHAT_API_KEY!,
maxRetries: 3,
timeoutMs: 120_000,
});
const response = await client.responses.create({
model: "gpt-5.6-luna",
input: "Classify this support ticket.",
});
```
```python Python SDK theme={null}
client = NinjaChat(
api_key=os.environ["NINJACHAT_API_KEY"],
max_retries=3,
timeout=120,
)
response = client.responses.create(
model="gpt-5.6-luna",
input="Classify this support ticket.",
)
```
## Tips
* **Bound concurrency** — use a worker pool of at most 20 per key instead of unbounded `Promise.all`
* **Video polling doesn't count** — poll as often as you want (every 10s recommended); video *submissions* are limited to 2 per minute per key
* **Honor `Retry-After`** — it is more accurate than a fixed sleep
* **Reuse idempotency keys** — retries of billed operations must not create duplicate work
# TypeScript and Python SDKs
Source: https://docs.ninjachat.ai/sdks
Install the official NinjaChat SDKs for typed responses, streaming, media generation, routing, usage, and webhooks.
The official SDKs cover NinjaChat's core API v1 primitives: Responses, Chat Completions, models, images, video, search, usage, balance, health, request traces, and webhooks.
These endpoints — `POST /batch`, `POST /compare`, `POST /estimate`, `GET /pricing`, `/sessions`, and `/pipelines` — are not wrapped by either SDK. Call them as raw REST with the same `Authorization: Bearer` header. See [Batch](/batch), [Compare](/compare), [Cost estimation](/estimate), [Pricing](/pricing), [Conversation state](/sessions), [Pipelines](/pipelines), and [Presets](/presets).
NinjaChat API keys are server-side credentials. Load `NINJACHAT_API_KEY` from your deployment platform or secret manager; never include an `nj_sk_...` key in browser or mobile code.
## Choose an integration
Best for Node.js, Next.js, workers, and TypeScript services. Typed resources, streams, retries, and webhook verification are included.
Best for FastAPI, Flask, Django, notebooks, and background workers.
Keep an existing OpenAI integration and change the base URL, API key, and model ID.
Use the HTTP contract directly when adding a dependency is not desirable.
## Install
```bash TypeScript theme={null}
npm install @ninjachat/sdk
```
```bash Python theme={null}
pip install ninjachat
```
The TypeScript package requires Node.js 18 or newer. The Python package requires Python 3.9 or newer.
## Create a client
```typescript TypeScript theme={null}
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({
apiKey: process.env.NINJACHAT_API_KEY!,
});
```
```python Python theme={null}
import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
```
You do not need to configure a base URL. Both clients default to `https://www.ninjachat.ai/api/v1`.
```typescript app/api/generate/route.ts theme={null}
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
export async function POST(request: Request) {
const { input } = await request.json();
const response = await client.responses.create({ model: "ninja/auto", input });
return Response.json({ text: response.output_text, requestId: response.request_id });
}
```
```python app.py theme={null}
import os
from fastapi import FastAPI
from pydantic import BaseModel
from ninjachat import NinjaChat
app = FastAPI()
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
class GenerateBody(BaseModel):
input: str
@app.post("/generate")
def generate(body: GenerateBody):
response = client.responses.create(model="ninja/auto", input=body.input)
return {"text": response["output_text"], "request_id": response["request_id"]}
```
## Generate a response
Use Responses for new stateless text, vision, tool, and structured-output integrations:
```typescript TypeScript theme={null}
const response = await client.responses.create({
model: "ninja/auto",
input: "Give me three names for a developer tool.",
max_output_tokens: 100,
routing: {
strategy: "balanced",
data_policy: "no_training",
},
});
console.log(response.output_text);
console.log(response.cost_usd, response.request_id);
```
```python Python theme={null}
response = client.responses.create(
model="ninja/auto",
input="Give me three names for a developer tool.",
max_output_tokens=100,
routing={"strategy": "balanced", "data_policy": "no_training"},
)
print(response["output_text"])
print(response["cost_usd"], response["request_id"])
```
## Use Chat Completions
Use Chat Completions when your application already works with role-based messages:
```typescript TypeScript theme={null}
const completion = await client.chat.completions.create({
model: "gpt-5.6-luna",
messages: [{ role: "user", content: "Explain edge caching in one paragraph." }],
max_completion_tokens: 200,
});
console.log(completion.choices[0].message.content);
```
```python Python theme={null}
completion = client.chat.completions.create(
model="gpt-5.6-luna",
messages=[{"role": "user", "content": "Explain edge caching in one paragraph."}],
max_completion_tokens=200,
)
print(completion["choices"][0]["message"]["content"])
```
Already using OpenAI's client? You can keep it and [change the base URL and key](/openai-compatibility).
## Stream output
```typescript TypeScript theme={null}
const events = await client.responses.create({
model: "ninja/auto",
input: "Write a short launch announcement.",
stream: true,
});
for await (const event of events) {
if (event.type === "response.output_text.delta") {
process.stdout.write(event.delta ?? "");
}
}
```
```python Python theme={null}
events = client.responses.create(
model="ninja/auto",
input="Write a short launch announcement.",
stream=True,
)
for event in events:
if event.get("type") == "response.output_text.delta":
print(event.get("delta", ""), end="")
```
See [Streaming](/streaming) for event behavior and complete examples.
## Images and video
```typescript TypeScript theme={null}
const image = await client.images.generate({
model: "nano-banana-2",
prompt: "A paper crane on a drafting table, soft morning light",
});
console.log(image.data[0].url);
const job = await client.videos.generate({
model: "veo-3.1-fast",
prompt: "Ocean waves at dusk, slow aerial push-in",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python theme={null}
image = client.images.generate(
model="nano-banana-2",
prompt="A paper crane on a drafting table, soft morning light",
)
print(image["data"][0]["url"])
job = client.videos.generate(
model="veo-3.1-fast",
prompt="Ocean waves at dusk, slow aerial push-in",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
Video polling stops automatically when the job completes or fails. Failed generation jobs are refunded by the API.
## Models, usage, and traces
```typescript TypeScript theme={null}
const models = await client.models.list();
const usage = await client.usage("7d");
const balance = await client.balance();
const health = await client.health();
const trace = await client.requests.get(response.request_id);
```
```python Python theme={null}
models = client.models.list()
usage = client.usage("7d")
balance = client.balance()
health = client.health()
trace = client.requests.get(response["request_id"])
```
See [Observability](/observability) for the fields to log, health checks, alerting, and signed webhook verification.
## Search and webhooks
Run AI-assisted search through the same client:
```typescript TypeScript theme={null}
const results = await client.search.query({
query: "What changed in the latest ECMAScript specification?",
max_results: 5,
});
console.log(results.answer, results.sources);
```
```python Python theme={null}
results = client.search.query(
query="What changed in the latest ECMAScript specification?",
max_results=5,
)
print(results["answer"], results["sources"])
```
For long-running video and pipeline jobs and spend alerts, register a signed webhook instead of polling — in [Developers → Webhooks](https://www.ninjachat.ai/developers/webhooks) or via the SDK. The events are `video.completed`, `video.failed`, `pipeline.completed`, `pipeline.failed`, `budget.alert`, and `balance.low`; omit `events` to subscribe to all six. Store the returned signing secret immediately; it is shown once.
```typescript TypeScript theme={null}
const endpoint = await client.webhooks.create({
url: "https://example.com/webhooks/ninjachat",
events: ["video.completed", "video.failed", "budget.alert"],
});
console.log(endpoint.secret);
```
```python Python theme={null}
endpoint = client.webhooks.create(
url="https://example.com/webhooks/ninjachat",
events=["video.completed", "video.failed", "budget.alert"],
)
print(endpoint["secret"])
```
## Handle errors
Every failed request raises a typed `NinjaChatError` with an HTTP status, machine-readable code, and request ID when the server produced one.
```typescript TypeScript theme={null}
import { NinjaChatError } from "@ninjachat/sdk";
try {
await client.models.retrieve("missing-model");
} catch (error) {
if (error instanceof NinjaChatError) {
console.error(error.status, error.code, error.requestId);
}
}
```
```python Python theme={null}
from ninjachat import NinjaChatError
try:
client.models.retrieve("missing-model")
except NinjaChatError as error:
print(error.status, error.code, error.request_id)
```
The clients retry `429`, `500`, `502`, `503`, and `504` responses (up to `maxRetries`, default `2`), honor `Retry-After`, and attach an `Idempotency-Key` to billed requests before retrying so a retry can only replay, never double-bill. A `409 request_in_flight` is retried only when the request carried an idempotency key; `408` is never retried. Pass `maxRetries: 0` (`max_retries=0`) to disable retries. See [Error handling](/error-handling) and [Rate limits](/rate-limits).
Before customer traffic, complete the [go-live checklist](/production-readiness).
## Package links
`@ninjachat/sdk`
`ninjachat`
Browse both SDKs and release history
Make your first request
# Web search
Source: https://docs.ninjachat.ai/search
Search the web and get AI-synthesized answers with cited sources.
## Request
```bash theme={null}
POST https://www.ninjachat.ai/api/v1/search
Authorization: Bearer nj_sk_YOUR_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"query": "latest developments in AI safety",
"include_answer": true,
"max_results": 10
}
```
## Response
```json theme={null}
{
"object": "search.results",
"query": "latest developments in AI safety",
"answer": "Recent developments in AI safety include...",
"sources": [
{
"url": "https://example.com/article",
"title": "AI Safety Progress in 2026",
"content": "Summary of the article...",
"published_date": "2026-03-01"
}
],
"images": [],
"follow_up_questions": [
"What are the key AI safety organizations?",
"How does RLHF improve AI safety?"
],
"provider": "...",
"cost_usd": 0.05,
"request_id": "req_..."
}
```
The AI answer is in `answer` (`null` when `include_answer` is `false`). Sources are in `sources[]`; `published_date` is `null` when the source has no date. `images` is a list of `{ url, description }` populated when `include_images` is `true`. `provider` names the search backend that served the request, and `cost_usd` is the flat per-query price.
## Parameters
| Parameter | Type | Required | Default | Description |
| ---------------- | ------- | -------- | --------- | ------------------------------------- |
| `query` | string | **Yes** | — | Search query. Max 2,000 chars. |
| `group` | string | No | `web` | `web` or `news` |
| `max_results` | integer | No | 10 | Number of sources (1–20) |
| `search_depth` | string | No | `basic` | `basic` (fast) or `advanced` (deeper) |
| `topic` | string | No | `general` | `general`, `news`, or `finance` |
| `include_answer` | boolean | No | true | Generate an AI-synthesized answer |
| `include_images` | boolean | No | false | Include image results |
## Full working example
```python Python SDK theme={null}
result = client.search.query(
query="latest developments in AI safety",
group="news",
search_depth="advanced",
include_answer=True,
max_results=10,
)
print(result["answer"])
for source in result["sources"][:3]:
print(f"- {source['title']}: {source['url']}")
```
```typescript TypeScript SDK theme={null}
const result = await client.search.query({
query: "latest developments in AI safety",
group: "news",
search_depth: "advanced",
include_answer: true,
max_results: 10,
});
console.log(result.answer);
for (const source of result.sources.slice(0, 3)) {
console.log(`- ${source.title}: ${source.url}`);
}
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/search \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query":"latest developments in AI safety",
"group":"news",
"search_depth":"advanced",
"include_answer":true,
"max_results":10
}'
```
Not ready to write code? [Try it in the Playground →](https://www.ninjachat.ai/developers/playground)
## Search groups
| Group | What it searches | Use for |
| ------ | -------------------- | -------------------------------- |
| `web` | General web | Default. Most use cases. |
| `news` | Recent news articles | News aggregation, current events |
## Use with RAG
Combine search with chat for retrieval-augmented generation:
```python theme={null}
# 1. Search for context
results = client.search.query(query="What is quantum computing?")
# 2. Feed to a chat model with sources as context
context = "\n".join(f"- {s['title']}: {s['content']}" for s in results["sources"][:5])
response = client.responses.create(
model="gpt-5.6-luna",
instructions=f"Answer using these sources:\n{context}",
input="Explain quantum computing with citations",
)
print(response["output_text"])
```
# Conversation state
Source: https://docs.ninjachat.ai/sessions
Keep conversation history in your application and send the relevant context on each stateless API call.
NinjaChat API v1 is stateless: it does not store response bodies or server-side sessions. Your application owns conversation state and sends the relevant history on each request.
```typescript TypeScript SDK theme={null}
const messages = [
{ role: "user" as const, content: "My name is Alice. I work in fintech." },
];
const first = await client.chat.completions.create({
model: "claude-sonnet-5",
messages,
});
messages.push({ role: "assistant", content: first.choices[0].message.content ?? "" });
messages.push({ role: "user", content: "What do you know about me?" });
const second = await client.chat.completions.create({
model: "claude-sonnet-5",
messages,
});
```
```python Python SDK theme={null}
messages = [{"role": "user", "content": "My name is Alice. I work in fintech."}]
first = client.chat.completions.create(model="claude-sonnet-5", messages=messages)
messages.extend([
{"role": "assistant", "content": first["choices"][0]["message"]["content"]},
{"role": "user", "content": "What do you know about me?"},
])
second = client.chat.completions.create(model="claude-sonnet-5", messages=messages)
```
## What to store
| Data | Recommendation |
| ---------------------- | ----------------------------------------------------------------------------------------- |
| Conversation messages | Store in your database under your own user/conversation ID. |
| Tool calls and outputs | Keep both items so the model can continue the tool loop. |
| Long threads | Summarize older turns and retain the most recent verbatim messages. |
| Request metadata | Store NinjaChat `request_id`, resolved model, provider, and `cost_usd` for observability. |
## A compact support bot
```python Python SDK theme={null}
def chat(history: list[dict], message: str) -> str:
history.append({"role": "user", "content": message})
response = client.chat.completions.create(
model="claude-sonnet-5",
messages=history,
routing={"strategy": "balanced", "allow_fallbacks": True},
)
answer = response["choices"][0]["message"]["content"]
history.append({"role": "assistant", "content": answer})
return answer
```
## Limits
| Property | Value |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| API retention | Response bodies are not stored by the canonical `/responses` and `/chat/completions` endpoints. The legacy session store below is the one exception. |
| Context size | Bound by the selected model's context window. |
| Application storage | Controlled by your own database, retention, and deletion policy. |
### Message limits
Summarize before the history approaches the chosen model's context window. A practical pattern is one structured summary plus the most recent 10–20 turns. This keeps latency and token cost predictable while your database remains the source of truth.
## Legacy sessions
The legacy `POST /api/v1/chat` path still supports server-side session memory for integrations built against it. It is a compatibility surface — new applications should keep state client-side as shown above. None of these routes are wrapped by the SDKs; call them as raw REST with your `Authorization: Bearer` header.
| Endpoint | What it does |
| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `POST /api/v1/sessions` | Creates a session. Body `{ "session_id": "..." }` is optional (1–64 letters, digits, `-`, `_`); omit it to receive a generated `sess_…` id. Returns `{ session_id, message_count, created_at, request_id }`. Requires a key with API credits. |
| `GET /api/v1/sessions/{id}` | Returns `{ session_id, messages, message_count, created_at, updated_at }`. |
| `DELETE /api/v1/sessions/{id}` | Returns `{ "deleted": true }`. |
| `GET /api/v1/sessions/{id}/export?format=json\|markdown` | Downloads the transcript (`Content-Disposition: attachment`). `format` defaults to `json`; any other value is `400 validation_error`. |
| `POST /api/v1/chat` with `session_id` | Prepends the stored history to `messages`, runs the completion, then appends your turn and the assistant reply. Non-streaming responses gain `session: { id, message_count }`. A `session_id` that doesn't exist yet is created on first use. |
Sessions expire **7 days** after their last write. A session holds at most **100 messages** — past that the store keeps only the most recent 50 — and once it passes 60 messages the older turns are compacted in the background into a summary plus the most recent 20. Session ids are scoped to your account; an unknown or foreign id returns `404 not_found`. `session_id` is not accepted on `/responses` or `/chat/completions` (`400 unsupported_parameter`).
# Smart routing
Source: https://docs.ninjachat.ai/smart-routing
Choose a model automatically, then optimize its provider rail for cost, latency, quality, and policy.
NinjaChat routes at two layers: `ninja/auto` chooses an eligible model for the workload, then `routing` chooses the best live provider rail for that model.
The router classifies each request into a task (`code`, `math`, `translate`, `summarize`, `reasoning`, `creative`, `analysis`, `factual`, `quick`, or `general`) — by regex, or by a small LLM classifier when the regex is inconclusive — looks up the quality bar for that task in a curated table, filters to models with a currently servable rail, and ranks the survivors by `routing.strategy`. If the top pick fails, the next candidate is tried inside the same request.
```mermaid theme={null}
flowchart LR
P["Your prompt"] --> D{"Task detection regex or LLM"}
D --> Q["Quality bar for the task"]
Q --> S{"routing.strategy"}
S -->|cost| A["Cheapest model that clears the bar"]
S -->|latency| B["Lowest measured p50"]
S -->|quality| C["Flagship first"]
S -->|balanced| E["Curated order"]
A --> R{"Live provider rail"}
B --> R
C --> R
E --> R
R --> O["Response + routing.router"]
```
`GET /api/v1/models/ninja/auto` lists the router's current candidate pool under `router.candidates`; the per-request ranking comes back on every response under `routing.router`.
```typescript TypeScript SDK theme={null}
const response = await client.responses.create({
model: "ninja/auto",
input: "Review this repository migration plan.",
routing: {
strategy: "balanced",
allow_fallbacks: true,
data_policy: "zero_retention",
},
});
console.log(response.routing.resolved_model);
console.log(response.provider, response.cost_usd);
```
```python Python SDK theme={null}
response = client.responses.create(
model="ninja/auto",
input="Review this repository migration plan.",
routing={
"strategy": "balanced",
"allow_fallbacks": True,
"data_policy": "zero_retention",
},
)
print(response["routing"]["resolved_model"])
print(response["provider"], response["cost_usd"])
```
```bash cURL theme={null}
curl https://www.ninjachat.ai/api/v1/responses \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model":"ninja/auto",
"input":"Review this repository migration plan.",
"routing":{"strategy":"balanced","allow_fallbacks":true,"data_policy":"zero_retention"}
}'
```
## Routing strategies
With `ninja/auto` the strategy picks the **model**; with a pinned model it orders the **provider rails** behind that model.
| Strategy | With `ninja/auto` (model choice) | With a pinned model (rail choice) | Reach for it when |
| ---------- | ----------------------------------------------------------------------------- | --------------------------------- | ----------------------------------------- |
| `balanced` | Curated order for the detected task | Overall production fit | Default application traffic |
| `cost` | Cheapest model that clears the task's quality bar, by reference-request price | Lowest eligible rail cost | High-volume extraction and classification |
| `latency` | Lowest p50 latency measured from live traffic | Lowest observed latency | Interactive chat and tool loops |
| `quality` | Flagship first | Highest-quality eligible rail | Final answers and complex agent work |
**Billing:** you pay the resolved model and provider rail's published rate for actual token usage. The response identifies both, so cost attribution stays explicit. See [Pricing](/pricing) for the live catalog.
## Provider controls
`routing.providers` lets you include, exclude, or order provider rails without changing the public model ID. `data_policy` filters rails before ranking, and `require_parameters` rejects rails that cannot honor every requested feature.
```typescript TypeScript SDK theme={null}
const response = await client.responses.create({
model: "claude-sonnet-5",
input: "Draft a production rollout plan.",
routing: {
strategy: "latency",
providers: {
only: ["anthropic", "deepinfra", "gmicloud"],
order: ["anthropic", "deepinfra"],
},
allow_fallbacks: true,
require_parameters: true,
max_cost_usd: 0.08,
},
});
```
The response always tells you what ran:
```json theme={null}
{
"model": "claude-sonnet-5",
"provider": "anthropic",
"routing": {
"strategy": "latency",
"requested_models": ["claude-sonnet-5"],
"resolved_model": "claude-sonnet-5",
"provider": "anthropic",
"fallbacks_allowed": true,
"data_policy": "default"
}
}
```
When the request was `ninja/auto`, `model` and `routing.resolved_model` carry the concrete model that served it, `routing.requested_models` keeps `["ninja/auto"]`, and a `router` block explains the decision:
```json theme={null}
{
"model": "gemini-3-flash",
"provider": "google",
"routing": {
"strategy": "balanced",
"requested_models": ["ninja/auto"],
"resolved_model": "gemini-3-flash",
"provider": "google",
"fallbacks_allowed": true,
"data_policy": "default",
"router": {
"id": "ninja/auto",
"task": "summarize",
"classified_by": "regex",
"override": null,
"reasoning": "...",
"candidates": ["gemini-3-flash", "..."],
"considered": ["..."]
}
}
}
```
`task` is one of the task types above, `classified_by` is `regex`, `llm`, or `llm-cached`, `candidates` is the ranked chain the router would try in order, and `considered` lists every model it evaluated with the reason it was kept or eliminated. The same block is persisted on the request trace (`GET /requests/{id}`).
## Current frontier choices
The router tracks the live catalog rather than a hard-coded marketing table. Current leading options you can pin directly include `gpt-5.6-sol`, `gpt-5.5-pro`, `claude-fable-5`, `claude-opus-5`, `claude-sonnet-5`, `gemini-3.7-flash`, `gemini-3.1-pro`, `grok-4.6`, `deepseek-v4-pro`, `glm-5.2`, `minimax-m2.7`, and `qwen3-coder-next`. Fetch `/models` at runtime when you need a user-facing picker.
## Pair it with
`routing.max_cost_usd` caps each request
Explicit order with automatic failover
Evaluate important outputs before acceptance
# Streaming
Source: https://docs.ninjachat.ai/streaming
Stream responses token-by-token over server-sent events.
Set `stream: true` to receive typed events as they arrive. The SDK handles SSE framing, partial chunks, and the final usage event for you.
## Request
```typescript theme={null}
const events = await client.responses.create({
model: "ninja/auto",
input: "Write a haiku about coding",
stream: true,
});
```
## Code examples
```typescript TypeScript SDK — Responses theme={null}
const events = await client.responses.create({
model: "ninja/auto",
input: "Write a haiku about coding",
stream: true,
});
for await (const event of events) {
if (event.type === "response.output_text.delta") {
process.stdout.write(event.delta ?? "");
}
}
```
```python Python SDK — Responses theme={null}
events = client.responses.create(
model="ninja/auto",
input="Write a haiku about coding",
stream=True,
)
for event in events:
if event.get("type") == "response.output_text.delta":
print(event.get("delta", ""), end="", flush=True)
```
```typescript TypeScript SDK — Chat Completions theme={null}
const chunks = await client.chat.completions.create({
model: "gpt-5.6-luna",
messages: [{ role: "user", content: "Write a haiku about coding" }],
stream: true,
stream_options: { include_usage: true },
});
for await (const chunk of chunks) {
process.stdout.write(chunk.choices[0]?.delta.content ?? "");
if (chunk.usage) {
console.log("\nTokens:", chunk.usage.total_tokens);
}
}
```
## SSE format
Both endpoints stream `text/event-stream`. While the gateway waits for the first token from a provider it may send **comment frames** — lines that begin with `:` — as keepalives. They carry no data: a spec-compliant SSE parser ignores them, and a hand-rolled parser must skip any line starting with `:` rather than trying to parse it as JSON.
### Responses
Each frame carries an `event:` name and a `data:` JSON object whose `type` repeats the name and whose `sequence_number` increases monotonically:
```
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_req_...","output_index":0,"content_index":0,"delta":"The","sequence_number":3}
```
| Event | When |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `response.created` | The stream opened; `response.status` is `in_progress` |
| `response.output_item.added` | A message item (`output_index` 0) or a function-call item begins |
| `response.content_part.added` | The text part of the message item begins |
| `response.output_text.delta` | A text delta in `delta` |
| `response.function_call_arguments.delta` | An arguments delta for a function-call item |
| `response.output_text.done` | The full `text` of the message |
| `response.content_part.done` | The completed text part |
| `response.output_item.done` | The completed message or function-call item |
| `response.function_call_arguments.done` | The full `arguments` for a function-call item |
| `response.completed` | The final `response` with `model`, `output_text`, `usage`, `cost_usd`, `provider`, `request_id`, and `routing` |
| `error` | An in-band failure: `{ "type": "error", "error": { "type", "code", "message" } }`. No `response.completed` follows |
The stream closes after `response.completed`; there is no `[DONE]` sentinel on this endpoint.
### Chat Completions
OpenAI-compatible `chat.completion.chunk` objects on `data:` lines, ending with `data: [DONE]`:
```
data: {"id":"chatcmpl_req_...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"The"},"finish_reason":null}]}
data: {"id":"chatcmpl_req_...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":" capital"},"finish_reason":null}]}
data: [DONE]
```
The final chunk — empty `delta`, `finish_reason` set — always carries the request receipt, whether or not you set `stream_options.include_usage`:
```json theme={null}
{
"id": "chatcmpl_req_...",
"object": "chat.completion.chunk",
"created": 1787529600,
"model": "gemini-3-flash",
"resolved_model": "gemini-3-flash",
"provider": "google",
"choices": [{ "index": 0, "delta": {}, "finish_reason": "stop" }],
"usage": {
"prompt_tokens": 14,
"completion_tokens": 8,
"total_tokens": 22,
"prompt_tokens_details": { "cached_tokens": 0, "cache_creation_tokens": 0 },
"completion_tokens_details": { "reasoning_tokens": 0 }
},
"cost_usd": 0.00003,
"request_id": "req_...",
"routing": {
"strategy": "balanced",
"requested_models": ["gemini-3-flash"],
"resolved_model": "gemini-3-flash",
"provider": "google",
"fallbacks_allowed": true,
"data_policy": "default"
}
}
```
If a provider fails after the HTTP status has been sent, the last data frame before `[DONE]` is an error object instead: `partial_stream` when some output was already delivered (only the delivered tokens are billed) or `stream_error` when nothing was (you are not charged).
## Billing
* Streaming uses the same metered rates as a non-streaming request and settles on the actual usage reported in the final frame.
* If you abort the connection mid-stream, only the tokens delivered before the abort are billed.
## Notes
* Use the SDK unless you specifically need to own the SSE parser.
* Abort TypeScript streams with `AbortSignal` in the request options.
# Video generation
Source: https://docs.ninjachat.ai/video-generation
Veo, Kling, and Seedance behind one endpoint. Submit, poll, get an MP4.
This is what \$1.20 buys — generated through this endpoint's models:
Video is **async**: submit a job, then poll its status — or register a signed webhook in [Developers → Webhooks](https://www.ninjachat.ai/developers/webhooks) and skip the loop. Either way you get an MP4 URL in one to a few minutes.
```mermaid theme={null}
flowchart LR
A["POST /api/v1/videos"] --> B["video id"]
B --> C{"GET /videos/{id} every 5s — free"}
C -->|processing| C
C -->|completed| D["video_url (MP4)"]
C -->|failed| E["Auto-refund"]
```
## The whole flow, copy-paste ready
```typescript TypeScript SDK theme={null}
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const job = await client.videos.generate({
model: "veo-3.1-fast",
prompt: "A timelapse of a flower blooming, macro lens, soft lighting",
duration: 6,
aspect_ratio: "16:9",
});
const video = await client.videos.waitFor(job.id);
console.log(video.video_url);
```
```python Python SDK theme={null}
import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
job = client.videos.generate(
model="veo-3.1-fast",
prompt="A timelapse of a flower blooming, macro lens, soft lighting",
duration=6,
aspect_ratio="16:9",
)
video = client.videos.wait_for(job["id"])
print(video["video_url"])
```
## Parameters
| Parameter | Default | Description |
| ------------------ | -------------- | ------------------------------------------------------------------------------------------- |
| `prompt` | required | Camera movement + subject action + style + lighting. Max 4,000 chars. |
| `model` | `veo-3.1-fast` | See table below. |
| `duration` | `8` | Integer seconds, 4–15. Values a given model supports within that range depend on the model. |
| `aspect_ratio` | `16:9` | `16:9` or `9:16` (ignored by Seedance 2). |
| `image_url` | — | Animate this still (public HTTPS) — that's how the film above was made. |
| `end_image_url` | — | Public HTTPS still to end on, for models that support first-and-last-frame generation. |
| `reference_images` | — | Up to 4 public HTTPS image URLs to guide subject/style (Seedance 2 only). |
| `reference_video` | — | Public HTTPS video URL to guide motion/POV framing (Seedance 2 only). |
| `reference_audio` | — | Public HTTPS audio URL to use as background music (Seedance 2 only). |
| `generate_audio` | `false` | Generate an audio track for the video (Seedance 2 only). |
| `watermark` | `false` | Overlay a watermark on the output (Seedance 2 only). |
Polling `GET /videos/{id}` is free and unlimited. Status moves `queued` → `processing` (with `progress`) → `completed` (with `video_url`) or `failed` (auto-refunded).
## Which model?
Prices are `pricing.perUnitUsd` per job from `GET /models` at the time of writing. Every servable video model:
| Model | ID | Cost | Best for |
| ---------------------- | ------------------------ | ------ | ----------------------------------------------------------- |
| Google Veo 2 | `google-veo-2` | \$4.00 | Legacy Veo workloads |
| Seedance 2 | `seedance-2` | \$3.64 | Longest clips, reference images/video/audio |
| Veo 3.1 | `veo-3.1` | \$3.20 | Best quality |
| Seedance Pro | `seedance-pro` | \$1.80 | Seedance's pro tier |
| Kling Video | `kling-video` | \$1.40 | Motion coherence |
| Veo 3.1 Fast | `veo-3.1-fast` | \$1.20 | The default — speed + quality |
| Google Veo 3 Fast | `google-veo-3-fast` | \$1.20 | Budget Veo |
| Runway Gen-4.5 | `runway-gen4.5` | \$1.20 | Runway at the Veo Fast price point |
| Grok Imagine Video 1.5 | `grok-imagine-video-1.5` | \$1.20 | xAI's newer video model |
| Grok Imagine Video | `grok-imagine-video` | \$0.75 | xAI's budget video model |
| Seedance 2.0 Fast | `seedance-2.0-fast` | \$0.63 | Promotional price (list \$0.84, 25% off through 2026-09-08) |
| Seedance Lite | `seedance-lite` | \$0.43 | Cheapest non-promotional clip |
| Seedance 2 Mini | `seedance-2-mini` | \$0.42 | Promotional price (list \$1.06, 60% off through 2026-09-08) |
Promotional prices come from `pricing.promotion` on the model record; `pricing.listPerUnitUsd` is what the model returns to when the promotion ends.
## Prompting for motion
| Weak | Strong |
| ----------- | -------------------------------------------------------------------------------------------------------------------- |
| `mountains` | `Drone shot slowly ascending over a misty mountain valley at golden hour, camera reveals a river below, cinematic` |
| `ocean` | `Underwater camera glides through a coral reef, bioluminescent creatures pulse with light, slow motion, documentary` |
The formula: **camera movement + subject action + style + lighting**.
Agents can run this whole flow conversationally — "animate the second one" — via the [MCP server](/mcp/tools).