Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.gravitex.ai/llms.txt

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

1. Overview

Claude Code is Anthropicโ€™s official terminal AI coding client. Through GravitexAI (Anthropic-compatible API) you get:

Multi-vendor access

Use the full Claude family, Kimi K2, GPT and more behind one endpoint

Dual-thread model

Heavy tasks on the main thread, lightweight ones on the haiku thread

No subscription

Pay per token โ€” no Claude Pro required

Stable globally

Distributed nodes with automatic failover

2. Install Node.js (skip if installed)

Make sure Node.js is โ‰ฅ 18.0.

Uninstall other proxy clients (optional)

If you previously installed another forked @anthropic-ai/claude-code, clean it up first:
# Check installation locations
npm ls @anthropic-ai/claude-code
npm ls -g @anthropic-ai/claude-code

# Uninstall
npm uninstall @anthropic-ai/claude-code
npm uninstall -g @anthropic-ai/claude-code

3. Install Claude Code

1

Global install

npm install -g @anthropic-ai/claude-code
2

Verify install

claude --version

4. Get your GravitexAI key

1

Sign in

2

Create a key

Open API Keys โ†’ create a new token.
3

Note the info

base_url = "https://api.gravitex.ai"
api_key  = "sk-zbTYx*******************************fceTvn5"
Claude Codeโ€™s ANTHROPIC_BASE_URL does not need a /v1 suffix โ€” use https://api.gravitex.ai directly.

5. Configure Environment Variables

5.1 Basic example (single model)

export ANTHROPIC_BASE_URL="https://api.gravitex.ai"
export ANTHROPIC_AUTH_TOKEN="sk-zbTYx*******************************fceTvn5"
export ANTHROPIC_MODEL="kimi-k2-250905"
cd your-project-folder
claude

5.2 Dual-thread architecture

By default Claude Code uses a dual-thread model architecture that saves cost:
ThreadEnv varPurpose
MainANTHROPIC_MODELPrimary codegen, conversation, complex tasks
HaikuANTHROPIC_DEFAULT_HAIKU_MODELFile watching, linter checks, completion, background jobs
Typical pairing: main thread on claude-opus-4-7 or claude-sonnet-4-6 for heavy lifting, haiku thread on claude-haiku-4-5-20251001 for background work โ€” high quality at much lower token cost.
export ANTHROPIC_BASE_URL="https://api.gravitex.ai"
export ANTHROPIC_AUTH_TOKEN="sk-zbTYx*******************************fceTvn5"
export ANTHROPIC_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5-20251001"
cd your-project-folder
claude

5.4 Single model (optional)

If you only want one model, there are two options: Option A โ€” set both env vars to the same model
export ANTHROPIC_BASE_URL="https://api.gravitex.ai"
export ANTHROPIC_AUTH_TOKEN="sk-zbTYx*******************************fceTvn5"
export ANTHROPIC_MODEL="kimi-k2-250905"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="kimi-k2-250905"
cd your-project-folder
claude
Option B โ€” switch in-session Keep the dual-model config, start Claude Code, then in the interactive UI:
/model haiku
The main thread switches to the model from ANTHROPIC_DEFAULT_HAIKU_MODEL.
ScenarioMain (ANTHROPIC_MODEL)Haiku (ANTHROPIC_DEFAULT_HAIKU_MODEL)
Production (top)claude-opus-4-7claude-haiku-4-5-20251001
Daily dev (recommended)claude-sonnet-4-6claude-haiku-4-5-20251001
Cost-optimizedkimi-k2-250905claude-haiku-4-5-20251001
Long contextclaude-sonnet-4-5-20250929 (200K)claude-haiku-4-5-20251001
Quick smoke-testclaude-haiku-4-5-20251001claude-haiku-4-5-20251001
See full IDs in the GravitexAI model catalog.

7. FAQ

  1. Check ANTHROPIC_AUTH_TOKEN for stray whitespace or newlines.
  2. Confirm the key is active in the GravitexAI console.
  3. Ensure your balance is positive.
For Claude Code, do not append /v1 to ANTHROPIC_BASE_URL. Use https://api.gravitex.ai (Anthropic protocol differs from OpenAI).
In the interactive UI:
/model              # show current model
/model haiku        # switch to ANTHROPIC_DEFAULT_HAIKU_MODEL
/model sonnet       # alias supported in some versions
Or exit, change env vars, and re-launch.
Use the full ID from the GravitexAI model list, e.g.:
  • โœ… claude-sonnet-4-5-20250929
  • โŒ claude-sonnet-4-5
The version suffix is required.
  1. Prefer the dual-model setup with Haiku as the background thread.
  2. Use --max-turns and similar flags to cap conversation length.
  3. Maintain project memory under .claude/ to avoid repeating context.
  4. Use /clear to drop stale context.
Put env vars into a project .env, your shell profile, or direnv. Each engineer only swaps in their own ANTHROPIC_AUTH_TOKEN.

8. References