Skip to main content

Getting Started

Get from zero to your first API call in a few minutes.

1. Create a key

Open the Primex Telegram botAISetup, and create an API key. Keys look like prx-xxxxxxxx… and carry your credit balance. Keep it secret — treat it like a password.

Top up credits from the same AI section (see Billing & Credits).

2. Pick a base URL

Primex speaks two request formats. Use whichever matches your tooling — both bill through the same prx- key.

FormatBase URL
OpenAI-compatiblehttps://gateway.primex.work/v1
Anthropic-compatiblehttps://gateway.primex.work

3. Make a request

cURL

curl https://gateway.primex.work/v1/chat/completions \
-H "Authorization: Bearer prx-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [{"role": "user", "content": "Say hello in one line."}]
}'

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
base_url="https://gateway.primex.work/v1",
api_key="prx-YOUR_KEY",
)

resp = client.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Say hello in one line."}],
)
print(resp.choices[0].message.content)

Node (OpenAI SDK)

import OpenAI from "openai";

const client = new OpenAI({
baseURL: "https://gateway.primex.work/v1",
apiKey: "prx-YOUR_KEY",
});

const resp = await client.chat.completions.create({
model: "gpt-5.5",
messages: [{ role: "user", content: "Say hello in one line." }],
});
console.log(resp.choices[0].message.content);

4. Use a Claude model (Anthropic format)

Prefer Claude, or using the Anthropic SDK / Claude Code? Point at the base URL without /v1:

export ANTHROPIC_BASE_URL=https://gateway.primex.work
export ANTHROPIC_API_KEY=prx-YOUR_KEY

See Client Setup → Claude Code for the full workflow.

Next steps