Gateway: LangChain
PlatformRoute ChatOpenAI and ChatAnthropic through Traccia. Force Chat Completions. The Responses API is not this Gateway.
LangChain talks to providers through its chat models. Point those models at the Gateway the same way you would point the native SDKs. LangGraph uses the same ChatOpenAI / ChatAnthropic objects.
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.
ChatOpenAI
Official knobs: base_url (alias openai_api_base) and default_headers. Resolution is explicit base_url, then OPENAI_API_BASE, then OPENAI_BASE_URL. The value must be https://gateway.traccia.ai/openai/v1.
Force Chat Completions
langchain-openai can post to /v1/responses from the model name, output_version, or Responses-only features. This Gateway only implements POST /openai/v1/chat/completions. Set use_responses_api=False in Python and useResponsesApi: false in JavaScript. Do not use Responses-only tools or kwargs.import osfrom langchain_openai import ChatOpenAI
llm = ChatOpenAI( model="gpt-4o-mini", api_key=os.environ["OPENAI_API_KEY"], base_url="https://gateway.traccia.ai/openai/v1", default_headers={ "X-Traccia-Api-Key": os.environ["TRACCIA_API_KEY"], "X-Traccia-Agent-Id": "billing-bot", }, use_responses_api=False,)
response = llm.invoke("hello")JavaScript puts OpenAI SDK options under configuration (baseURL and defaultHeaders). Some LangChain JS versions still route to /v1/responses when tools are present even if useResponsesApi is false. If you see that 404, drop Responses-only tools or call Chat Completions through the OpenAI SDK page.
ChatAnthropic
Official knobs: base_url (alias of anthropic_api_url) and default_headers. The Anthropic SDK default is https://api.anthropic.com, so the Gateway value is https://gateway.traccia.ai/anthropic with no /v1.
import osfrom langchain_anthropic import ChatAnthropic
llm = ChatAnthropic( model="claude-sonnet-4-5", api_key=os.environ["ANTHROPIC_API_KEY"], base_url="https://gateway.traccia.ai/anthropic", default_headers={ "X-Traccia-Api-Key": os.environ["TRACCIA_API_KEY"], "X-Traccia-Agent-Id": "billing-bot", },)
response = llm.invoke("hello")LangSmith Gateway Is Not Traccia
LANGSMITH_GATEWAY. That is LangSmith, not this product. Set base_url explicitly to the Traccia host.Not Documented Here
ChatGoogleGenerativeAI is not verified against this Gateway. Use the Gemini SDK page for Gemini traffic.
Next Steps
© 2026 Traccia.