# Pricing

You pay for input tokens: **$0.042 per million input tokens** (that is $42 per billion). Output is free. This is the same way TypeSafe prices Jev, at the same price. Jepela is for business customers; prices exclude VAT and other taxes, which are added where the law requires.

Input tokens are what the engine read to answer: the state, your questions and their options, and the memory lines it recalled for the subject. `usage.input_tokens` in every answer is the engine's own count, never an estimate, and `usage.output_tokens` is always 0, because Jepela does not generate text.

Memory writes (`remember`, rules) are free; the lines are paid for as input when a decision reads them.

## How it is counted

The engine reads the state once per question, so a request with three questions reads it three times. Measured on 2026-09-24 through `https://api.jepela.com` with `jepela-english`, a 74-character support message:

| Request | `input_tokens` | Cost at $0.042 per million (arithmetic) |
|---|---|---|
| one yes/no question | 47 | $0.000002 |
| three questions (choice, yes/no, score) | 128 | $0.0000054 |
| the same three, with a state four times as long | 245 | $0.0000103 |
| the same three with `"robust": true` | 208 | $0.0000087 |

- `"robust": true` reads each choice once per option order, `"windows": true` reads every window, and a choice with more than 20 options read by the engine (`"method": "engine"`) is read in two rounds; all of that is in the engine's count and billed.
- A matched choice (more than 20 options, the default; see Request options) is billed for the tokens it read: the state and its memory lines, not the options. Measured on a 77-option choice: 23 tokens matched against 812 read by the engine.
- `"memory": {"compare": true}` (the same call without memory), `"memory": {"explain": true}` (one pass per memory line left out) and `"memory": {"placebo": true}` (the neutral pass) are extra passes that are not billed.
- A cache hit is billed like the first call; `usage.cached` says it cost no engine work.

Every priced request is one line in your tenant's ledger with the time, the route, the counts and the cost, and is charged against your prepaid credit at once. `GET /v1/usage` returns credited, spent, balance, requests, the prices, your rate limit, your key ids, the ledger totals and the last twenty lines; the totals and the balance always agree. A request that fails upstream (502) or in the gateway (500) is not charged.

Fine-tuning is free during the preview; a fine-tuned model's decisions are billed like any other (see Fine-tuning).

## Credit

Jepela adds credit to your tenant after a payment. When the balance is zero or below, priced requests answer 402 until credit is added; `GET` routes still work so you can see the account.

## Rate limits

Each key has a limit of requests per minute, set for its tenant (default 600; 60 for a tenant made by sign-up). Over it, 429 with `Retry-After`.
