Skip to main content
curl -X POST https://ninjachat.ai/api/v1/chat \
  -H "Authorization: Bearer nj_sk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "auto", "messages": [{"role": "user", "content": "Hello!"}]}'
One API key. GPT-5, Claude, Gemini, and more models. Set model to auto and NinjaChat picks the best model for each task — or use model: "gpt-5" to pick explicitly.

Core endpoints

EndpointWhat it doesGuide
POST /api/v1/chatText generation with smart routing, fallback chains, sessionsChat →
POST /api/v1/compareRun one prompt against N models, ranked by quality/speed/costCompare →
POST /api/v1/batchUp to 20 prompts in parallel — one API callBatch →
GET /api/v1/modelsLive model catalog with metadataModels →
POST /api/v1/estimatePre-flight cost estimation — free, no credits deductedEstimate →
POST /api/v1/sessionsCreate persistent conversation sessionsSessions →
POST /api/v1/imagesImage generation with 13 modelsImages →
POST /api/v1/videoVideo generation with 8 modelsVideo →
POST /api/v1/searchWeb search + AI answersSearch →

Get started in minutes

1

Get an API key

Go to your Developers dashboard and create a key. First 50 requests are free — no credit card required.
2

Make your first request

Copy the curl above, replace nj_sk_YOUR_API_KEY, and run it in your terminal. Full quickstart →
3

Explore power features

Try smart routing to auto-select models, compare to benchmark models, or batch to run multiple prompts in one call.
Want to try before coding? The API Playground lets you test all models and features in your browser.

What makes NinjaChat different

Every other API gives you one model at a time, stateless, with no intelligence about which model to use. NinjaChat adds a layer on top:
┌──────────────────────────────────────────────────────────────┐
│                    Your application                           │
└─────────────────────────┬────────────────────────────────────┘
                          │  one API key
┌─────────────────────────▼────────────────────────────────────┐
│                    NinjaChat API                              │
│                                                              │
│  Smart Routing   │  Model Compare  │  Batch Processing       │
│  auto → best     │  rank N models  │  20 prompts at once     │
│  model/task      │  simultaneously │                         │
│                  │                                           │
│  Fallback Chains │  Ensemble       │  Persistent Sessions    │
│  a>b>c           │  3 models vote, │  7-day memory, auto     │
│  resilient AI    │  1 synthesizes  │  context injection      │
│                  │                                           │
│  Budget Routing  │  Quality Scores │  Response Caching       │
│  best model      │  0-1 confidence │  instant repeat         │
│  within N cents  │  auto-retry     │  responses, free        │
└──────────────────┴─────────────────┴─────────────────────────┘
          │              │               │              │
         GPT-5       Claude         Gemini         DeepSeek
         o3-mini      Opus          Flash          Llama 4
         ...          ...           ...            ...

How billing works

Every response includes cost and balance:
{
  "choices": [{"message": {"role": "assistant", "content": "..."}}],
  "cost": {"this_request": "$0.006"},
  "balance": "$4.820"
}
No subscriptions. No per-token pricing. Flat per-request rates. Full pricing →