Integration tutorial
Connect Claude Code
Route Claude Code through the Anthropic-compatible Messages endpoint.
01
Buy or create a key
Use guest checkout or create an account key.
02
Set the base URL
https://discountedtokens.com/v1
03
Send a small test
Verify the route before moving production traffic.
Shell environment
export ANTHROPIC_BASE_URL="https://discountedtokens.com"
export ANTHROPIC_AUTH_TOKEN="YOUR_DISCOUNTEDTOKENS_KEY"
export ANTHROPIC_MODEL="gpt-5.6"
claude
Run and verify
curl -X POST "$ANTHROPIC_BASE_URL/v1/messages" \
-H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"gpt-5.6","max_tokens":8,"messages":[{"role":"user","content":"Reply OK"}]}'
Troubleshooting
- Verify the one-call curl request before opening Claude Code.
- Use ANTHROPIC_AUTH_TOKEN because DiscountedTokens accepts bearer gateway credentials.
- Basic Messages text routing is certified here. Claude Code tool blocks, extended thinking, and streaming are not certified and may not pass through.
- Third-party gateway compatibility can lag Claude Code features; test your required tools before production use.
Configuration source: official documentation. DiscountedTokens is an independent gateway and is not endorsed by the client vendor.