Models endpoint
GET /v1/models — discover exactly which model ids your key can call.
The authoritative list. If an id is not here, your key cannot call it — do not guess ids from documentation or blog posts.
curl https://aiprimetech.io/v1/models \
-H "Authorization: Bearer $CLAUDEAPIKEY"
Response
{
"object": "list",
"data": [
{"id": "claude-opus-4-8", "object": "model", "owned_by": "anthropic"},
{"id": "claude-sonnet-4-6", "object": "model", "owned_by": "anthropic"},
{"id": "gpt-5.5", "object": "model", "owned_by": "openai"}
]
}
Practical uses
- Health check. A 200 proves base URL and key are both correct before you debug anything else.
- Populating a model picker. Read ids at startup instead of hardcoding a list that goes stale.
- Catching typos. Validate a configured model id against this list and fail loudly at boot rather than on the first user request.
import os, httpx
r = httpx.get(
class="s">"https://aiprimetech.io/v1/models",
headers={class="s">"Authorization": fclass="s">"Bearer {os.environ['CLAUDEAPIKEY']}"},
timeout=20,
)
r.raise_for_status()
ids = [m[class="s">"id"] for m in r.json()[class="s">"data"]]
assert class="s">"claude-sonnet-4-6" in ids, class="s">"configured model not available on this key"