Skip to main content
Any tool that speaks the OpenAI or Anthropic API can use PrimaLabs. Each one needs the same three things:
  • Base URL: https://api.primalabs.ai/v1 for 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.
The examples below show YOUR_API_KEY where your key goes.

Claude Code

Claude Code talks to /v1/messages. Set these environment variables before you start it:
Or set them once for every session in the 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_MODEL is the main model.
  • The three ANTHROPIC_DEFAULT_*_MODEL variables map Claude Code’s opus, sonnet and haiku aliases to PrimaLabs models. Anything that asks for an alias uses them: you, with /model haiku or --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 with 403 (see Troubleshooting).
The cost Claude Code shows (/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 URL https://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:
Or pass 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:
The models reason by default, so 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.