Other APIs
Media, embeddings, realtime, and passthrough endpoints, on the same base URL and key.
Every endpoint lives on https://gateway.respan.ai and takes your Respan API key: Authorization: Bearer for OpenAI-shaped endpoints, x-api-key for Anthropic’s, x-goog-api-key for Google’s. Each one is routed, billed, and logged like a chat request, and answers with X-Respan-Log-Id. Respan params work on all of them.
The main API formats have their own pages: OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, Google GenerateContent, and TypeSafe Decisions.
Media
| Endpoint | Method and path | Billed per | Guide |
|---|---|---|---|
| Image generation | POST /v1/images/generations | Image | Images |
| Image edits | POST /v1/images/edits | Image | Images |
| Videos | POST /v1/videos, GET /v1/videos/{id}, GET /v1/videos/{id}/content, POST /v1/videos/{id}/remix | Second of video | Video |
| Speech | POST /v1/audio/speech | Minute of audio | Audio |
| Transcriptions | POST /v1/audio/transcriptions | Minute of audio | Audio |
Embeddings
| Endpoint | Method and path | Billed per | Guide |
|---|---|---|---|
| Embeddings | POST /v1/embeddings | Input token | Embeddings |
Realtime
Realtime sessions run over WebSocket. Each session is billed and logged once it ends.
| Endpoint | URL | Guide |
|---|---|---|
| OpenAI Realtime | wss://gateway.respan.ai/v1/realtime?model=... | Realtime |
| Gemini Live | wss://gateway.respan.ai/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent?model=... | Realtime |
| Mistral realtime transcription | wss://gateway.respan.ai/v1/audio/transcriptions/realtime?model=... | Realtime |
OpenAI decisions
| Endpoint | Method and path | Guide |
|---|---|---|
| OpenAI decisions | POST /openai/v1/decisions | Decisions |
The same decisions models answer OpenAI’s decisions contract (input, ordered questions and answers) and Respan’s System One contract.
Provider passthrough
These paths send the provider’s own body as is. With a key of your own for that provider, nothing is translated, routed, or charged to Respan credits; the call is only logged, with X-Respan-Log-Id and the provider’s X-Respan-Upstream-Request-Id. Without one, the request runs on Respan credits on the provider the path names, routed and billed like any other call. Use them when you need a provider field the API formats can’t translate, or a tool expects the provider’s exact responses.
| Path | Provider | Respan key in | Provider key from |
|---|---|---|---|
POST /api/{provider}/v1/chat/completions | An OpenAI-shaped provider, such as openai, azure_openai, xai, groq, mistral, deepseek, togetherai, fireworks, or perplexity | Authorization: Bearer | A key sent with the request, else your saved key for that provider, else Respan credits |
POST /api/openrouter/v1/chat/completions | OpenRouter | Authorization: Bearer | The x-openrouter-api-key header |
POST /api/anthropic/passthrough/v1/messages | Anthropic | x-api-key or Authorization: Bearer | A key sent with the request, else your saved Anthropic key, else Respan credits |
POST /api/google/gemini/v1beta/models/{model}:{action}, POST /api/google/models/{model}:{action} | Google Gemini API | x-goog-api-key | A key sent with the request, else your saved Gemini key, else Respan credits |
Save provider keys with BYOK, or send one with the request in customer_credentials or credential_override (see Send a key with the request). A credential_override that names no key is refused rather than sent on Respan’s key. OpenRouter passthrough needs x-openrouter-api-key and is refused with 400 without it.
Respan params go in respan_params in the body, or in metadata.respan_params, and are removed before sending.
import os
import anthropic
client = anthropic.Anthropic(
base_url="https://gateway.respan.ai/api/anthropic/passthrough",
api_key=os.environ["RESPAN_API_KEY"],
)
message = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)On an OpenAI-shaped passthrough, send respan_params as an object through extra_body. The OpenAI SDK types metadata as strings, and a respan_params string inside metadata is ignored.