How to use it
One gateway. Call it the OpenAI way or the Anthropic way — whichever your client already speaks.
Your key
Send every request here, whatever server your key is on:
https://api.iqshard.comKeep it in your own environment — a shell export, a secrets manager, an SDK argument. Never paste it into a page, including this one. No key yet? Create one from the dashboard.
Models
Ask the server which models it runs:
curl https://api.iqshard.com/v1/models \
-H "Authorization: Bearer <your API key>"and use one of the ids it gives back:
{
"object": "list",
"data": [
{"id": "glm-5.2", "object": "model", "created": 1730000000, "owned_by": "iqshard"}
]
}created is a timestamp the response schema requires, not a real creation date.
OpenAI-compatible
The shape most OpenAI clients speak: POST /v1/chat/completions, key in Authorization: Bearer.
curl https://api.iqshard.com/v1/chat/completions \
-H "Authorization: Bearer <your API key>" \
-H "Content-Type: application/json" \
-d '{
"model": "<model id from above>",
"messages": [{"role": "user", "content": "ping"}],
"max_tokens": 10
}'Anthropic-compatible
The shape Claude Code and Anthropic's own SDKs speak: POST /v1/messages, against the bare origin above — not the /v1-suffixed one from the OpenAI side. Copying an example from one shape into the other is the most common way these break.
Anthropic's SDKs send the key in x-api-key and add an anthropic-version header. This gateway accepts Authorization: Bearer too, so either works.
curl https://api.iqshard.com/v1/messages \
-H "x-api-key: <your API key>" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "<model id from above>",
"max_tokens": 10,
"messages": [{"role": "user", "content": "ping"}]
}'Status codes
401 — the key is invalid or no longer valid. There's no fix on the same key; mint a new one.
402 — the key's fine, there's just nothing to spend: no Share on that server, an empty PAYG balance, or the server not taking PAYG right now. Buy, renew, top up, or wait for PAYG to reopen — the key never needs replacing.
503 — the gateway can't currently record what it does, so it refuses rather than risk losing track of a request. For a PAYG key, it can also mean a short gap in balance settlement; subscription traffic isn't affected either way. Retry — this clears on its own.