THROUGHPUTS

OpenAI Compatibility

If you've used the OpenAI API, you already know how to use THROUGHPUTS.

THROUGHPUTS is wire-compatible with the OpenAI Chat Completions and Embeddings APIs. Any client written for OpenAI — official SDKs, community libraries, LangChain, LlamaIndex, Continue, Aider — works with THROUGHPUTS by changing one line.

The one-line migration

- base_url="https://api.openai.com/v1"
+ base_url="https://api.throughputs.dev/v1"

That's it. Same request shape, same response shape, same streaming format, same error codes.

Python

from openai import OpenAI

client = OpenAI(
    api_key="thp_live_xxx",
    base_url="https://api.throughputs.dev/v1",
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
)

TypeScript

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.THROUGHPUTS_API_KEY!,
  baseURL: "https://api.throughputs.dev/v1",
});

const response = await client.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello" }],
});

LangChain

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="gpt-4o",
    api_key="thp_live_xxx",
    base_url="https://api.throughputs.dev/v1",
)

What works unchanged

  • Chat completions (streaming and batch)
  • Function / tool calling
  • JSON mode (response_format)
  • Vision (multimodal image_url content parts)
  • Embeddings (including adjustable dimensions)
  • Rate limit semantics (429 + Retry-After)
  • Error shape ({"error": {"message", "type", "code"}})

What's different

FeatureOpenAITHROUGHPUTS
Base URLapi.openai.com/v1api.throughputs.dev/v1
API key prefixsk-thp_live_ / thp_test_
Model availabilityOpenAI only400+ models from every provider
FailoverManualBuilt-in via X-Throughputs-Model-Fallback header
Cost trackingSeparate APIX-Throughputs-Cost-Usd on every response

Model names

THROUGHPUTS accepts both the provider's native slug and normalized slugs:

NativeTHROUGHPUTS
gpt-4ogpt-4o
gpt-4o-minigpt-4o-mini
claude-3-5-sonnet-20241022claude-3-5-sonnet (alias)
claude-3-5-sonnet-20241022claude-3-5-sonnet-20241022 (full)
gemini-1.5-progemini-1.5-pro
llama-3.1-70b-versatilellama-3.1-70b (alias)

Aliases are stable — THROUGHPUTS resolves them to the latest version of the underlying model. Use full slugs if you need to pin a specific version.

On this page