Skip to main content
1

Sign Up

Go to TrueFoundry and click Signup.
Screenshot of the TrueFoundry Welcome Page with signup option
Create an account and verify your email. You will be redirected to the landing page.
2

Add Your Models

Select the provider you want to add models from and add models after providing API Key. You can add multiple API keys from the same provider by creating separate provider accounts.
AI Gateway Models Page showing provider selection

Add Provider Account and Models

A Provider Account represents one account of a model provider (e.g. OpenAI, Anthropic, AWS Bedrock).
You can add multiple accounts per provider, each with their own API keys. Each account can have multiple models.
Once submitted, your provider accounts and models will appear under the Models tab.
To add models later, go to AI Gateway > Models, select a provider account on the left, and click Add Model in the top right. From the models listing page, click Try in Playground on any model to start experimenting.Add Models to Provider Account interface in TrueFoundry
3

Try Models in the Playground

The LLM Playground lets you test models from all connected providers directly in the UI.
AI Gateway Playground Page for testing LLM models
4

Integrate with Code

To call Gateway models from your code, you need Gateway Base URL, API Key, and Model ID.All three are available in the Code Snippets tab of the Playground.
Gateway Code Snippets Page with code generation options

Gateway Base URL

Your Gateway Base URL (GATEWAY_BASE_URL) is the endpoint for the AI Gateway service.
  • TrueFoundry SaaS users: https://gateway.truefoundry.ai
  • Self-hosted deployments: found in the Code Snippet section of the Playground.

API Key

Authenticate with the Gateway using one of:Create a token from the Access section in the TrueFoundry platform.
TrueFoundry playground showing the Gateway Base URL and API key

Example Usage

from openai import OpenAI

client = OpenAI(
    api_key="your_truefoundry_api_key",
    base_url="{GATEWAY_BASE_URL}"
)
Or set them as environment variables:
export OPENAI_BASE_URL="{GATEWAY_BASE_URL}"
export OPENAI_API_KEY="your_truefoundry_api_key"
The Playground also provides ready-to-use snippets for OpenAI SDK, Langchain, Python (Streaming/Non-Streaming), Node.js, LangGraph, LlamaIndex, Google ADK, cURL, and more.