Zum Inhalt springen
PeakPrivacyDocs
AnwendenVerwaltenEinführenSicherheit & DatenschutzEntwickler

Reasoning

Set how much a model thinks before it answers and read its reasoning, with tested support per model and endpoint.

Als Markdown anzeigen

Reasoning models work through a problem before they answer. Through the API you can set how much effort a model puts into that, and read the reasoning it returns. What works depends on the model and the endpoint. The table below was tested against the live API on 11.11.2026.

When reasoning helps

Reasoning pays off when the answer depends on several steps that build on each other:

  • calculations and allocations (split a bill, prorate a fee, check a total)
  • dates and schedules (deadlines, timetables, notice periods)
  • rules with exceptions (does this expense qualify under the policy?)
  • planning, comparing options, and code

It adds little to tasks a model does in one pass: translating, summarising, rewording, classifying short texts or pulling fields out of a document. There, a model without reasoning, or low effort, is faster and cheaper with the same result.

Quick start

curl https://api.peakprivacy.ch/v1/ai/chat/completions \
  -H "Authorization: Bearer $PEAKPRIVACY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "model": "gpt-swiss",
    "messages": [
      {"role": "user", "content": "Anna pays twice what Ben pays. Ben pays 6 more than Cora. Together they pay 94. How much does Cora pay?"}
    ],
    "reasoning_effort": "high"
  }'

The reasoning comes back next to the answer:

{
  "model": "gpt-swiss",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "reasoning_content": "Let C be Cora's share. Ben pays C + 6, Anna 2(C + 6) …",
        "content": "Cora pays 19."
      }
    }
  ],
  "usage": {
    "completion_tokens": 190,
    "completion_tokens_details": { "reasoning_tokens": 181 }
  }
}

Models

ModelEffort on chat completionsEffort on /responsesAccepted valuesReasoning you get back
gpt-swissYesYeslow, medium, highFull reasoning text
gpt-5No, the model doesn't reason on this endpoint. With tools, send "reasoning_effort": "none", otherwise the request returns 500, see Tool calling.Yesnone, low, medium, high, xhigh, maxA summary, if you ask for one with reasoning.summary
deepseek-v4-flash, deepseek-r1, glm5, gpt-euIgnored: always reasonsIgnored: always reasons–Full reasoning text
claude-opus, claude-sonnetIgnoredEndpoint not available–None
gemini-3-pro-preview, gemini-3.5-flashIgnoredEndpoint not available–None. The models think internally; those tokens count in completion_tokens.
gpt-4o, gpt-4.1, qwen-3, qwen-3-fastNo reasoningNo reasoning–None
mistral-small-swiss, gemma-3No reasoningEndpoint not available–None

"Endpoint not available" returns 400 with unsupported_endpoint. Which endpoints a model supports is listed in meta.capabilities, see Models › Endpoint support.

Parameters

EndpointFieldValues
Chat completionsreasoning_effort (string)An effort from the table above
Chat completionsreasoning.effort (string, alternative)Same. Wins if you send both.
/responsesreasoning.effort (string)An effort from the table above
/responsesreasoning.summary (string)auto, concise or detailed. Only gpt-5.

How PeakPrivacy treats values:

  • Unsupported values are dropped, not rejected. The request succeeds and the model uses its default. Example: minimal on gpt-5 runs at medium, and max on gpt-swiss is ignored.
  • An invalid summary drops the whole reasoning object, effort included.
  • Check what was applied: on /responses, the reasoning field of the response shows the effort and summary that were used.

Read the reasoning

Chat completions. The reasoning text is in choices[0].message.reasoning_content, the count in usage.completion_tokens_details.reasoning_tokens. reasoning_content isn't a typed field in the OpenAI SDKs: read it with getattr in Python, or directly in JavaScript as above.

Responses. output holds an item with "type": "reasoning" before the message. For gpt-swiss, deepseek-v4-flash, deepseek-r1, glm5 and gpt-eu, the text is in its content[].text. For gpt-5 you only get a summary, in summary[].text, and only when you send reasoning.summary. The count is in usage.output_tokens_details.reasoning_tokens.

curl https://api.peakprivacy.ch/v1/ai/responses \
  -H "Authorization: Bearer $PEAKPRIVACY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "model": "gpt-5",
    "input": "Anna pays twice what Ben pays. Ben pays 6 more than Cora. Together they pay 94. How much does Cora pay?",
    "reasoning": {"effort": "high", "summary": "auto"}
  }'

Conversations

The API keeps no history: you send the whole conversation with every request. Put only the model's content back into the history, not its reasoning_content. In our tests, sending the reasoning back changed nothing in the answer, but it cost input tokens, and with deepseek-v4-flash the model reasoned about twice as long on the next turn.

messages = [{"role": "user", "content": "A train leaves Zürich at 08:12 and arrives in Bern at 09:08. A second train leaves Bern at 08:40 and arrives in Zürich at 09:36. When do they pass each other?"}]

completion = client.chat.completions.create(model="gpt-swiss", messages=messages, reasoning_effort="low")
answer = completion.choices[0].message

# keep the answer, drop the reasoning
messages.append({"role": "assistant", "content": answer.content})
messages.append({"role": "user", "content": "And if the second train leaves 10 minutes later?"})

follow_up = client.chat.completions.create(model="gpt-swiss", messages=messages, reasoning_effort="low")
print(follow_up.choices[0].message.content)

Show reasoning to users

Reasoning is a working note. If you show it in your product:

  • Put it behind a toggle such as "Show how the answer was reached", collapsed by default. Show content as the answer.
  • Present it as unverified. A model can reason correctly and still answer wrongly, or the other way round.
  • Treat it like the prompt it came from. It repeats names, amounts and other details from the request, so log and store it with the same care.

Streaming

Streamed chunks carry reasoning in choices[0].delta.reasoning_content and the answer in delta.content.

Known limitation: with reasoning models, a stream doesn't keep reasoning and answer reliably apart. The answer, or its first characters, can arrive in delta.reasoning_content, reasoning can arrive after the answer or inside it (also in /responses streams, as response.output_text.delta), and the final usage chunk reports reasoning_tokens as 0. Workaround: send requests to reasoning models without stream when you need the answer and the reasoning separately.

Choose the effort

Reasoning tokens are output tokens: they count in completion_tokens or output_tokens and add time before the answer. Higher effort buys more reasoning, which helps on hard problems and is wasted on easy ones. A model may use no reasoning at all on an easy question, even at high.

One test run with gpt-swiss and the timetable question above:

EffortReasoning tokensAnswer
low31808:54 (correct)
medium (default)57508:54 (correct)
high1,11708:54 (correct)

All three were right, and high cost more than three times the reasoning of low. Start low and raise the effort only for the tasks where your own test cases show a difference:

  • low for extraction, classification, short rewrites and simple checks.
  • medium or the model default for everyday questions.
  • high and above for multi-step calculations, planning and code that has to be right the first time.

See also

Auf dieser Seite