Skip to main content
TrueFoundry AI Gateway provides access to model reasoning processes through thinking/reasoning tokens, currently available for 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:
  1. The header: X-TFY-STRICT-OPENAI: false
  2. A thinking field 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

For streaming responses, the thinking section is always sent before the content section.

Thinking Token Chunk

Content Token Chunk

In streaming responses, the thinking chunk typically arrives first, followed by the content chunks.