RelayRouterRelayRouter
HomeModelsPricingDocsGet API Key

Docs / Quick Start

Quick Start

Get your API key and make your first API call in under 2 minutes.

#Basic information

FieldValue
API Base URLhttps://relayrouter.io/v1
API KeyObtain from the console, format: sk-xxxxxxxxxxxx
Supported ProtocolsOpenAI API compatible / Anthropic API compatible / Gemini API compatible

#Step 1: Create your account

Sign up for a RelayRouter account and top up any amount to start making requests.

#Step 2: Get your API key

  • Open the console and go to the API keys section
  • Create a new key
  • Copy and store it securely
Never commit your key to version control. Keep it in an environment variable such as RELAYROUTER_API_KEY.

#Step 3: Install the SDK

Any OpenAI-compatible client works. The official OpenAI SDK is the fastest path:

terminalbash
# Node.js
npm install openai

# Python
pip install openai

#Step 4: Make your first chat call

The API is OpenAI-compatible. If you already use the OpenAI SDK, change the base URL and the API key, nothing else.

main.pypython
from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["RELAYROUTER_API_KEY"],
    base_url="https://relayrouter.io/v1",
)

response = client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Hello! What can you do?"}],
)
print(response.choices[0].message.content)

#Prefer the Anthropic SDK? It works natively

The gateway also speaks the Anthropic protocol at POST /v1/messages, so the official Anthropic SDK works without an adapter: set base_url to https://relayrouter.io and keep your code unchanged. Gemini-style /v1beta endpoints are available as well.

anthropic_sdk.pypython
import anthropic

client = anthropic.Anthropic(
    api_key="your-relayrouter-key",
    base_url="https://relayrouter.io",
)
msg = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(msg.content[0].text)

#Step 5: Try another model

Switching providers is a one-parameter change. Use any model ID from your key's model list:

terminalbash
curl https://relayrouter.io/v1/chat/completions \
  -H "Authorization: Bearer $RELAYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
List the models available to your key with GET https://relayrouter.io/v1/models, or browse the Models page.

#Next steps