Quickstart
Get a key, set two environment variables, and make your first request in about a minute.
This page takes you from nothing to a working response. It assumes only curl; SDK versions are in SDKs.
Step 1 — Create a key
- Register an account and confirm your email.
- Top up credits or buy an unlimited plan. New accounts get a bonus on the first crypto top-up — see Pricing.
- Open the dashboard, go to API Keys, and create a key. It begins with
sk-. - Copy it immediately — the full value is shown once.
Step 2 — Export it
export CLAUDEAPIKEY="sk-your-key-here"
Step 3 — Call the API
Anthropic format
curl https://aiprimetech.io/v1/messages \
-H "x-api-key: $CLAUDEAPIKEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello"}]
}'
OpenAI format
Identical models, different envelope — pick whichever matches your client:
curl https://aiprimetech.io/v1/chat/completions \
-H "Authorization: Bearer $CLAUDEAPIKEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Hello"}]
}'
Step 4 — Confirm what you can reach
curl https://aiprimetech.io/v1/models \
-H "Authorization: Bearer $CLAUDEAPIKEY"
That returns every model id your key can address. Use those ids verbatim in the model field.
Step 5 — Point a real tool at it
For Claude Code, two variables are the whole setup:
export ANTHROPIC_BASE_URL="https://aiprimetech.io"
export ANTHROPIC_AUTH_TOKEN="$CLAUDEAPIKEY"
claude
If
ANTHROPIC_API_KEY is already set in your shell, Claude Code may bill that key instead and silently ignore your subscription. Unset it when switching. See Claude Code.Troubleshooting the first call
| Symptom | Cause | Fix |
|---|---|---|
401 | Key missing, mistyped, or sent in the wrong header | Anthropic format uses x-api-key; OpenAI format uses Authorization: Bearer |
402 | No credits and no active plan | Top up or buy a plan |
404 on /v1/chat/completions | Client is calling the Anthropic path with an OpenAI body, or vice versa | Match the format to the endpoint — see Overview |
model_not_found | Model id not spelled exactly as returned by /v1/models | Copy the id from the models endpoint |