> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ninjachat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.0002 – \$0.128/image                                                                      |
| Video                                                                          | \$0.42 – \$3.64/video (longest duration; shorter clips settle lower)                          |
| Search                                                                         | \$0.05/query                                                                                  |
| Model list, price sheet, cost estimates, video polling, balance, usage, health | Free                                                                                          |

Responses include the charged cost:

```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.

<Accordion title="Every model's exact price">
  ### 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) |
  | ------------------- | ------------- | -------------------- | -------------- | ---------------------------------- |
  | `gpt-5.6-sol`       | 4             | 0.4                  | 20             | over 272K: 8 / 30                  |
  | `gpt-5.6-terra`     | 2             | 0.2                  | 12             | —                                  |
  | `gpt-5.6-luna`      | 0.2           | 0.02                 | 1.2            | —                                  |
  | `gpt-5.5-pro`       | 30            | 30                   | 180            | over 272K: 60 / 270                |
  | `gpt-5.4`           | 2.5           | 0.25                 | 15             | over 272K: 5 / 22.5                |
  | `claude-fable-5`    | 10            | 1                    | 50             | —                                  |
  | `claude-opus-5`     | 5             | 0.5                  | 25             | —                                  |
  | `claude-sonnet-5`   | 2             | 0.2                  | 10             | —                                  |
  | `claude-sonnet-4.6` | 3             | 0.3                  | 15             | —                                  |
  | `claude-haiku-4.5`  | 1             | 0.1                  | 5              | —                                  |
  | `gemini-3.7-flash`  | 1.5           | 0.15                 | 7.5            | —                                  |
  | `gemini-3.1-pro`    | 2             | 0.2                  | 12             | over 200K: 4 / 18                  |
  | `grok-4.6`          | 2             | 0.2                  | 6              | —                                  |
  | `deepseek-v4-pro`   | 1.74          | 0.174                | 3.48           | —                                  |
  | `deepseek-v4-flash` | 0.14          | 0.014                | 0.28           | —                                  |
  | `glm-5.2`           | 1.4           | 0.14                 | 4.4            | —                                  |
  | `minimax-m2.7`      | 0.3           | 0.03                 | 1.2            | —                                  |
  | `qwen3-coder-next`  | 0.2           | 0.02                 | 1.5            | —                                  |
  | `ninja-1`           | 0.25          | 0.05                 | 2              | over 128K: 0.5 / 4                 |

  Those are the models most people start with. **All 169 chat models are priced** — read [`GET /api/v1/pricing`](#live-price-sheet) for the complete machine-readable sheet, or open any model's page from [Models](/models) for its own rate. Those are the numbers that bill you; this table is a convenience copy of a handful of them.

  `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` `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                                                  |
  | ------ | ------------------------------------------------------- |
  | \$3.64 | `seedance-2`                                            |
  | \$3.47 | `seedance-2.5`                                          |
  | \$3.20 | `veo-3.1`                                               |
  | \$1.80 | `seedance-pro`                                          |
  | \$1.40 | `kling-video`                                           |
  | \$1.20 | `veo-3.1-fast` `runway-gen4.5` `grok-imagine-video-1.5` |
  | \$1.06 | `seedance-2-mini`                                       |
  | \$1.05 | `gemini-omni-flash`                                     |
  | \$0.84 | `seedance-2.0-fast`                                     |
  | \$0.75 | `grok-imagine-video`                                    |
  | \$0.43 | `seedance-lite`                                         |

  A `seedance-2.5` request that attaches `reference_video` is \$14.52 (the provider bills a video input at four times the clip rate); `GET /pricing` reports it as `per_video_with_reference_video_cents`.

  Revising a finished `gemini-omni-flash` clip in place (`video_id` on `POST /videos`) is \$1.15 per edit and \$1.35 per extension — the clip is carried as context on top of the seconds rendered.

  Failed video jobs are refunded automatically.

  ### Search — `POST /api/v1/search`

  \$0.05 per query.
</Accordion>

## 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", "basis": "max_duration" }],
  "search": { "per_query_cents": 5, "per_query": "$0.05" },
  "cache_hit_fraction": null,
  "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.
* **Caching — two different things, priced differently.** NinjaChat runs **no response cache**: send the same request twice and it executes twice and bills twice. What you can use is the **provider's prompt cache** — set `routing.caching: "auto"`, and input tokens that hit the provider's cache bill at `metered_cached_input_per_mtok` instead of `metered_input_per_mtok`. `cache_hit_fraction` is deprecated and always `null`; it described a response-cache discount that no longer exists.
* **Video prices are ceilings.** `per_video_cents` is the model's longest accepted duration (`basis: "max_duration"`), not a typical charge. Shorter requests settle lower — per-second models bill each second up to their cap, bucketed models (Veo, Kling) bill the nearest supported length. Each model's [`GET /models`](/models) record carries its per-second rate and duration bounds — price a specific duration from those. [`POST /estimate`](/estimate) prices chat only.
* 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

<CardGroup cols={2}>
  <Card title="Cap each request" icon="calculator" href="/budget-routing">
    Use `routing.max_cost_usd` with an explicit model or `ninja/auto`.
  </Card>

  <Card title="Warnings before walls" icon="bell">
    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.
  </Card>

  <Card title="Failures don't bill" icon="rotate-left">
    Failed generated requests are not charged. Failed video jobs are refunded automatically.
  </Card>

  <Card title="Watch it live" icon="chart-line" href="https://www.ninjachat.ai/developers/usage">
    Per-request logs and spend in the console.
  </Card>
</CardGroup>

## 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"])
```
