Overview

The LLM Gateway is one OpenAI-compatible API for every model on Clusterbase — OpenAI, Anthropic, and open-weight models behind a single key.

The LLM Gateway gives you every model on Clusterbase through one API and one key. The surface is OpenAI-compatible, so existing OpenAI SDKs work unchanged — point them at the gateway's base URL and swap the model ID.

https://llm.clusterbase.dev

Authentication is a bearer token on every request. Use an organization API key (ccp_live_ak_…), created in the Console.

Jump straight in

curl https://llm.clusterbase.dev/v1/chat/completions \
  -H "Authorization: Bearer $CLUSTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-5",
    "messages": [
      { "role": "user", "content": "Fix this function and explain the bug: function median(a){a.sort();return a[a.length/2]}" }
    ]
  }'

Use the OpenAI SDK with the gateway's base URL:

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env.CLUSTER_API_KEY,
  baseURL: 'https://llm.clusterbase.dev/v1',
});

const response = await client.chat.completions.create({
  model: 'claude-opus-5',
  messages: [{ role: 'user', content: 'Say hi.' }],
});

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

Use the OpenAI SDK with the gateway's base URL:

import os

from openai import OpenAI

client = OpenAI(
    api_key=os.environ["CLUSTER_API_KEY"],
    base_url="https://llm.clusterbase.dev/v1",
)

response = client.chat.completions.create(
    model="claude-opus-5",
    messages=[{"role": "user", "content": "Say hi."}],
)

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

Use the Vercel AI SDK through its OpenAI-compatible provider:

import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
import { generateText } from 'ai';

const clusterbase = createOpenAICompatible({
  name: 'clusterbase',
  baseURL: 'https://llm.clusterbase.dev/v1',
  apiKey: process.env.CLUSTER_API_KEY,
});

const { text } = await generateText({
  model: clusterbase('claude-opus-5'),
  prompt: 'Say hi.',
});

console.log(text);

The gateway also speaks the AI SDK's UI Message Stream natively — see Vercel AI SDK.

Streaming

Set "stream": true on /v1/chat/completions to receive Server-Sent Events, terminated by data: [DONE]. Add "stream_options": {"include_usage": true} to receive a final chunk with token usage.

curl -N https://llm.clusterbase.dev/v1/chat/completions \
  -H "Authorization: Bearer $CLUSTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6",
    "stream": true,
    "stream_options": { "include_usage": true },
    "messages": [{ "role": "user", "content": "Say hi." }]
  }'

Tool calling and reasoning output are available on streaming requests. A non-streaming response returns text only.

Endpoints

EndpointDescription
POST /v1/chat/completionsOpenAI-compatible chat completions, with optional SSE streaming
POST /v1/chatVercel AI SDK UI Message Stream (streaming only)
GET /v1/modelsModel catalog with context windows and pricing

The full request and response schemas are in the LLM Gateway API reference.

Next steps

On this page