Home / Docs / Troubleshooting

Troubleshooting

Symptom-first index — find what you are seeing and jump to the cause.

Check access before retrying

  1. Check whether the intended entitlement is active and note its expiry.
  2. Confirm the key uses the intended group. Timed Claude plans use Claude Unlimited; Codex access is separate.
  3. List models with that same key, select a returned ID, and send one small request.

Use Models and key groups or the agent setup checklist if you are unsure which step failed.

Nothing works at all

Establish the baseline before debugging anything else:

curl -s -o /dev/null -w "%{http_code}\n" https://aiprimetech.io/v1/models \
  -H "Authorization: Bearer $CLAUDEAPIKEY"

After a successful model-list response, check the selected model against the list and send one small generation request. Generation can still fail because of model availability, entitlement, limits or client configuration.

By symptom

SymptomLikely causeFix
404 on every callBase URL has the wrong /v1 handlingBase URLs
401 with a key you just createdWrong header for the format, or a trailing spaceAuthentication
402No credits, or plan expiredTop up · Plans
400 max_tokensMessages requires max_tokens; Chat Completions does notMessages
model_not_foundWrong ID, wrong key group, or model unavailable for that keyModels and key groups
Streaming connects but yields nothingParsing the other format's event shapeStreaming
Reply cut off mid-sentencestop_reason: max_tokensRaise max_tokens
Works in curl, fails in the SDKSDK appends its own path to your base URLBase URLs
Usage not showing in dashboardRequests going to a different key or endpointCheck ANTHROPIC_API_KEY is unset — Claude Code
Frequent 429Agent parallelism too highRate limits
Bill higher than expectedContext growth across turnsContext management

Reading the error body

The status code tells you the class of problem; the error.type and error.message fields tell you which one. Log the whole body — a 400 with "missing max_tokens" and a 400 with "invalid role" need completely different fixes.

Still stuck

Contact support@aiprimetech.io with the endpoint, the model id, the status code and the error body. Never include your API key — if you already pasted it somewhere, revoke it first.