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.- Windows
- macOS
- Ubuntu / Debian
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
Go to the GravitexAI console.
2
Create a key
Open API Keys โ create a new token.
3
Note the info
5. Configure Environment Variables
5.1 Basic example (single model)
- Mac / Linux
- Windows CMD
- Windows PowerShell
5.2 Dual-thread architecture
By default Claude Code uses a dual-thread model architecture that saves cost:5.3 Recommended config (dual model)
- Mac / Linux
- Windows CMD
- Windows PowerShell
5.4 Single model (optional)
If you only want one model, there are two options: Option A โ set both env vars to the same modelANTHROPIC_DEFAULT_HAIKU_MODEL.
6. Recommended Combinations (via GravitexAI)
See full IDs in the GravitexAI model catalog.
7. FAQ
401 / invalid API key
401 / invalid API key
- Check
ANTHROPIC_AUTH_TOKENfor stray whitespace or newlines. - Confirm the key is active in the GravitexAI console.
- Ensure your balance is positive.
404 / wrong endpoint
404 / wrong endpoint
For Claude Code, do not append
/v1 to ANTHROPIC_BASE_URL. Use https://api.gravitex.ai (Anthropic protocol differs from OpenAI).400 / ValidationException / Extra inputs are not permitted
400 / ValidationException / Extra inputs are not permitted
This issue is often caused by Claude Code experimental Beta feature parameters (e.g. For detailed steps and troubleshooting, see the Claude Code ๆฅ้ 400 ่งฃๅณๆๅ.
cache_control, scope) that are not supported on AWS Bedrock Claude.Fix: Add the following env var in settings.json to disable experimental Betas:How to switch models inside Claude Code?
How to switch models inside Claude Code?
In the interactive UI:Or exit, change env vars, and re-launch.
`model not found` error
`model not found` error
Use the full ID from the GravitexAI model list, e.g.:
- โ
claude-sonnet-4-5-20250929 - โ
claude-sonnet-4-5
How to reduce token cost?
How to reduce token cost?
- Prefer the dual-model setup with Haiku as the background thread.
- Use
--max-turnsand similar flags to cap conversation length. - Maintain project memory under
.claude/to avoid repeating context. - Use
/clearto drop stale context.
Team-wide config?
Team-wide config?
Put env vars into a project
.env, your shell profile, or direnv. Each engineer only swaps in their own ANTHROPIC_AUTH_TOKEN.8. References
- Claude Code official docs: https://docs.anthropic.com/en/docs/claude-code
- GravitexAI console: https://maas.gravitex.ai
- Model catalog: https://maas.gravitex.ai/#/models
- API keys: https://maas.gravitex.ai/#/keys
