Skip to content

Tokens and billing

This page explains which texts of a request are counted as tokens and billed. Prices are not written here: GET /v1/models lists the price of each model on your plan.

Currency. Prices, credits, the balance and the spend limit are in euros (EUR). The API gives amounts as plain numbers, without a currency sign or code: price.per_million in GET /v1/models and the estimated cost of a batch in 402 payment_required.

One rule for every model: the tokens of the texts you send, each counted once; nothing the service adds. Cordon takes no text of yours beyond the document, so for Cordon the rule counts the document alone. Each model counts with its own tokenizer; every response says what was counted in usage.input_tokens. Only a 200 answer is billed; see Errors.

usage.input_tokens of decider-mini is the sum of the tokens of:

  • the document, input.state, once, however many questions you ask. A state sent as a JSON object or array is counted as its JSON text;
  • for each question: its instructions;
  • for each question: the text of each criterion or option you give in criteria. A choice option without a description is counted by its name.

Not counted:

  • the JSON envelope: keys, braces, type, the question keys and the option names that have a description;
  • the default wording of a yes/no question (noul) asked without criteria;
  • the service’s own text around your document and questions;
  • the document read again for each question.

usage.output_tokens is always 0: the model chooses among your options and does not generate text.

usage.input_tokens of cordon-mini is the tokens of the document, input.state (or input.text). A question to Cordon names a kind of detection ("instructions": "ipi") instead of carrying your text, so it adds no tokens: the same document costs the same with or without input.questions. usage.output_tokens is 0.

A support ticket and two questions: a yes/no (noul) and a choice of three described options (choice).

Terminal window
curl -sS "https://api.inola.ai/v1/infer" \
-H "Authorization: Bearer $INOLA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "decider-mini", "input": {"state": "I was charged twice. Please fix this ASAP.", "questions": {"billing": {"type": "noul", "instructions": "Is this ticket about billing?"}, "category": {"type": "choice", "instructions": "What is this ticket about?", "criteria": {"billing": "payments and invoices", "technical": "the product does not work", "other": "anything else"}}}}}'
import os
import requests
API_URL = "https://api.inola.ai"
API_KEY = os.environ["INOLA_API_KEY"]
response = requests.post(
f"{API_URL}/v1/infer",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"model": "decider-mini",
"input": {
"state": "I was charged twice. Please fix this ASAP.",
"questions": {
"billing": {"type": "noul", "instructions": "Is this ticket about billing?"},
"category": {"type": "choice", "instructions": "What is this ticket about?",
"criteria": {"billing": "payments and invoices", "technical": "the product does not work", "other": "anything else"}},
},
},
},
timeout=30,
)
response.raise_for_status()
usage = response.json()["usage"]
print("input tokens", usage["input_tokens"], "tokens counted", usage["tokens"])
const API_URL = "https://api.inola.ai";
const response = await fetch(`${API_URL}/v1/infer`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.INOLA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
model: "decider-mini",
input: {
state: "I was charged twice. Please fix this ASAP.",
questions: {
billing: { type: "noul", instructions: "Is this ticket about billing?" },
category: { type: "choice", instructions: "What is this ticket about?",
criteria: { billing: "payments and invoices", technical: "the product does not work", other: "anything else" } },
},
},
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${response.status} ${error.code}: ${error.message}`);
}
const { usage } = await response.json();
console.log("input tokens", usage.input_tokens, "tokens counted", usage.tokens);

Response:

{
"id": "req_01JBXQ7M3T8K2V9R4N6PZC5HDA",
"model": "decider-mini",
"version": "1.3.0",
"output_schema_id": "decision.v1",
"output": {
"answers": {
"billing": {"type": "noul", "noul": 0.97},
"category": {"type": "choice", "choice": "billing", "probabilities": {"billing": 0.95, "technical": 0.03, "other": 0.02}}
}
},
"usage": {"input_tokens": 32, "output_tokens": 0, "tokens": 32, "latency_ms": 62},
"created_at": "2026-11-16T12:00:00Z"
}

The 32 input tokens:

textwhere in the requesttokens
I was charged twice. Please fix this ASAP.state10
Is this ticket about billing?questions.billing.instructions6
What is this ticket about?questions.category.instructions6
payments and invoicesquestions.category.criteria.billing3
the product does not workquestions.category.criteria.technical5
anything elsequestions.category.criteria.other2
totalusage.input_tokens32

The document is counted once for both questions; the keys, the type fields and the rest of the JSON are not counted. A third question would add only its own texts.

One document checked by Cordon, with a question named page:

Terminal window
curl -sS "https://api.inola.ai/v1/infer" \
-H "Authorization: Bearer $INOLA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "cordon-mini", "input": {"state": "Meeting notes, 14 October: the vendor contract renews on 1 March.", "questions": {"page": {"type": "noul", "instructions": "ipi"}}}}'
import os
import requests
API_URL = "https://api.inola.ai"
API_KEY = os.environ["INOLA_API_KEY"]
response = requests.post(
f"{API_URL}/v1/infer",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"model": "cordon-mini",
"input": {
"state": "Meeting notes, 14 October: the vendor contract renews on 1 March.",
"questions": {"page": {"type": "noul", "instructions": "ipi"}},
},
},
timeout=30,
)
response.raise_for_status()
usage = response.json()["usage"]
print("input tokens", usage["input_tokens"], "tokens counted", usage["tokens"])
const API_URL = "https://api.inola.ai";
const response = await fetch(`${API_URL}/v1/infer`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.INOLA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
model: "cordon-mini",
input: {
state: "Meeting notes, 14 October: the vendor contract renews on 1 March.",
questions: { page: { type: "noul", instructions: "ipi" } },
},
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${response.status} ${error.code}: ${error.message}`);
}
const { usage } = await response.json();
console.log("input tokens", usage.input_tokens, "tokens counted", usage.tokens);

