Gateway: n8n

Platform

The 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

OpenAI: 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

HeaderValue
X-Traccia-Api-KeyWorkspace key from Settings → API Keys
X-Traccia-Agent-IdSame 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.

HTTP Request headers
bash
Authorization: Bearer $OPENAI_API_KEY
Content-Type: application/json
X-Traccia-Api-Key: $TRACCIA_API_KEY
X-Traccia-Agent-Id: billing-bot
HTTP Request body
json
{
"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

Current n8n OpenAI credentials expose a single custom header (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.