> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytespike.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure your client

> After signing up — wire any client to ByteSpike: base URL, API key, protocol choice, model name.

You signed up, you have a key. Now you need to point your client at
ByteSpike instead of a model vendor's own gateway. The whole gateway
lives at **`https://llm.bytespike.ai`** — every protocol, every model.
Pick the protocol that matches your client, set two env vars, and you're
done.

## 1. Get an API key

Sign in to [console.bytespike.ai/keys](https://console.bytespike.ai/keys)
and **Create key**. Pick the routing group (`claude-default` for Claude
models, `gemini-default` for Gemini, or `default` to route everything —
see [Models](/models) for what's in each group). The plaintext is shown
once at creation — store it. Format: `sk-byts-…`.

<Warning>
  Treat the key like a database password. Each key binds to **one**
  routing group; create separate keys for each model family you want
  to reach instead of trying to put one key everywhere.
</Warning>

## 2. Pick a protocol

Three protocols hit the same gateway. Pick whichever your client speaks
natively — billing, throttling, and credit accounting are identical
across all three.

The URL you use depends on whether you're driving an **SDK** (which
auto-appends the endpoint path) or hand-rolling **curl / REST** (where
you write the full path yourself).

### SDK base URL

Set this as `ANTHROPIC_BASE_URL` / `OPENAI_BASE_URL` / Gemini client
endpoint. The SDK appends `/v1/messages`, `/chat/completions`, or
`/models/{model}:generateContent` for you.

| Protocol                    | SDK base URL                      | Typical clients                                  |
| --------------------------- | --------------------------------- | ------------------------------------------------ |
| **Anthropic Messages**      | `https://llm.bytespike.ai`        | Claude Code, Claude Desktop, Anthropic SDK       |
| **OpenAI Chat Completions** | `https://llm.bytespike.ai/v1`     | OpenAI SDK, Cherry Studio, NextChat, LobeChat    |
| **Gemini Native**           | `https://llm.bytespike.ai/v1beta` | Google AI Studio examples, vertex-compat clients |

### Full endpoint (curl / REST) \[#full-endpoint]

If you're calling the gateway with `curl` or any client that needs the
literal request URL, use the full endpoint instead. **This is what the
console's `Keys → EndpointBanner` copies.**

| Protocol      | Full endpoint                                                    |
| ------------- | ---------------------------------------------------------------- |
| **Anthropic** | `https://llm.bytespike.ai/v1/messages`                           |
| **OpenAI**    | `https://llm.bytespike.ai/v1/chat/completions`                   |
| **Gemini**    | `https://llm.bytespike.ai/v1beta/models/{model}:generateContent` |

Gemini's path needs the model id baked into the URL (e.g.
`gemini-3.1-pro:generateContent`); the other two take the model in the
JSON body.

## 3. Set the env vars

<Tabs>
  <Tab title="Anthropic Messages">
    For Claude Code and the Anthropic SDK, two env vars are all you need:

    ```bash theme={null}
    export ANTHROPIC_BASE_URL=https://llm.bytespike.ai
    export ANTHROPIC_API_KEY=sk-byts-...
    ```

    Any client that reads these standard vars (Claude Code, Anthropic
    Python / TypeScript SDK, third-party clients) picks them up
    transparently. Then call any Anthropic-compatible model:

    ```python theme={null}
    import anthropic
    client = anthropic.Anthropic()  # reads env vars
    msg = client.messages.create(
        model="claude-sonnet-4-6",
        max_tokens=1024,
        messages=[{"role": "user", "content": "hi"}],
    )
    ```

    Or, with the full endpoint via curl:

    ```bash theme={null}
    curl https://llm.bytespike.ai/v1/messages \
      -H "x-api-key: sk-byts-..." \
      -H "anthropic-version: 2023-06-01" \
      -H "content-type: application/json" \
      -d '{
        "model": "claude-sonnet-4-6",
        "max_tokens": 64,
        "messages": [{"role": "user", "content": "hi"}]
      }'
    ```
  </Tab>

  <Tab title="OpenAI Chat Completions">
    OpenAI's SDK takes the base URL as a constructor arg:

    ```python theme={null}
    from openai import OpenAI
    client = OpenAI(
        base_url="https://llm.bytespike.ai/v1",
        api_key="sk-byts-...",
    )
    r = client.chat.completions.create(
        model="gemini-3-5-flash",    # any ByteSpike model id works
        messages=[{"role": "user", "content": "hi"}],
    )
    ```

    Or with env vars on most OpenAI-compat clients:

    ```bash theme={null}
    export OPENAI_BASE_URL=https://llm.bytespike.ai/v1
    export OPENAI_API_KEY=sk-byts-...
    ```

    Full endpoint via curl:

    ```bash theme={null}
    curl https://llm.bytespike.ai/v1/chat/completions \
      -H "Authorization: Bearer sk-byts-..." \
      -H "content-type: application/json" \
      -d '{
        "model": "gpt-5-4",
        "messages": [{"role": "user", "content": "hi"}]
      }'
    ```
  </Tab>

  <Tab title="Gemini Native">
    Google's native protocol passes the key as a query param:

    ```bash theme={null}
    curl "https://llm.bytespike.ai/v1beta/models/gemini-3.1-pro:generateContent?key=sk-byts-..." \
      -H "content-type: application/json" \
      -d '{
        "contents": [{"parts": [{"text": "hi"}]}]
      }'
    ```

    Vertex/AI-Studio SDKs that read `GEMINI_API_KEY` and let you override
    the endpoint will work the same way.
  </Tab>
