Gateway: n8n
PlatformThe OpenAI credential can set Base URL but currently exposes one extra header. Gateway needs two. Use HTTP Request, or both headers if your n8n build has them.
n8n can hit the Gateway if the request is Chat Completions to https://gateway.traccia.ai/openai/v1 and both Traccia headers are present. The stock OpenAI credential on current n8n master has Base URL plus one optional custom header. The Gateway returns 400 when X-Traccia-Agent-Id is missing.
What this Gateway accepts
POST /openai/v1/chat/completions and GET /openai/v1/models. 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.
HTTP Request (Works Today)
Use an HTTP Request node. Method POST. URL https://gateway.traccia.ai/openai/v1/chat/completions. Send JSON. Set Authorization plus both Traccia headers. This is the path that does not depend on n8n credential schema.
Authorization: Bearer $OPENAI_API_KEYContent-Type: application/jsonX-Traccia-Api-Key: $TRACCIA_API_KEYX-Traccia-Agent-Id: billing-bot{ "model": "gpt-4o-mini", "messages": [{ "role": "user", "content": "hello" }]}OpenAI Credential
The OpenAI credential field url (Base URL) defaults to https://api.openai.com/v1. Set it to https://gateway.traccia.ai/openai/v1 with no trailing slash. The credential test hits GET /models, which this Gateway implements, but still requires both Traccia headers.
One Extra Header On Current n8n
headerName / headerValue). The Gateway needs two. If your n8n version still has only one extra header, the OpenAI node cannot satisfy this Gateway. Use HTTP Request. If your build has multiple custom headers, set both Traccia headers and use Chat Completions only.What 404s Or Is Out Of Scope
- OpenAI node embeddings, Assistants, and images
- n8n Cloud "Use Gateway credits" (that is n8n's product, not Traccia)
- OTLP observe (OTLP Ingestion) without changing the model URL. That traces. It does not enforce Spend Cap on the provider call.
Next Steps
© 2026 Traccia.