Torki API

Thinking Models: Stellar and Cosmos

3 min read · Checked against the product on 3 November 2026

Overview

torki-stellar and torki-cosmos think before they answer, with the same room to think as in the Torki app. Thinking makes them better at analysis, code and multi-step problems, and it changes how max_tokens, billing, timeouts and rate limits work. torki-pulse and torki-orbit don't think.

The thinking budget

  • Stellar thinks with up to 72K tokens (73,728) and Cosmos with up to 100K (102,400), less whatever your prompt takes of the 131,072-token context window — whatever max_tokens says.
  • max_tokens (or max_completion_tokens) limits the visible answer — content and tool-call arguments — not the thinking. When the answer reaches it, it stops with finish_reason: "length". Send none and the answer may use the whole budget.
  • Thinking tokens bill as output. They are included in usage.completion_tokens and are never charged twice.

Reading the reasoning

The thinking comes back in reasoning_content — on the message, or on each streamed delta — next to the answer in content. It is always called reasoning_content, never reasoning.

resp = client.chat.completions.create(
    model="torki-stellar",
    messages=[{"role": "user", "content": "Is 391 a prime number?"}],
)
msg = resp.choices[0].message
print(getattr(msg, "reasoning_content", None))   # the thinking
print(msg.content)                               # the answer

Turning thinking off

Send "thinking": false on Stellar or Cosmos for faster, cheaper answers. It is a Torki addition to the request, so in the OpenAI Python SDK pass it in extra_body:

resp = client.chat.completions.create(
    model="torki-cosmos",
    messages=[{"role": "user", "content": "Summarise this paragraph in one line: ..."}],
    extra_body={"thinking": False},
)

Asking Pulse or Orbit to think is refused with a 400 that tells you to use torki-stellar or torki-cosmos.

When thinking runs out

If a model thinks through its whole budget without answering, the API answers once more without thinking, with your max_tokens as the answer's budget. The failed attempt is not charged, up to 5 times a day per organization (UTC): you pay only for the answer you get, and usage shows exactly that. After that it bills like normal tokens (input and output), on top of the answer, and usage includes it. Its tokens always count toward your rate limits. If you disconnect once the second answer has started, you pay at least its prompt.

  • A non-streaming response then carries the header x-torki-thinking-retry: 1.
  • In a stream, the reasoning you already received is followed by an SSE comment line, : x-torki-thinking-retry: 1, and then the answer, in the same stream. OpenAI SDKs ignore comment lines.

Credit, time and limits

Your balance must cover the whole budget

Before a thinking request starts, your credit must cover the prompt plus the whole thinking budget — about $0.27 on Stellar and $0.49 on Cosmos at list price — or it is refused with 402. You are charged only for what is produced.

Thinking takes time

A thinking request can take minutes. Use stream: true for long work, so tokens arrive as they are made, and allow a generous client timeout either way. If the model takes too long, the API returns 504 upstream_timeout: retry.

Rate limits

Stellar and Cosmos share their own rate limits, separate from Pulse and Orbit. Output tokens per minute (OTPM) count thinking too, so long thinks use a large share of a minute. See Usage Tiers and Rate Limits.

FAQ

Why did a short question cost so many output tokens?

The model thought before answering, and thinking bills as output. For simple tasks, use Pulse or Orbit, or send "thinking": false.

Why was my request refused with 402 when I had some credit?

A thinking request needs enough credit for the prompt plus the whole thinking budget before it starts, even though you pay only for what is produced. Add credit, or turn thinking off.

Can I see the thinking in Torki Platform?

No. Logs keep metadata only, so the thinking reaches only your code, in reasoning_content. The Usage page counts its tokens as output. The full detail is in the API reference.