Developer docs
Use AI Gateway from your code
AI Gateway is an OpenAI-compatible proxy: point your existing OpenAI SDK (or OpenAI Agents SDK) at the AI Gateway base URL and use a AI Gateway API key. Everything you already know about /v1/chat/completions and /v1/responses keeps working, with the additions of budgets, request caps, PII masking, tracing, hosted server tools, and the Prompt Vault.
Prerequisites
Two things you need before any example on the next pages runs.
- Create an API key from your project's API Keys tab and copy the secret — the prefix is
sk_and it is only shown once. - Know the base URL of your AI Gateway proxy. It ends with
/v1(e.g.http://localhost:5002/v1in local dev). - Each key is bound to a project and a list of allowed models — see Models for the model IDs you can pass.
curl https://<your-caronte>/v1/chat/completions \
-H "Authorization: Bearer $CARONTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{ "role": "user", "content": "ping" }]
}'Where to go next
The docs are split by topic. Pick the section closest to what you need to build.
Client configuration
Point the OpenAI SDK at AI Gateway in TypeScript or Python.
Messages API
Anthropic-compatible /v1/messages — point the Anthropic SDK or Claude Code at the gateway.
Monitoring & traces
Group requests with trace_id, session_id, trace_name, generation_name.
PII masking
Redact personal data before the provider, rehydrate it in the response.
Code Interpreter
Sandboxed Python/JS execution, containers, file inputs and outputs.
OpenAI Agents SDK
Run JS / Python agents through AI Gateway by overriding the default client.
tip · Already using the OpenAI SDK?
baseURL and apiKey. Every example in the rest of these docs assumes the client built in Client configuration.Working with an LLM or agent? Grab the llms.md
A single Markdown file that bundles every page on this site — paste it into your assistant's context so it knows how to call AI Gateway. Also served raw at /llms.md.