Skip to main content

Prerequisites

  • An each::labs API key. Grab one here if you don’t have one yet.

Getting Started

1

Get your API key

Sign up at eachlabs.ai and create an API key from Settings > API Keys.
2

Update your code

Point any OpenAI-compatible SDK to the each::labs base URL:
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_EACHLABS_API_KEY",
    base_url="https://api.eachlabs.ai/v1"
)
3

Make your first request

Use the provider/model-name format to pick any model:
response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[
        {"role": "user", "content": "What is the capital of France?"}
    ]
)

print(response.choices[0].message.content)

Switch Models Instantly

Just change the model parameter. That’s literally it. No config changes, no new SDKs, no drama:
# Use Anthropic Claude
response = client.chat.completions.create(
    model="anthropic/claude-sonnet-4-20250514",
    messages=[{"role": "user", "content": "Explain quantum computing"}]
)

# Use Google Gemini
response = client.chat.completions.create(
    model="google/gemini-2.5-pro-preview-06-05",
    messages=[{"role": "user", "content": "Explain quantum computing"}]
)

# Use DeepSeek
response = client.chat.completions.create(
    model="deepseek/deepseek-r1",
    messages=[{"role": "user", "content": "Explain quantum computing"}]
)

Streaming

Streaming is not supported yet. Yeah, we know. It’s painful. We’re on it and it’ll be here soon. For now all requests return the complete response at once.
Once streaming lands, you’ll use it like this:
# Coming soon
stream = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Write a haiku about coding"}],
    stream=True
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Advanced Features

LLM Router comes with some nice tricks out of the box:
  • Smart Routing automatically sends requests to the cheapest or fastest provider
  • Fallbacks so your app doesn’t break when a model is having a bad day
  • Caching to save you money and time on repeated requests
  • Rate Limiting per model or per user, your call
  • Usage Analytics to keep tabs on costs, tokens, and latency

Next Steps

Last modified on March 6, 2026