Overview
Connect your application to artificial intelligence providers through one gateway.
AI Gateway exposes OpenAI-compatible and Anthropic-compatible APIs. Your application sends requests to AI Gateway with a virtual key and a public model name. AI Gateway selects a provider deployment, translates the request, and tracks usage and cost.
You control the providers, routing rules, and access limits. Supported operations and parameters depend on the deployments configured for each public model.
Start here
Start a local gateway, connect OpenAI, and call it with a virtual key.
Understand the modelLearn how public models, deployments, and adapters fit together.
Connect an existing application
If an operator has already configured AI Gateway, use its base URL, a virtual key, and an available public model name. For example, with the OpenAI Python SDK:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:4000/v1", api_key="<virtual-key>")
response = client.chat.completions.create(
model="general",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)Here, general is a name configured in AI Gateway. It can route to one or more upstream models
without changing the application's request. See the API reference for
authentication, supported endpoints, and errors.
Configure and operate
Choose an adapter and configure credentials, models, and supported operations.
Control routingBalance traffic, set deployment limits, and configure fallback policies.
Manage access and costsGive each application its own model scope, rate limits, and budget.
Deploy AI GatewayChoose a deployment platform and prepare Postgres, Redis, and secrets.
Use the dashboardManage the gateway and investigate requests from the operator UI.
Prepare for productionCheck security, health probes, backups, and observability before launch.
Contribute
Read Architecture for the request pipeline, Testing for the test workflow, and Documentation development to work on these pages.