Set up Respan
Set up Respan
- Sign up — Create an account at platform.respan.ai
- Create an API key — Generate one on the API keys page
- Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page
Use AI
Use AI
Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed.
Overview
The Respan gateway provides an OpenAI-compatible API endpoint that gives you access to 250+ models from all major providers through a single API key and base URL.| Endpoint | Base URL |
|---|---|
| OpenAI-compatible | https://api.respan.ai/api/ |
| Anthropic proxy | https://api.respan.ai/api/anthropic/ |
| Google Gemini proxy | https://api.respan.ai/api/google/gemini |
Environment Switching: Respan doesn’t support an
env parameter in API calls. To switch between environments (test/production), use different API keys — one for your test environment and another for production. Manage keys in API Keys settings.Quickstart
Step 1: Set environment variables
Step 2: Make a request
Step 3: Verify
Open the Logs page to see your gateway requests.Switch models
Change themodel parameter to use any supported provider through the same endpoint:
OpenAI-compatible parameters
All standard OpenAI chat completion parameters are supported:| Parameter | Type | Description |
|---|---|---|
messages | array | List of messages in OpenAI format (role + content). |
model | string | Model to use (e.g. gpt-4o-mini, claude-sonnet-4-5-20250929). |
stream | boolean | Stream back partial progress token by token. |
temperature | number | Controls randomness (0-2). |
max_tokens | number | Maximum tokens to generate. |
top_p | number | Nucleus sampling threshold. |
frequency_penalty | number | Penalize tokens by existing frequency. |
presence_penalty | number | Penalize tokens by whether they appear in text so far. |
stop | array | Stop sequences. |
tools | array | List of tools/functions the model may call. |
tool_choice | string|object | Controls tool selection (none, auto, or specific tool). |
response_format | object | Force JSON output (json_object, json_schema, or text). |
n | number | Number of completions to generate. |
logprobs | boolean | Return log probabilities of output tokens. |
Respan parameters
Pass Respan-specific parameters in the request body alongside OpenAI parameters. When using the OpenAI SDK, pass them viaextra_body.
Observability
| Parameter | Type | Description |
|---|---|---|
customer_identifier | string | Tag to identify the user. See customer identifier. |
metadata | object | Custom key-value pairs for filtering and search. See custom properties. |
custom_identifier | string | Extra indexed tag (shows as “Custom ID” in spans). |
disable_log | boolean | When true, only metrics are recorded — input/output messages are omitted. |
request_breakdown | boolean | Returns a summarization of the response (tokens, cost, latency). |
Example
Example
Reliability
| Parameter | Type | Description |
|---|---|---|
fallback_models | array | Backup models ranked by priority. See fallback models. |
load_balance_group | object | Balance requests across models. See load balancing. |
retry_params | object | Configure retries (retry_enabled, num_retries, retry_after). See retries. |
Example
Example
Caching
| Parameter | Type | Description |
|---|---|---|
cache_enabled | boolean | Enable response caching. See caches. |
cache_ttl | number | Cache time-to-live in seconds (default: 30 days). |
cache_options | object | Set cache_by_customer: true to scope cache per customer. |
Credentials
| Parameter | Type | Description |
|---|---|---|
customer_credentials | object | Pass your customer’s provider API keys. See provider keys. |
credential_override | object | One-off credential overrides for specific models (e.g. Azure deployments). |
model_name_map | object | Map default model names to custom Azure deployment names. |
Credential override example
Credential override example
Prompt management
| Parameter | Type | Description |
|---|---|---|
prompt | object | Use a Respan-managed prompt template. See prompt management. |
Prompt example
Prompt example