Learn how to use TrueFoundry’s unified Chat Completions API to interact with models from multiple providers through a consistent interface
/chat/completions
endpoint. This unified interface allows you to seamlessly work with models from different providers through a consistent API.
Section | Description |
---|---|
Getting Started | Basic setup and configuration |
Input Controls | System prompts and request parameters |
Working with Media | Images, audio, and video support |
Function Calling | Enabling models to invoke functions |
Response Format | Structured JSON outputs |
Prompt Caching | Optimize API usage with caching |
Reasoning Models | Access model reasoning processes |
provider_account/model_name
(available in the LLM playground UI)o
series models like o3-mini.Images
Audio
Video
Creating Well-Structured Function Definitions
Supported Parameter Types for Function Arguments
Working with Multiple Function Definitions
Processing and Responding to Function Calls
Controlling When and How Functions Are Called
Basic JSON Mode: Getting Valid JSON Without Structure Constraints
JSON Schema Mode: Enforcing Specific Data Structures
Python Type Validation with Pydantic Models
Streamlined Pydantic Integration with OpenAI's Beta Parse API
cache_control
parameter to any message content you want to cache:
Model | Minimum Token Length |
---|---|
Claude Opus 4, Claude Sonnet 4, Claude Sonnet 3.7, Claude Sonnet 3.5, Claude Opus 3 | 1024 tokens |
Claude Haiku 3.5, Claude Haiku 3 | 2048 tokens |
cache_control
field.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.
X-TFY-STRICT-OPENAI: false
thinking
field in the request bodyX-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.