Developer field guide
How to use Claude Code with a custom API
Claude Code needs three pieces of information: where to send requests, which key pays for them, and which model to use. For an AngelAPI prepaid key, use the Anthropic-compatible endpoint. The OpenAI-compatible URL ending in /v1 is for a different kind of client.
Set the endpoint, key and model
Start in a fresh terminal with Claude Code installed. Copy an available Claude model ID from model status. In this Bash or zsh example, replace the model placeholder and set ANGELAPI_KEY using your local secret manager first. Keep real keys out of screenshots, repositories and shared settings files.
export ANTHROPIC_BASE_URL="https://api.angelapi.cc"
export ANTHROPIC_API_KEY="${ANGELAPI_KEY:?Set ANGELAPI_KEY first}"
export ANTHROPIC_MODEL="YOUR_AVAILABLE_CLAUDE_MODEL_ID"
claudeCheck the connection before running a coding task
Open /status in Claude Code and inspect the provider configuration. Then ask for a one-sentence reply before letting the client read a larger project. A real model response consumes prepaid balance. For PowerShell examples or persistent settings, use the AngelAPI setup console.
Three errors that look similar
Unauthorized: check that this terminal has the AngelAPI key you intended, not a different provider’s key or a conflicting auth token. Endpoint not found: use the bare gateway origin shown above; do not append /v1/messages. Model not found: copy the exact model ID again. Changing the URL alone does not make every Claude model available.
For how Claude Code treats gateway credentials versus a subscription, see Anthropic’s gateway documentation.
Related guides
- Cheap Claude Code API access: compare the real cost
Estimate a coding session using input and output prices, compare prepaid packs with a subscription, and check which Claude models are available before paying.
- GLM API in Malaysia: pay in MYR and make a request
Find an available GLM model, check its token rates, buy a prepaid pack in ringgit and send your first OpenAI-compatible request from your own terminal.