BETA

Docs
Documentation

Reasoning & Thinking Fields

Some catalog models attach intermediate reasoning to the response alongside the final answer. Field names follow the upstream provider — there is no single Apily-defined shape.

Requesting reasoning effort

/v1/* is a generic JSON proxy — every field you send is forwarded to the upstream provider unmodified, including provider-specific ones like reasoning_effort. Set it when your model supports it; unsupported fields are ignored or rejected by that provider, not by Apily.

Thinking tokens bill as ordinary output tokens. With a high reasoning effort, the first token can take noticeably longer — that's expected, not a stuck request.

Common response shapes

OpenAI-compatible providers commonly add fields on choices[].message:

response.json
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Final answer…",
        "reasoning_content": "Intermediate reasoning…"
      }
    }
  ]
}

In streaming mode, reasoning deltas typically arrive before the final content deltas, ending the same way as any other stream with data: [DONE]. Accumulate each field separately — don't merge reasoning text into the answer you show the end user.

Integration tips

  • Show content only in end-user UI by default; keep reasoning collapsed or hidden.
  • Log reasoning_content for debugging/audit only — mind privacy and log size, it can be long.
  • If the field is absent for a given model, fall back to rendering content alone.