Home / Docs / Troubleshooting

Troubleshooting

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

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"

200 means the URL and key are both fine and the problem is in your client. Anything else is covered below.

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_foundDisplay name used instead of an api idModels endpoint
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@claudeapikey.dev 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.