Skip to main content

Documentation Index

Fetch the complete documentation index at: https://doc.onetoken.one/llms.txt

Use this file to discover all available pages before exploring further.

Use Claude Code with Onetoken

Quickstart

This guide gets Claude Code talking to Onetoken in a few minutes.

1. Install Claude Code

Install script

curl -fsSL https://claude.ai/install.sh | bash

npm

Requires Node.js 18+
npm install -g @anthropic-ai/claude-code

2. Point Claude Code at Onetoken

For Anthropic-compatible access via Onetoken, set:
  1. BASE_URLhttps://onetoken.one
  2. AUTH_TOKEN → API key from Onetoken
  3. MODEL → a model id from the model list
  1. Check your default shell:
echo $SHELL
  1. Append exports (replace ONETOKEN_API_KEY):
echo 'export BASE_URL="https://onetoken.one"' >> ~/.zshrc
echo 'export AUTH_TOKEN="ONETOKEN_API_KEY"' >> ~/.zshrc
echo 'export MODEL="claude-sonnet-4-5"' >> ~/.zshrc
  1. Reload:
source ~/.zshrc
  1. Verify in a new terminal:
echo $BASE_URL
echo $AUTH_TOKEN
echo $MODEL

3. Run

From your project:
$ cd /path/your-project
> claude
First launch may ask you to sign in to Anthropic. To skip: Cc 7
  1. Edit ~/.claude.json (macOS/Linux) or C:\Users\%USERNAME%\.claude.json (Windows).
  2. Set hasCompletedOnboarding to true:
{
  "hasCompletedOnboarding": true
}
  1. Save and run claude again.

More ways to pick models (priority high → low)

  1. In session: /model <name> for a one-off switch.
/model claude-sonnet-4-5
  1. CLI flag: claude --model <name> for one run.
claude --model claude-sonnet-4-5
  1. Env defaults (global):
export DEFAULT_OPUS_MODEL="claude-opus-4-5"
export DEFAULT_SONNET_MODEL="claude-sonnet-4-5"
export DEFAULT_HAIKU_MODEL="claude-haiku-4-5"
  • OPUS — hard reasoning / architecture
  • SONNET — everyday coding
  • HAIKU — quick checks, search
  1. settings.json (project or user home):
{
  "env": {
    "DEFAULT_OPUS_MODEL": "claude-opus-4-5",
    "DEFAULT_SONNET_MODEL": "claude-sonnet-4-5",
    "DEFAULT_HAIKU_MODEL": "claude-haiku-4-5"
  }
}

CC-Switch

  1. Open CC-Switch → Add provider.
  1. Choose Custom.
  1. Enter API key and endpoint.
  1. Add to save.
  1. Home → select onetokenStart.

VS Code extension

  1. Install the extension.
I Shot 2026 03 25 11 44 03
  1. Ctrl + Shift + P / Cmd + Shift + PSettings.
I Shot 2026 03 25 11 47 48
  1. Search Claude CodeClaude Code: Environment VariableEdit in settings.json.
I Shot 2026 03 25 11 49 37
  1. Fill claudeCode.environmentVariables with Onetoken values.
I Shot 2026 03 25 11 53 07

FAQ

Q: 401 , No token provided...

In the Claude terminal run /config, enable Use custom API key, verify the token. install

Q: zsh: command not found: claude on macOS

The binary exists but isn’t on PATH. Common locations:
  • ~/.claude/bin
  • ~/.local/bin
ls -l ~/.claude/bin
# or
ls -l ~/.local/bin | grep claude
If in ~/.claude/bin:
echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
If in ~/.local/bin:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Check:
which claude
claude -v

Q: Cannot reach Anthropic

Newer Claude Code builds expect AUTH_TOKEN instead of API_KEY. Update the header name and reload env—key value stays the same. Follow the env steps above.

Q: Login API Error 403

Upgrade Claude Code to the latest version and disable CC-Switch local proxy / failover if enabled. Happy coding!