Thinking-capable Ollama models can return a reasoning trace separately from the final answer. That separation matters for user interfaces, audits, and logs because the trace is not the same field as the answer.
The think request field can be a boolean for many models or a level for models such as gpt-oss. The chat endpoint returns reasoning under message.thinking while final text stays under message.content.
Keep token limits high enough for the model to produce both reasoning and answer. A short num_predict or compatibility max_tokens value can stop a thinking model before final content appears.
$ curl -s http://localhost:11434/api/chat -d '{ "model":"gpt-oss:20b", "messages":[{"role":"user","content":"Reply with OK."}], "think":"low", "stream":false, "options":{"num_predict":24} }' {"message":{"content":"OK","thinking":"User wants \"OK\"."},"done":true}
$ python3 - <<'PY'
payload = {"message": {"content": "OK", "thinking": "User wants OK."}}
print(payload["message"]["content"])
PY
OK
$ curl -s http://localhost:11434/api/generate -d '{"model":"gpt-oss:20b","prompt":"Return OK.","think":"low","stream":false}' {"response":"OK","thinking":"Just output OK.","done":true}
$ python3 - <<'PY'
payload = {"message": {"content": "OK", "thinking": "Internal reasoning"}}
print('thinking' in payload['message'])
PY
True
$ curl -s http://localhost:11434/v1/messages -d '{"model":"gpt-oss:20b","max_tokens":20}' {"content":[{"type":"thinking"}],"stop_reason":"max_tokens"}