Prima Get an API key

Prima API

An OpenAI-compatible gateway. Four endpoints, base URL api.prima.li.

Get a key and make one call

paste this

$ curl api.prima.li/chat/completions \
    -H "Authorization: Bearer $PRIMA_KEY" \
    -H "Content-Type: application/json" \
    -d '{"model":"...","messages":[{"role":"user","content":"hello"}]}'

Replace the model id with one from /models.

The four endpoints

EndpointWhat it doesDiffers from OpenAI
GET /models What is available. It does not.
POST /chat/completions Streaming and non-streaming. It does not.
POST /embeddings Vectors. It does not.
GET /usage Your own metering, live. Prima only.
Rate limits Not documented yet.
Deprecation policy Not decided yet.

Authentication and billing

Bearer token in the header. Per-token metering, visible through /usage.

Pricing

Migrating from OpenAI

Swap one URL, keep your code.

Read the migration guide

Where the memory lives

A stone repository is a git repository holding what your sessions write down. Point at yours with a remote, and clone it whenever you want.

PrimaChat