For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DiscordPlatform
DocumentationIntegrationsAPI referenceSDKsChangelog
DocumentationIntegrationsAPI referenceSDKsChangelog
    • Overview
  • Tracing
  • Gateway
      • OpenAI
      • Anthropic
      • Google Gemini
      • Google PaLM
      • Mistral
      • Baseten
      • Fireworks AI
      • Groq
      • Perplexity AI
      • Replicate
      • Together AI
      • Wafer
      • xAI
      • AI21 Labs
      • Cohere
      • Cerebras
      • DeepSeek
      • Azure DeepSeek
      • Inference
      • Moonshot
      • Nebius AI
      • Nextbit
      • Novita AI
      • OpenRouter
      • Parasail
      • Reducto
      • AWS Bedrock
      • Google Vertex AI
      • Azure OpenAI
      • Custom Provider
  • Others
  • Migrating
    • Braintrust
    • Portkey
    • Langfuse
LogoLogo
DiscordPlatform
On this page
  • Prerequisites
  • Supported SDKs / integrations
  • Configuration
  • Via UI (Global)
  • Via code (Gateway request)
  • Supported models
  • Log custom provider requests
GatewayModel Providers

Custom Provider (gateway)

Set up a custom or self-hosted LLM provider with the Respan gateway.

Was this page helpful?
Previous

Mem0

Next
Built with
Set up Respan
  1. Sign up — Create an account at platform.respan.ai
  2. Create an API key — Generate one on the API keys page
  3. Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page
Use AI

Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed.

1{
2 "mcpServers": {
3 "respan-docs": {
4 "url": "https://mcp.respan.ai/mcp/docs"
5 }
6 }
7}
This section is for Respan LLM gateway users.

Use Respan Gateway to route requests to your own self-hosted or custom LLM provider while keeping unified observability (logs, cost, latency, and reliability metrics) in Respan.

Prerequisites

  • A Respan API key
  • A running LLM endpoint that exposes an OpenAI-compatible API
Create a custom provider

Add your provider base URL, API key, and custom models in Respan.

Supported SDKs / integrations

✅ Supported Frameworks
  • OpenAI SDK
  • LangChain SDK
  • Vercel/OpenAI
  • Vercel/Google
  • LlamaIndex SDK
  • Google GenAI
  • Respan native (Otel)
❌ Unsupported Frameworks
  • Anthropic SDK
  • Vercel/Anthropic

Configuration

There are 2 ways to use your custom provider through Respan:

Via UI (Global)

1

Navigate to Providers

Go to the Providers page and click Add Custom Provider.

Respan Providers Page
2

Add your custom provider

Provide a provider name, base URL, and API key if your endpoint requires one.

3

Add a custom model

Create a model entry that uses your custom provider. Use the model name your endpoint expects.

Via code (Gateway request)

After you create the custom provider and model in Respan, call the model through the gateway with your Respan API key.

OpenAI Python SDK
1from openai import OpenAI
2
3client = OpenAI(
4 api_key="YOUR_RESPAN_API_KEY",
5 base_url="https://api.respan.ai/api/",
6)
7
8response = client.chat.completions.create(
9 model="MY_CUSTOM_MODEL_ID",
10 messages=[{"role": "user", "content": "Hello!"}],
11)
12print(response.choices[0].message.content)

Supported models

Custom model IDs are managed on the Respan Models page. Use the exact model ID you create there in your gateway requests.

Log custom provider requests

If you are not using the Gateway to proxy requests, you can still log requests to Respan asynchronously.

Python
1import requests
2
3url = "https://api.respan.ai/api/request-logs/create/"
4payload = {
5 "model": "MY_CUSTOM_MODEL_ID",
6 "prompt_messages": [
7 {
8 "role": "user",
9 "content": "Hello!"
10 }
11 ],
12 "completion_message": {
13 "role": "assistant",
14 "content": "Hello from my custom provider."
15 },
16 "cost": 0.001,
17 "generation_time": 1.2,
18 "customer_params": {
19 "customer_identifier": "user_123"
20 }
21}
22headers = {
23 "Authorization": "Bearer YOUR_RESPAN_API_KEY",
24 "Content-Type": "application/json",
25}
26
27response = requests.post(url, headers=headers, json=payload)
Custom Providers API

Create, list, update, and delete custom providers programmatically.