</Tabs>

## 4. Pick a model

One key calls every model regardless of which vendor originally made it.
You don't need a separate Anthropic / OpenAI / Google / DeepSeek
subscription — ByteSpike serves them all through one endpoint.

Common model IDs (full catalog at
[Console → Models](https://console.bytespike.ai/dosia/models) or via
`GET /v1/models`):

| Family                        | Use these ids                                                 |
| ----------------------------- | ------------------------------------------------------------- |
| Claude                        | `claude-opus-4-8`, `claude-sonnet-4-6`, `claude-haiku-4-5`    |
| GPT-5                         | `gpt-5-5`, `gpt-5-4`, `gpt-5-4-mini`                          |
| Gemini                        | `gemini-3-5-flash`, `gemini-3-flash-lite`                     |
| DeepSeek                      | `deepseek-v4-pro`, `deepseek-v4-flash`                        |
| Kimi / GLM / MiniMax / Doubao | `kimi-k2-6`, `glm-5-1`, `minimax-m2-7`, `doubao-seed-2-0-pro` |
| Image                         | `gpt-image-2`, `nano-banana-pro`, `nano-banana-v2`            |
| Video                         | `veo3-1`, `veo3-1-fast`, `veo3-1-lite`                        |

A model id is the same string regardless of which protocol you use —
`claude-sonnet-4-6` works on Anthropic Messages, OpenAI Chat
Completions, and Gemini Native.

## 5. Client-specific setup

<AccordionGroup>
  <Accordion title="Claude Code (CLI / agent)">
    Claude Code reads `ANTHROPIC_BASE_URL` and `ANTHROPIC_API_KEY`
    automatically. Add to your shell profile:

    ```bash theme={null}
    # ~/.zshrc or ~/.bashrc
    export ANTHROPIC_BASE_URL=https://llm.bytespike.ai
    export ANTHROPIC_API_KEY=sk-byts-...
    ```

    Then `claude` calls every Anthropic-protocol model through ByteSpike.
  </Accordion>

  <Accordion title="Claude Desktop">
    Open Settings → Developer → Edit Config. Add the env vars under your
    OS's section. Restart the app for the change to take.
  </Accordion>

  <Accordion title="Cherry Studio">
    Settings → Model Providers → Add Provider → "OpenAI Compatible".
    Base URL: `https://llm.bytespike.ai/v1`. API key: your ByteSpike key.
    Then any of the model ids from the table above works.
  </Accordion>

  <Accordion title="NextChat / ChatGPT-Next-Web">
    Settings → Custom Endpoint. API URL: `https://llm.bytespike.ai/v1`.
    API Key: your ByteSpike key. Model: any of the ids above.
  </Accordion>

  <Accordion title="OpenAI SDK (Python / TypeScript)">
    Pass `base_url` / `baseURL` in the client constructor. The model
    string is the only thing that changes per call.

    Python:

    ```python theme={null}
    from openai import OpenAI
    OpenAI(base_url="https://llm.bytespike.ai/v1", api_key="sk-byts-...")
    ```

    TypeScript:

    ```ts theme={null}
    import OpenAI from "openai"
    new OpenAI({ baseURL: "https://llm.bytespike.ai/v1", apiKey: "sk-byts-..." })
    ```
  </Accordion>
</AccordionGroup>

## 6. Verify the wiring

Hit `/v1/models` to confirm the key is live and see what your account
can actually call:

```bash theme={null}
curl https://llm.bytespike.ai/v1/models \
  -H "Authorization: Bearer sk-byts-..."
```

The response is a JSON array of model objects. `data[].id` should
include every model your tier exposes. If the list is short and you
expected more, check
[console.bytespike.ai/account](https://console.bytespike.ai/account) —
your `allowed_models` may be capped by an org default or admin policy.

<Tip>
  Errors come back in the protocol's native shape. A 401 means the key is
  wrong; a 403 means the key is fine but the model isn't on your tier; a
  402 means out of credits — top up at
  [console.bytespike.ai/billing](https://console.bytespike.ai/billing).
</Tip>

## Next steps

* [Authentication](/authentication) — full header reference + key management
* [Models](/models) — per-model rate cards and capability tags
* [Error handling](/concepts/error-handling) — retry semantics + status codes
