Skip to main content
TrueFoundry AI Gateway provides a universal API for all supported models via the standard OpenAI /chat/completions endpoint. This unified interface allows you to seamlessly work with models from different providers through a consistent API. API Reference: POST /chat/completions

Provider capabilities

The AI Gateway maps the OpenAI Chat Completions contract to each provider. The table below summarizes feature support by provider for this endpoint.
Legend:
  • Supported by provider and TrueFoundry
  • Provided by provider, but not by TrueFoundry
  • Provider does not support this feature

Contents

Getting Started

You can use the standard OpenAI client to send requests to the AI Gateway:

Configuration

You will need to configure the following:
  1. base_url: The base URL of the TrueFoundry AI Gateway
  2. api_key: API key generated from Personal Access Tokens
  3. model: TrueFoundry model ID in the format provider_account/model_name (available in the LLM playground UI)
See Integrate with code for instructions on obtaining these values. For using native provider SDKs (OpenAI, Google Gen AI, Anthropic, boto3), see Native SDK Support.

Input Controls

System Prompts

System prompts set the behavior and context for the model by defining the assistant’s role, tone, and constraints:

Request Parameters

Fine-tune model behavior with these common parameters:
Some models don’t support all parameters. For example, temperature is not supported by o series models like o3-mini.

max_tokens defaults per provider

max_tokens is optional in the OpenAI-compatible API, but what happens when you omit it depends on the provider integration. Anthropic’s Messages API requires max_tokens, so for integrations that speak that format the AI Gateway supplies a default rather than letting the request fail.
Always set max_tokens explicitly for long-form generations. If you rely on the default, a response can be truncated mid-sentence with finish_reason: "length" and no error — most visibly on Claude Opus and Sonnet via AWS Bedrock, where Bedrock caps output at 4096 tokens despite the models supporting far more.