Skip to main content

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/v1 in local dev).
  • Each key is bound to a project and a list of allowed models — see Models for the model IDs you can pass.
quick sanity check
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.