Skip to main content

Other Providers

Observra routes by URL segment, with one dedicated adapter per provider.

For copy-paste code covering raw HTTP, native SDKs, and agent frameworks per language, see Python, PHP, Node.js, Go, .NET, and Java.

Currently supported providers

URL segmentUpstreamNotes
/openaiapi.openai.comReference integration - see OpenAI SDK Integration
/anthropicapi.anthropic.comNative Anthropic Messages API protocol supported directly
/groqapi.groq.comOpenAI-compatible protocol
/geminigenerativelanguage.googleapis.comNative Gemini protocol; model can be taken from the URL path (/models/{model}:generateContent) instead of the body
/ollamaollama.com (or your own Ollama host)NDJSON/JSONL streaming responses
/openrouteropenrouter.aiOpenAI-compatible protocol
/tokenrouterapi.tokenrouter.comOpenAI-compatible protocol
/azureCustomer-supplied, via X-Azure-Endpoint headerAzure OpenAI has no fixed upstream base URL - see below
/togetherapi.together.xyzOpenAI-compatible protocol
/fireworksapi.fireworks.ai/inferenceOpenAI-compatible protocol
/deepseekapi.deepseek.comOpenAI-compatible protocol
/xaiapi.x.aiOpenAI-compatible protocol
/mistralapi.mistral.aiOpenAI-compatible protocol
/nimintegrate.api.nvidia.com (or your own self-hosted NIM container)OpenAI-compatible protocol; provider key is optional (self-hosted NIM often runs with no auth)
/lmstudiolocalhost:1234 (or your own LM Studio host)OpenAI-compatible protocol; provider key is optional (LM Studio runs locally with no auth by default)
/cohereapi.cohere.comCohere's own v2 Chat API wire format - translated to/from OpenAI protocol
/huggingfacerouter.huggingface.coHugging Face's unified Inference Providers router - OpenAI-compatible protocol
/vertexCustomer-supplied, via X-Vertex-Endpoint headerGoogle Cloud Vertex AI - forward your own short-lived GCP OAuth access token as the provider key
/bedrockRegion-derived from X-Aws-Region headerAWS Bedrock's Converse API - requires X-Aws-Access-Key-Id/X-Aws-Region headers plus your AWS secret access key as the provider key; the gateway SigV4-signs the request itself. Streaming is not supported (AWS's binary event-stream framing isn't compatible with the gateway's SSE/NDJSON relay)

Each provider's upstream base URL can be overridden per-deployment via a {PROVIDER}_UPSTREAM_URL environment variable (e.g. OPENAI_UPSTREAM_URL), useful for pointing at a proxy or regional endpoint.

TokenRouter

Use the gateway URL ending at /tokenrouter; the OpenAI SDK adds the chat-completions path:

import os
from openai import OpenAI

client = OpenAI(
api_key=os.environ["OBSERVRA_GATEWAY_KEY"],
base_url=f'{os.environ["OBSERVRA_GATEWAY_URL"].rstrip("/")}/tokenrouter',
default_headers={"X-Provider-Key": os.environ["TOKENROUTER_API_KEY"]},
)

response = client.chat.completions.create(
model="openai/gpt-5",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

The equivalent normal HTTP request is:

curl "$OBSERVRA_GATEWAY_URL/tokenrouter/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "X-Gateway-Key: $OBSERVRA_GATEWAY_KEY" \
-H "X-Provider-Key: $TOKENROUTER_API_KEY" \
-d '{"model":"openai/gpt-5","messages":[{"role":"user","content":"Hello"}]}'

TokenRouter support currently covers its OpenAI-compatible chat-completions API, including tools and SSE streaming. TokenRouter-specific image, video, Anthropic, Gemini, and Responses API surfaces are not claimed by this adapter.

Cross-protocol calls

Because the gateway detects the incoming client protocol independently of the target provider, you can call a non-OpenAI provider using an OpenAI-shaped request body (or vice versa) and the gateway will translate it - see Routing & Providers for how protocol detection and translation work, and their current limits.

Azure OpenAI specifics

Azure requires an additional X-Azure-Endpoint header carrying your Azure OpenAI resource's https:// endpoint (validated to be an *.openai.azure.com/.azure.us/.azure.eu host) - Azure has no single static upstream URL the way other providers do, since each customer has a dedicated resource endpoint. See Gateway Authentication.

What "supported" means today

Support means: an adapter exists that can build the upstream request and, where cross-protocol translation is needed, translate request/response/streaming-chunk shapes. It does not imply cost data is available for every model on every provider - if Observra doesn't have pricing for a specific model yet, cost is simply left unset for that observation.