Gateway: HTTP
Call the Gateway with cURL or any HTTP client. Use the full path the Gateway implements, plus both Traccia headers.
If a platform can set a URL and two extra headers, it can use the Gateway. Post to the full path. Do not stop at the client base URL. Keep the provider API key in the provider's own auth header.
What this Gateway accepts
OpenAI:
POST /openai/v1/chat/completions and GET /openai/v1/models, also under /agents/{agent_id}/v1 and /openai/agents/{agent_id}/v1 with the agent ID in the path. Anthropic: POST /anthropic/v1/messages. Gemini Developer API: POST /google/{v1beta|v1}/models/{model}:generateContent and :streamGenerateContent. Embeddings, the OpenAI Responses API, Assistants, Azure OpenAI paths, Vertex AI paths, and Anthropic Batches are not this Gateway. Those requests 404.Headers
| Header | Value |
|---|---|
| X-Traccia-Api-Key | Workspace key from Settings → API Keys |
| X-Traccia-Agent-Id | Same Agent ID you would pass to init |
Keep the provider API key on the client. The Gateway forwards it and does not store it. Missing Traccia key returns 401. Missing agent ID returns 400. For OpenAI-compatible clients that allow only one extra header, such as n8n, put the agent ID in the URL instead: https://gateway.traccia.ai/agents/<agent-id>/v1. If both are set, the header wins.
OpenAI Chat Completions
curl -sS https://gateway.traccia.ai/openai/v1/chat/completions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -H "X-Traccia-Api-Key: $TRACCIA_API_KEY" \ -H "X-Traccia-Agent-Id: billing-bot" \ -d '{ "model": "gpt-4o-mini", "messages": [{"role": "user", "content": "hello"}] }'Anthropic Messages
curl -sS https://gateway.traccia.ai/anthropic/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -H "X-Traccia-Api-Key: $TRACCIA_API_KEY" \ -H "X-Traccia-Agent-Id: billing-bot" \ -d '{ "model": "claude-sonnet-4-5", "max_tokens": 256, "messages": [{"role": "user", "content": "hello"}] }'Gemini Generate Content
curl -sS "https://gateway.traccia.ai/google/v1beta/models/gemini-2.5-flash:generateContent" \ -H "x-goog-api-key: $GEMINI_API_KEY" \ -H "Content-Type: application/json" \ -H "X-Traccia-Api-Key: $TRACCIA_API_KEY" \ -H "X-Traccia-Agent-Id: billing-bot" \ -d '{ "contents": [{"parts": [{"text": "hello"}]}] }'Streaming
OpenAI
stream: true and Gemini :streamGenerateContent are implemented. Anthropic streaming on /v1/messages is the same route with stream: true.Next Steps
© 2026 Traccia.