Quickstart
If you already use the OpenAI SDK, start here first. This is the lowest-friction migration path.
You can think of Primordial AI as a unified API gateway. Right now there are two recommended integration patterns:
- OpenAI-compatible: best for most SDKs and apps, using
/v1/chat/completionsor/v1/responses. - Claude Messages: if your existing code already follows the Anthropic format, you can call
/v1/messagesdirectly.
https://www.primoraihub.com/v1
https://www.primoraihub.com/v1/messages
Authorization: Bearer YOUR_API_KEY for OpenAI-compatible endpoints. Use x-api-key: YOUR_API_KEY for Claude Messages.
GET /v1/models with your key. For 401, 404, model-not-found, 429, 5xx, or timeout failures,
follow the API error troubleshooting guide. To configure a browser-based client,
use the Open WebUI connection guide. For a server-managed custom endpoint,
use the LibreChat YAML guide. For workflow automation,
use the n8n HTTP Request guide. For the official Python or Agents SDK Responses path,
use the Responses API custom Base URL guide. Verify one model before enabling optional features.
Interface overview
Models on this platform no longer share a single request shape. The most common integration mistake is this: most text models can use the OpenAI-compatible interface, but image generation and Claude native requests require different payload formats.
| Model type | Recommended endpoint | Core payload shape |
|---|---|---|
| GPT / Codex / Claude / Gemini text models | POST /v1/chat/completions |
model + messages + max_tokens |
| Gemini models through this gateway | POST /v1/chat/completions |
Still use OpenAI-style messages. Do not switch to Google-native contents. |
| Pure image generation | POST /v1/images/generations |
model + prompt + size + n |
| OpenAI Responses-style apps | POST /v1/responses |
model + input + max_output_tokens |
| Claude native format | POST /v1/messages |
model + max_tokens + messages with x-api-key |
GET /v1/models |
List currently available models | Recommended before every new integration |
Model categories
Model availability can change by account group and enabled upstream channel. This page intentionally does not pin a static model inventory:
request GET /v1/models with your API key immediately before integration and copy an ID from that response.
| Category | How to select a current model ID | Recommended integration |
|---|---|---|
| OpenAI / Codex text models | Select a text-model ID returned for your key; do not infer names from another provider. | /v1/chat/completions or /v1/responses |
| Claude models | Select a Claude-family ID currently returned for your key. | /v1/chat/completions or /v1/messages |
| Gemini text / reasoning models | Select a Gemini-family ID currently returned for your key. | /v1/chat/completions |
| Image models | Select an image-capable ID currently shown for your account and verify its endpoint support before production use. | /v1/images/generations |
| Gemini image-capable models | Select an image-capable Gemini ID currently returned for your key. | For now, test and integrate it through /v1/chat/completions |
The safest pattern is still to request GET /v1/models first and read model names directly from the response.
curl https://www.primoraihub.com/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
OpenAI Chat Completions
This is the most universal integration path right now. GPT, Claude, and Gemini models can all be tested through this format first.
model + messages + optional max_tokens /
stream。
curl example
curl https://www.primoraihub.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID_FROM_V1_MODELS",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Introduce Primordial AI in one sentence."}
],
"max_tokens": 512
}'
Python example
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://www.primoraihub.com/v1"
)
resp = client.chat.completions.create(
model="MODEL_ID_FROM_V1_MODELS",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Introduce Primordial AI in one sentence."}
],
max_tokens=512,
)
print(resp.choices[0].message.content)
JavaScript example
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.PRIMORDIAL_API_KEY,
baseURL: "https://www.primoraihub.com/v1",
});
const resp = await client.chat.completions.create({
model: "MODEL_ID_FROM_V1_MODELS",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Introduce Primordial AI in one sentence." }
],
max_tokens: 512
});
console.log(resp.choices[0].message.content);
Gemini integration
This model family is already normalized into the OpenAI-compatible format on this platform, so
do not copy Google-native contents, parts, or generateContent request shapes directly.
The simplest path is to keep using /v1/chat/completions.
POST https://www.primoraihub.com/v1/chat/completions
GET /v1/models for your key.
model and messages, with optional max_tokens and stream
Gemini text model curl example
curl https://www.primoraihub.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "GEMINI_MODEL_ID_FROM_V1_MODELS",
"messages": [
{"role": "user", "content": "Reply with ok only."}
],
"max_tokens": 64
}'
Gemini image-capable model test example
If GET /v1/models returns an image-capable Gemini ID for your key, replace the placeholder below and validate it through
chat/completions before relying on it in production.
curl https://www.primoraihub.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "GEMINI_IMAGE_MODEL_ID_FROM_V1_MODELS",
"messages": [
{"role": "user", "content": "Reply with ok only."}
],
"max_tokens": 64
}'
Image generation
If you want direct image generation, do not call /v1/chat/completions. Use the dedicated
/v1/images/generations endpoint instead.
model + prompt + size + n.
Replace IMAGE_MODEL_ID_FROM_V1_MODELS with an image-capable ID currently available to your account.
curl example
curl https://www.primoraihub.com/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "IMAGE_MODEL_ID_FROM_V1_MODELS",
"prompt": "A minimalist product poster featuring a blue cube, white background, studio lighting",
"n": 1,
"size": "1024x1024"
}'
Python example
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://www.primoraihub.com/v1"
)
result = client.images.generate(
model="IMAGE_MODEL_ID_FROM_V1_MODELS",
prompt="A minimalist product poster featuring a blue cube, white background, studio lighting",
size="1024x1024",
n=1,
)
print(result.data[0].b64_json[:80])
Streaming
For a model and route that support streaming, set stream to true.
When testing an SSE response in a terminal, add -N.
curl -N https://www.primoraihub.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID_FROM_V1_MODELS",
"stream": true,
"messages": [
{"role": "user", "content": "Output three lines: hello, primordial, ai"}
]
}'
The response is a standard data: {...} event stream and ends with [DONE].
Responses API
If your SDK or app has already moved to OpenAI's newer unified interface, you can call /v1/responses directly.
model + input + optional max_output_tokens.
curl https://www.primoraihub.com/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID_FROM_V1_MODELS",
"input": "Reply with ok only.",
"max_output_tokens": 32
}'
chat.completions, there is no need to migrate to
responses just because it is newer. Both routes reach the authentication boundary; verify that your selected model supports the route before production use.
For a production-tested minimal Python request, Agents SDK configuration, and a precise list of unverified optional features, read the Responses API custom Base URL guide.
Claude Messages
If your current Claude integration already follows the Anthropic format, you can keep using it here.
model + max_tokens + messages,
and the auth header must be x-api-key, not Bearer.
curl https://www.primoraihub.com/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "CLAUDE_MODEL_ID_FROM_V1_MODELS",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
Replace CLAUDE_MODEL_ID_FROM_V1_MODELS with a Claude-family ID currently returned for your key.
If you prefer to keep one shared integration style, you can also call Claude models through OpenAI-compatible /v1/chat/completions.
Referral program status
Referral links can associate a new registration with an inviter. Production settings checked on August 24, 2026 grant zero signup reward to both the inviter and invitee.
Not recommended right now
To keep this documentation aligned with the platform's actual production-ready capabilities, the following are intentionally not covered here:
/v1/embeddings: there is currently no active embedding channel.- Audio, files, Assistants, fine-tuning, and other interfaces are not currently documented as primary external capabilities.
FAQ
1. What should I use as the Base URL?
For OpenAI-compatible SDKs, use https://www.primoraihub.com/v1.
2. Why do I get a “model not found” error?
Always trust the result of GET /v1/models. Do not reuse model names from other platforms.
3. Do Claude models have to use /v1/messages?
No. You can also use /v1/chat/completions as long as the model name is a Claude model.
4. Why can’t I copy Google-native Gemini examples directly?
Because Gemini is normalized into an OpenAI-compatible interface on this platform. The recommended path is /v1/chat/completions with messages.
5. Which endpoint should I use for image generation?
Use /v1/images/generations for pure image generation, and replace IMAGE_MODEL_ID_FROM_V1_MODELS with an image-capable ID currently available to your account.
6. How can I verify that my API key works?
The simplest method is to call GET /v1/models. If it returns a model list, authentication is working.