THROUGHPUTS

Quickstart

Send your first THROUGHPUTS request in under five minutes.

This guide walks you from zero to a working chat completion in under five minutes. You'll create an API key, install an SDK, and send a request.

1. Create an API key

  1. Sign in to the THROUGHPUTS dashboard.
  2. Navigate to API KeysCreate new key.
  3. Name it (e.g. dev-local) and copy the value — it starts with thp_live_.

Treat your API key like a password. Never commit it to git or ship it in client-side code.

2. Install an SDK

THROUGHPUTS is OpenAI-compatible, so you can use the official OpenAI SDK in any language. The fastest path is Python:

pip install openai

Or TypeScript:

npm install openai

See the SDK reference for first-party clients.

3. Send your first request

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": "Say hello in three languages."}],
)

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

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: "claude-3-5-sonnet",
  messages: [{ role: "user", content: "Say hello in three languages." }],
});

console.log(response.choices[0].message.content);

cURL

curl https://api.throughputs.dev/v1/chat/completions \
  -H "Authorization: Bearer $THROUGHPUTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

4. Try a different model

The only thing that changes is the model field. Every model in the catalog is reachable through the same endpoint with the same request shape:

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

Next steps

On this page