# Overview



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](/docs/llm-gateway/api-keys) (`ccp_live_ak_…`), created in
the [Console](https://console.clusterbase.ai).

## Jump straight in [#jump-straight-in]

<Tabs items="['cURL', 'TypeScript', 'Python', 'AI SDK']">
  <Tab value="cURL">
    ```bash
    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]}" }
        ]
      }'
    ```
  </Tab>

  <Tab value="TypeScript">
    Use the OpenAI SDK with the gateway's base URL:

    ```ts
    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);
    ```
  </Tab>

  <Tab value="Python">
    Use the OpenAI SDK with the gateway's base URL:

    ```python
    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)
    ```
  </Tab>

  <Tab value="AI SDK">
    Use the Vercel AI SDK through its OpenAI-compatible provider:

    ```ts
    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](/docs/llm-gateway/ai-sdk).
  </Tab>
</Tabs>

## Streaming [#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.

```bash
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 [#endpoints]

| Endpoint                    | Description                                                     |
| --------------------------- | --------------------------------------------------------------- |
| `POST /v1/chat/completions` | OpenAI-compatible chat completions, with optional SSE streaming |
| `POST /v1/chat`             | Vercel AI SDK UI Message Stream (streaming only)                |
| `GET /v1/models`            | Model catalog with context windows and pricing                  |

The full request and response schemas are in the
[LLM Gateway API reference](/docs/api/llm-gateway).

## Next steps [#next-steps]

* [Create an API key](/docs/llm-gateway/api-keys) in the Console.
* Browse [models and pricing](/docs/llm-gateway/models).
* Build a chat UI with the [Vercel AI SDK](/docs/llm-gateway/ai-sdk).
