- Base URL:
https://api.primalabs.ai/v1for OpenAI-style clients,https://api.primalabs.ai(no/v1) for Anthropic-style clients. - API key: create one in the dashboard.
- Model: the full name from the catalog, owner included, such as
primalabs-ai/DeepSeek-V4.1-Flash-1017.
YOUR_API_KEY where your key goes.
Claude Code
Claude Code talks to/v1/messages. Set these environment variables before you start
it:
env block of ~/.claude/settings.json. This
file holds your key in plain text: keep it in your home directory, never in a project’s
.claude/settings.json, which is usually committed.
~/.claude/settings.json
ANTHROPIC_MODELis the main model.- The three
ANTHROPIC_DEFAULT_*_MODELvariables map Claude Code’sopus,sonnetandhaikualiases to PrimaLabs models. Anything that asks for an alias uses them: you, with/model haikuor--model sonnet, and subagents or background tasks that pick an alias themselves. Pick any models from the catalog, and set all three. Without them, an alias sends a Claude model name, which fails with403(see Troubleshooting).
/cost, total_cost_usd) is computed from its own price
list, not ours, and can be far off. Your actual spend is on the dashboard and in
GET /v1/credits.
Other tools
Editors and agents with an “OpenAI-compatible” provider setting take the same three values: base URLhttps://api.primalabs.ai/v1, your API key, and the full model name. Enter the base URL
without an endpoint on the end: .../v1, not .../v1/chat/completions.
OpenAI SDK
The OpenAI SDKs read their settings from the environment, so existing code can switch with no changes:base_url (Python) / baseURL (Node) and api_key / apiKey to the client, as
in the Quickstart.
Anthropic SDK
The Anthropic SDKs take the base URL without/v1. Set ANTHROPIC_BASE_URL and
ANTHROPIC_API_KEY, or pass them to the client:
content usually starts with a
thinking block. Read the text block, not content[0]. max_tokens counts the
reasoning too, so leave it room: if it runs out while the model is still reasoning, there is no
text block at all (stop_reason: "max_tokens").
Troubleshooting
More status codes are in Errors.