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
| Header | Required | Description |
|---|---|---|
X-Ingate-Provider | Yes | Target provider name |
X-Ingate-Key | Yes | Your Ingate API key |
X-Ingate-Translate | No | true for OpenAI↔Anthropic translation |
Content-Type | Yes | application/json |
Response Headers
| Header | Description |
|---|---|
X-Ingate-Request-Id | Unique UUID for request correlation |
X-Ingate-Served-By | Provider 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
| Status | Description |
|---|---|
400 | Missing X-Ingate-Provider header |
401 | Invalid or missing X-Ingate-Key |
404 | Provider not found or not enabled |
413 | Request body too large |
429 | Rate limit exceeded |
502 | Upstream provider error |