Response:

{
"id": "req_01JBXV8M0P2R4T6W8Y0A2C4E6G",
"model": "cordon-mini",
"version": "2.2.1",
"output_schema_id": "decision.v1",
"output": {"answers": {"page": {"type": "noul", "noul": 0.01, "threshold": 0.5, "verdict": false, "verdicts": {"fpr_1e-03": false, "fpr_1e-04": false}}}},
"usage": {"input_tokens": 16, "output_tokens": 0, "tokens": 16, "latency_ms": 35},
"created_at": "2026-11-01T12:00:00Z"
}

All 16 input tokens are the document’s. The question page adds none: without input.questions the same document is answered under injection and gives the same usage.

Every POST /v1/infer response carries usage: input_tokens, the basis of billing; output_tokens, 0 for decider-mini and cordon-mini; tokens, the input tokens counted against the token limits of your plan; latency_ms, the processing time.

POST /v1/chat/completions reports the same counts in the OpenAI form: usage.prompt_tokens is input_tokens, usage.completion_tokens is output_tokens.

Usage by day, model and key is in the console (Usage).

A real-time request shorter than the model’s minimum is billed as the minimum; usage still shows the tokens counted. The minimum, if a model has one, is price.min_tokens_per_request in GET /v1/models. Batch items have no minimum.

  • Items are counted by the same rule and billed at price.batch_pct of the real-time price (GET /v1/models).
  • Only completed items are billed; items in the error file are not.
  • When a batch is cancelled, items answered before it are billed; items not started are not run or billed.

Only a 200 answer is billed; no error answer is.

statuscodesbilled
200—yes: usage.input_tokens at the model’s price (at least the minimum, if any)
400, 401, 402, 403, 404, 410, 413every codeno
429every code, among them overloaded, maintenance, serverless_coldno
500, 503every codeno
  • If the service does not get the model’s answer in time, the request ends with 503 unavailable and is not billed.
  • A request is not cancelled when your client closes the connection or stops waiting. If the model answers it, it is billed as a successful request, even though your client did not receive the answer. Set your client’s timeout longer than the time the model needs, and retry only after an error answer.

Each code is explained in Error codes.

Use beyond the plan is paid from credits. Allowances and the spend limit are in the console (https://console.inola.ai, Billing). With no credits left, requests return 402 payment_required; at a limit, 429 monthly_token_limit or 429 spend_limit_reached.