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

# Claude Code on Sideren.

> Claude Code speaks the Anthropic Messages dialect, and Sideren serves every model in its catalog on that dialect — so Claude Code runs on any of our models. Four environment variables, or one command.

## Any model, one base URL

Claude Code is a harness: it sends Anthropic Messages requests to whatever
`ANTHROPIC_BASE_URL` points at. Sideren's `/v1/messages` endpoint serves the catalog's
models in that format — GLM, DeepSeek, Kimi, Qwen, GPT and the rest — with tools,
streaming and thinking carried through. Point Claude Code at Sideren and pick a
[catalog id](/models) as its model.

A model serves Claude Code's tool traffic on a route only after that route passes
Sideren's own qualification tests (long tool loops, thinking, streaming); until then it
isn't offered for tool use.

## One command

```sh theme={null}
npx sideren setup --tool claude-code --key sdn_your_key
```

The setup helper writes Sideren's settings into `~/.claude/settings.json` (the base URL, your
key and the model slots), backs up what was there, and is safe to re-run. See
[setup helper](/setup) for everything it can do.

Sideren keys intentionally begin with `sdn_`. Do not paste one into Anthropic's own API-key
or consumer Claude desktop sign-in field, which expects an Anthropic credential and does not
configure a custom API base URL. The setup below is for **Claude Code** on Windows, macOS, or Linux.

## By hand

Set four variables — in `~/.claude/settings.json` under `env`, or exported in your shell:

<CodeGroup>
  ```json settings.json theme={null}
  {
    "env": {
      "ANTHROPIC_BASE_URL": "https://api.sideren.io",
      "ANTHROPIC_AUTH_TOKEN": "sdn_your_key",
      "ANTHROPIC_MODEL": "@sdn/glm-5.3",
      "ANTHROPIC_DEFAULT_HAIKU_MODEL": "@sdn/glm-5.3-flash"
    }
  }
  ```

  ```sh shell theme={null}
  export ANTHROPIC_BASE_URL=https://api.sideren.io
  export ANTHROPIC_AUTH_TOKEN=sdn_your_key
  export ANTHROPIC_MODEL="@sdn/glm-5.3"
  export ANTHROPIC_DEFAULT_HAIKU_MODEL="@sdn/glm-5.3-flash"
  ```

  ```powershell Windows PowerShell theme={null}
  $env:ANTHROPIC_BASE_URL="https://api.sideren.io"
  $env:ANTHROPIC_AUTH_TOKEN="sdn_your_key"
  $env:ANTHROPIC_MODEL="@sdn/glm-5.3"
  $env:ANTHROPIC_DEFAULT_HAIKU_MODEL="@sdn/glm-5.3-flash"
  claude
  ```
</CodeGroup>

* `ANTHROPIC_BASE_URL` — the gateway **origin only**. Do **not** append `/v1`; Claude Code
  adds `/v1/messages` itself.
* `ANTHROPIC_AUTH_TOKEN` — your `sdn_` key.
* `ANTHROPIC_MODEL` — the main model. `@sdn/glm-5.3` is a strong agentic coding driver; any
  [catalog id](/models) works, including `@sdn/deepseek-v4-pro`, `@sdn/kimi-k2.7-code` and the
  GPT models your plan includes.
* `ANTHROPIC_DEFAULT_HAIKU_MODEL` — the model the `haiku` alias points to, which Claude Code
  also uses for quick auxiliary calls (titles, summaries); `@sdn/glm-5.3-flash` keeps them
  near-free.

If the model you name can't be served, the gateway may answer with a comparable model and
keep the session moving — the response still echoes the id you sent. Pin a
`delivery: "exact"` catalog id when the exact model matters. See
[Model routing](/guides/model-routing).

## Verify

Start `claude` and run a trivial prompt. To confirm the wiring end-to-end without Claude
Code in the loop:

```sh theme={null}
npx sideren test --key sdn_your_key
```

## Troubleshooting

* **Still using your Anthropic account?** `ANTHROPIC_AUTH_TOKEN` takes precedence over a
  saved login, so you don't need to sign out. Run `/status` to see which credential is
  active, and run `/logout` once if Claude Code warns about two credential sources at startup.
* **404s on every call?** The base URL probably includes `/v1` — use the bare origin.
* **401 unauthorized?** Put the key in `ANTHROPIC_AUTH_TOKEN`, which Claude Code sends as
  `Authorization: Bearer`. A key in `ANTHROPIC_API_KEY` is ignored until you approve it once
  (`/config` → Use custom API key).
* **Windows app rejects a Sideren key before making a request?** Make sure you are configuring
  Claude Code from PowerShell or `~/.claude/settings.json`, not the consumer Claude desktop app's
  Anthropic sign-in/API-key field. The one-command setup above avoids that prompt.
* **Context meter looks off?** Claude Code budgets with
  [count\_tokens](/api/count-tokens), which returns an estimate — billing always uses exact
  usage from real responses.
* **Sessions:** conversation identity is derived from the requests Claude Code already
  sends — its turns stay on a warm cache with no extra header to configure
  ([Prompt caching](/guides/prompt-caching)).

<Note>
  Model choice is per-variable, so you can run the premium model as the main driver and
  keep the fast tier on auxiliary calls. Check that your plan includes both
  ([Plans & limits](/plans#model-access-by-plan)): the `@sdn/glm-5.3` models above need
  Starter or higher, and Free has its own ten models.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.