Proxy

Proxy API

Route LLM requests to any configured provider.

POST
/*

Any path not matching a Ingate route is proxied to the target provider.

Request Headers

HeaderRequiredDescription
X-Ingate-ProviderYesTarget provider name
X-Ingate-KeyYesYour Ingate API key
X-Ingate-TranslateNotrue for OpenAI↔Anthropic translation
Content-TypeYesapplication/json

Response Headers

HeaderDescription
X-Ingate-Request-IdUnique UUID for request correlation
X-Ingate-Served-ByProvider that served (on fallback)

Examples

OpenAI Chat Completion

bash
curl https://api.ingateai.com/v1/chat/completions \
  -H "X-Ingate-Provider: openai" \
  -H "X-Ingate-Key: sk-ingate-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What is an AI gateway?"}
    ]
  }'

Anthropic Messages

bash
curl https://api.ingateai.com/v1/messages \
  -H "X-Ingate-Provider: anthropic" \
  -H "X-Ingate-Key: sk-ingate-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-3-haiku-20240307",
    "max_tokens": 100,
    "messages": [{"role": "user", "content": "Hello, Claude!"}]
  }'

With Format Translation

Send OpenAI-format request, target Anthropic. Ingate translates both directions:

bash
curl https://api.ingateai.com/v1/chat/completions \
  -H "X-Ingate-Provider: anthropic" \
  -H "X-Ingate-Translate: true" \
  -H "X-Ingate-Key: sk-ingate-your-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-3-haiku-20240307","messages":[{"role":"user","content":"Hello"}]}'

Streaming

bash
curl --no-buffer https://api.ingateai.com/v1/chat/completions \
  -H "X-Ingate-Provider: openai" \
  -H "X-Ingate-Key: sk-ingate-your-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Tell me a story"}],"stream":true}'

Error Responses

StatusDescription
400Missing X-Ingate-Provider header
401Invalid or missing X-Ingate-Key
404Provider not found or not enabled
413Request body too large
429Rate limit exceeded
502Upstream provider error