Claude 3.7 Sonnet (via Anthropic, AWS Bedrock, and Google Vertex AI).
These models expose their internal reasoning process, allowing you to see how they arrive at conclusions. The thinking/reasoning tokens provide step-by-step insights into the model’s cognitive process.
Enabling Reasoning Tokens
To enable thinking/reasoning tokens, your request must include:- The header:
X-TFY-STRICT-OPENAI: false - A
thinkingfield in the request body
When the
X-TFY-STRICT-OPENAI header is set to false, the response is no longer OpenAI-compliant, as it introduces an additional reasoning layer that OpenAI’s compliance framework does not support.Response Format
When reasoning tokens are enabled, the response includes both thinking and content sections:Streaming with Reasoning Tokens
Forstreaming responses, the thinking section is always sent before the content section.