# NinjaChat API — full facts for agents

# NinjaChat API

> All-in-one OpenAI-compatible AI API: every major lab (OpenAI, Anthropic, Google, Black Forest Labs, and more), chat + image + video, one prepaid key, automatic failover, no lock-in.

NinjaChat is a unified inference API at https://www.ninjachat.ai/api/v1. Authentication is `Authorization: Bearer nj_sk_...`. Always call the **www** host — the apex redirects and most HTTP clients drop the Authorization header on that redirect.

There is no lab lock-in: switch models by changing the `model` string. If a provider degrades, ranked providers fail over automatically. Image and video generation use the same key as chat.

## Product

- [One API for all of AI](https://www.ninjachat.ai/ai-api): Chat, image, video, search — one key, OpenAI SDK compatible
- [Model catalog](https://www.ninjachat.ai/api-models): 173 chat + 53 image + 43 video models, live specs and playground
- [Provider network](https://www.ninjachat.ai/api-models/providers): Uptime, latency, data-training policy per provider
- [Live benchmarks](https://www.ninjachat.ai/benchmarks): Provider speed and reliability leaderboards
- [API status](https://www.ninjachat.ai/status): Measured health per model, updated every minute
- [Switch to NinjaChat](https://www.ninjachat.ai/migrate): Guides if you already call another provider
- [Inference bill](https://www.ninjachat.ai/inference-bill): For teams spending $5k+/month
- [Webhooks](https://www.ninjachat.ai/developers/webhooks): Signed POST when a video job finishes or a spend limit is crossed — skip polling
- [Documentation](https://docs.ninjachat.ai): Full reference
- [OpenAPI 3.1](https://www.ninjachat.ai/openapi.json): Machine-readable spec; also GET /api/v1/openapi
- [Live catalog JSON](https://www.ninjachat.ai/api/v1/models): Public, no auth — models include prices
- [AGENTS.md](https://www.ninjachat.ai/AGENTS.md): Skill file for Cursor, Codex, Copilot, Claude Code. MCP + REST. Keys at /developers
- [Preset skills](https://www.ninjachat.ai/presets/@{slug}.md): Fetch the file, then wire that @slug on /chat/completions

## Model pages

One developer page per model at /api-models/{id} (live price, providers, latency, playground, one model-specific request) and one consumer page per model at /models/{slug} (chat free to start, real outputs). Advanced implementation guides live in the documentation rather than being repeated across model landing pages. Recently added:

- [Claude Opus 5](https://www.ninjachat.ai/api-models/claude-opus-5): Anthropic frontier model; consumer page /models/claude-opus-5
- [GPT-5.6 Sol / Terra / Luna](https://www.ninjachat.ai/api-models/gpt-5.6-sol): OpenAI's three GPT-5.6 sizes; also /api-models/gpt-5.6-terra and /api-models/gpt-5.6-luna
- [GPT-5.5](https://www.ninjachat.ai/api-models/gpt-5.5): OpenAI generalist; consumer page /models/gpt-5-5
- [Kimi K3](https://www.ninjachat.ai/api-models/kimi-k3): Moonshot open-weights model; consumer page /models/kimi-k3
- [Gemini 3.7 Flash](https://www.ninjachat.ai/api-models/gemini-3.7-flash): Google fast tier; consumer page /models/gemini-3-7-flash
- [GLM-5.2](https://www.ninjachat.ai/api-models/glm-5.2): Z.ai open-weights agent model; consumer page /models/glm-5-2
- [gpt-oss-120b](https://www.ninjachat.ai/api-models/gpt-oss-120b): OpenAI open-weights (Apache 2.0); consumer page /models/gpt-oss-120b
- [Seedance 2.0](https://www.ninjachat.ai/api-models/seedance-2): ByteDance video with references and audio; consumer page /seedance
- [Veo 3.1](https://www.ninjachat.ai/google-veo-api): Google video API with native audio; consumer page /veo-3-1
- [Nano Banana Pro](https://www.ninjachat.ai/api-models/nano-banana-pro): Google image model; consumer page /models/nano-banana-pro

## Optional longer file

- [Full API facts for agents](https://www.ninjachat.ai/llms-full.txt)

## MCP

- [Hosted MCP server](https://www.ninjachat.ai/mcp): Chat, image, video, and search tools for agents
- [MCP for Cursor](https://www.ninjachat.ai/mcp/cursor)
- [MCP for Claude](https://www.ninjachat.ai/mcp/claude)
- [MCP endpoint](https://www.ninjachat.ai/api/mcp)

## Compare / switch

- [OpenAI API alternative](https://www.ninjachat.ai/openai-api-alternative)
- [Replicate alternative](https://www.ninjachat.ai/replicate-alternative)
- [Migrate from OpenAI](https://www.ninjachat.ai/openai-api-alternative#migration): Keep GPT. Claude, Gemini, image, and video join the same key.
- [Migrate from Anthropic](https://www.ninjachat.ai/migrate/anthropic): Keep Claude. GPT, Gemini, image, and video without a second SDK.
- [Migrate from OpenRouter](https://www.ninjachat.ai/migrate/openrouter): Same SDK. Chat, image, and video on one prepaid balance.
- [Migrate from Replicate](https://www.ninjachat.ai/migrate/replicate): Keep FLUX, Veo, and Kling. Chat from every lab on the same key.
- [Migrate from fal.ai](https://www.ninjachat.ai/migrate/fal): Keep FLUX and Kling. Chat from OpenAI, Anthropic, and Gemini joins.
- [Migrate from Together AI](https://www.ninjachat.ai/migrate/together): Keep DeepSeek and Qwen. Add GPT, Claude, Gemini, and video.
- [Migrate from Fireworks AI](https://www.ninjachat.ai/migrate/fireworks): Keep the open models. Add every closed lab on the same call.


## Quickstart (official SDKs)

TypeScript:

```bash
npm install @ninjachat/sdk
```

```typescript
import { NinjaChat } from "@ninjachat/sdk";

const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const response = await client.responses.create({
  model: "claude-sonnet-4.6",
  input: "Hello",
});

console.log(response.output_text);
```

Python:

```bash
pip install ninjachat
```

```python
import os
from ninjachat import NinjaChat

client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
response = client.responses.create(
    model="claude-sonnet-4.6",
    input="Hello",
)
print(response["output_text"])
```

The official SDKs read the key you pass as `NINJACHAT_API_KEY` and already use https://www.ninjachat.ai/api/v1. OpenAI-compatible clients may instead set `OPENAI_API_KEY=nj_sk_...` and `OPENAI_BASE_URL=https://www.ninjachat.ai/api/v1`.

## Endpoints

Authenticated (Bearer nj_sk_):

- POST https://www.ninjachat.ai/api/v1/chat/completions — OpenAI-compatible chat
- POST https://www.ninjachat.ai/api/v1/responses — OpenAI-compatible responses
- POST https://www.ninjachat.ai/api/v1/images/generations — synchronous image generation
- POST https://www.ninjachat.ai/api/v1/videos — submit a video job; poll GET /videos/{id} or register a webhook
- POST https://www.ninjachat.ai/api/v1/search — AI-augmented web search
- GET/POST/DELETE https://www.ninjachat.ai/api/v1/webhooks — signed callbacks for video completion and spend alerts. Register at https://www.ninjachat.ai/developers/webhooks
- GET  https://www.ninjachat.ai/api/v1/webhooks/deliveries, POST /webhooks/test
- GET  https://www.ninjachat.ai/api/v1/balance, /usage, /requests/{id}, /health

Public (no auth):

- GET https://www.ninjachat.ai/api/v1/models
- GET https://www.ninjachat.ai/api/v1/openapi
- GET https://www.ninjachat.ai/openapi.json

## Chat models (173)

gpt-5-mini, gemini-3-flash, gemini-2.5-flash, deepseek-v3, llama-4-scout, qwq-32b, minimax-m2.5, glm-5, ninja-1, gpt-5.4, gpt-5.4-pro, gpt-5, o3-mini, grok-4, mistral-large, claude-sonnet-4.5, claude-haiku-4.5, gemini-2.5-pro, gemini-3-pro, gemini-3.1-pro, llama-4-maverick, kimi-k2.5, claude-sonnet-4.6, claude-opus-4.6, gpt-6-astra, deepseek-v4-flash-vision-exp, gpt-5.6-luna, gpt-5.6-terra, gpt-5.6-sol, gpt-5.5, gpt-5.5-pro, gpt-5.4-mini, gpt-5.4-nano, claude-opus-4.7, claude-sonnet-5, claude-opus-5, claude-fable-5, claude-opus-4.8, gemini-3.8-flash, gemini-3.7-flash, gemini-2.5-flash-lite, gemini-3.5-flash-lite, grok-4.6, deepseek-v4-flash-0731, deepseek-v4-pro-0813, qwen-3.8-max, longcat-2.0, nex-n2-pro, kimi-k3, kimi-k3-fast, minimax-m3, gpt-oss-120b, nemotron-3.5-lightning, nemotron-3-nano, llama-3.3-70b, qwen3-vl-30b-a3b, qwen3-vl-235b-a22b, qwen3-vl-32b-instruct, nemotron-nano-12b-v2-vl, nemotron-3-nano-omni, glm-5.3, glm-5.3-flash, glm-5.2, glm-5.2-fast, glm-5.1, qwen-3.8-27b, qwen-3.8-2.4t, qwen-3.7-flash, qwen-3.7-plus, qwen-3.7-max, qwen-3.6-flash, qwen-3.6-plus, kimi-k2.6, kimi-k2.7-code, kimi-k2.7-code-fast, minimax-m2.7, minimax-m2.7-turbo, gpt-oss-20b, nemotron-3-ultra, muse-glimmer-30b, inkling, inkling-small, mistral-large-3, mistral-medium-3.5, mistral-small-4, ministral-3-3b, ministral-3-8b, ministral-3-14b, codestral-2508, mimo-v2.5, mimo-v2.5-pro, hy4-preview, hy3, gemma-4-31b, gemma-4-31b-ultra, gemma-4-26b-a4b, glm-4.7-flash, qwen-3.6-27b, qwen-3.6-35b-a3b, qwen3-next-80b-a3b, gemini-3.6-flash, grok-4.5, step-3.7-flash, deepseek-v3.2, deepseek-r1-0528, ling-3.0-flash-fin, ling-3.0-flash, qwen-3.5-flash, nemotron-3-super, qwen-3.5-27b, qwen-3.5-122b-a10b, qwen-3.5-397b-a17b, glm-4.7, seed-2.1-turbo, seed-2.0-mini, seed-2.0-pro, seed-2.0-code, deepseek-v4-flash, deepseek-v4-pro, gemini-3.5-flash, gemini-3.1-flash-lite, qwen-3.5-35b-a3b, qwen3-coder-next, qwen3-235b-instruct, qwen-3.5-9b, gemma-3-4b, gemma-3-27b, llama-3.1-8b, mistral-nemo-12b, mistral-nemo-12b-tee, phi-4, mistral-small-24b, gemma-4-e4b, nemotron-nano-9b-v2, gpt-oss-120b-turbo, gpt-oss-120b-ultra, gemma-4-31b-turbo, mistral-small-3.2-24b, gemma-3-12b, grok-4.20, grok-4.20-fast, grok-build-0.1, grok-4.3, north-mini-code, command-r7b, command-r, command-a, laguna-xs-2.1, qwen3-coder-480b-turbo, qwen3-max, qwen3-max-thinking, gpt-4.1, gpt-4.1-mini, gpt-5-nano, gpt-5.3-codex, deepseek-v3.1, qwen3-32b, seed-1.8, glm-4.6, qwen3-14b, qwen3-30b-a3b, deepseek-v3-0324, llama-3.1-70b, qwen-2.5-72b, solar-pro4, gpt-4o-mini, qwen3-4b-instruct-2507, qwen3-4b-thinking-2507, qwen2.5-coder-7b, qwen2.5-coder-3b, claude-fable-5.1, qwen-3.8-flash, qwen-3.8-flash-next

Spec pages: https://www.ninjachat.ai/api-models/{id}

## Image models (53)

nova-canvas, runway-gen4-image-turbo, seedream, recraft-v3, google-imagen-4, nano-banana, nano-banana-2, nano-banana-pro, flux-2-klein, flux-2-pro, flux-2-max, flux-2-flex, flux-schnell, flux-kontext-pro, flux-kontext-max, flux-1-pro-ultra, flux-1.1-pro, flux-1-dev, flux-1-fill, qwen-image-3, qwen-image-max, seedream-4.5, seedream-5-lite, seedream-5-pro, flux-2-klein-4b, flux-2-klein-9b, sdxl-turbo, pruna-p-image, wan-2.6-image, nano-banana-2-lite, bria-fibo, bria-3.2, qwen-image-edit-max, wan-2.7-image-edit, z-image-turbo, qwen-image-2512, flux-2-dev, stable-diffusion-3.5-large, qwen-image-edit-plus, hidream-l1-fast, flux-krea-dev, qwen-image-edit-2511, flux-kontext-dev, grok-imagine, grok-imagine-image-2.0, grok-imagine-image-quality, gpt-image-2, ideogram-v3-quality, ideogram-v3-turbo, google-imagen-4-ultra, google-imagen-4-fast, luma-photon, minimax-image-01

## Video models (43)

nova-reel, runway-gen4.5, flux-3-video, minimax-h3, hailuo-2.3, hailuo-2.3-fast, happyhorse-1.1, ray-3.2, seedance-2.5, seedance-2, seedance-2.0-fast, seedance-2-mini, seedance-2.0, seedance-1.5-pro, seedance-lite, seedance-pro, grok-imagine-video, grok-imagine-video-1.5, kling-2.5-turbo, kling-3, kling-3-pro, kling-3-turbo, kling-3-omni, wan-2.7, wan-2.7-i2v, wan-2.7-r2v, wan-2.6, wan-2.6-i2v, wan-2.2-t2v-a14b, fast-wan-2.2, fast-wan-qad, pruna-p-video, pixverse-6, pixverse-6-i2v, cosmos-3-nano, cosmos-3-super, vidu-q3, veo-3.1, veo-3.1-fast, gemini-omni-flash, kling-video, google-veo-2, google-veo-3-fast

## Pricing (do not invent numbers)

Prices live on GET https://www.ninjachat.ai/api/v1/models, generated from the same code that charges. Chat bills published metered $/MTok. Images and video bill per generation. Failed requests are refunded automatically.

## FAQ

### What is the NinjaChat API?

NinjaChat is an all-in-one AI API for chat, image, and video generation behind one OpenAI-compatible endpoint, one prepaid key, and automatic provider failover.

### Is the NinjaChat API compatible with the OpenAI SDK?

Yes. Point base_url at https://www.ninjachat.ai/api/v1 and use an nj_sk_ key. Streaming, tool calls, JSON modes, and models.list work.

### Does NinjaChat include image and video generation?

Yes. The same key calls POST /v1/chat/completions, POST /v1/images/generations, and POST /v1/videos. Video jobs are asynchronous and can be polled or delivered to a webhook.

### How is the NinjaChat API priced?

Chat is billed per token; images and video are billed per generation. Current prices are returned by GET /api/v1/models without authentication.

### Where are the API specification and live model catalog?

OpenAPI 3.1 is at https://www.ninjachat.ai/openapi.json. The public model catalog is at https://www.ninjachat.ai/api/v1/models and the documentation is at https://docs.ninjachat.ai.
