Skip to main content

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:

3. Install Claude Code

1

Global install

2

Verify install

4. Get your GravitexAI key

1

Sign in

2

Create a key

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

Note the info

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)

5.2 Dual-thread architecture

By default Claude Code uses a dual-thread model architecture that saves cost:
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.

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
Option B โ€” switch in-session Keep the dual-model config, start Claude Code, then in the interactive UI:
The main thread switches to the model from ANTHROPIC_DEFAULT_HAIKU_MODEL. 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).
This issue is often caused by Claude Code experimental Beta feature parameters (e.g. cache_control, scope) that are not supported on AWS Bedrock Claude.Fix: Add the following env var in settings.json to disable experimental Betas:
For detailed steps and troubleshooting, see the Claude Code ๆŠฅ้”™ 400 ่งฃๅ†ณๆŒ‡ๅ—.
In the interactive UI:
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