Base URL and authentication
Base URL
Section titled “Base URL”Each API format uses a slightly different address; the difference is whether it ends in /v1:
| API format | Address | Used by |
|---|---|---|
| OpenAI-compatible | https://api.rabah.ai/v1 | Most apps and SDKs, Codex CLI, OpenCode |
| Anthropic | https://api.rabah.ai | Claude Code and other Claude clients |
| Gemini native | https://api.rabah.ai | Gemini CLI, Google’s official SDKs |
Apps name this setting differently — Base URL, API URL, API Endpoint — but it always takes the address above.
https://hub.rabah.ai also accepts API calls, but use api.rabah.ai: the former is the web console, the latter is meant for API traffic.
Passing the key
Section titled “Passing the key”Put the key in a request header, either of:
Authorization: Bearer YOUR_KEYx-api-key: YOUR_KEYMost OpenAI-compatible apps use the first; Claude clients usually use the second. The Gemini native API also accepts an x-goog-api-key header.
Endpoints
Section titled “Endpoints”Append these paths to the OpenAI-compatible address https://api.rabah.ai/v1:
| Path | Purpose |
|---|---|
POST /chat/completions | Chat — the most widely supported endpoint |
POST /responses | OpenAI Responses API, used by Codex |
POST /messages | Anthropic Messages API, used by Claude clients |
GET /models | List the models this key can use |
POST /embeddings | Text embeddings |
POST /images/generations | Generate images |
POST /images/edits | Edit images |
You rarely need to build these yourself: set the base URL in your app and it adds the path.
Models and lines
Section titled “Models and lines”Set model in the request to a model name from the Model Plaza.
A model may be offered on several lines, and one key can use all of them:
- Model name only, e.g.
claude-sonnet-4-6: uses the model’s default line. model:line-code, e.g.claude-sonnet-4-6:pro: uses that specific line.
Line codes are listed in the Model Plaza. GET /v1/models also lists, for models on several lines, the model:line-code form of each. For how the default line is chosen and what happens when a line is unavailable, see Lines.
Limiting what a key can do
Section titled “Limiting what a key can do”When you create or edit a key you can keep separate keys for separate uses and set:
- Lines & Models: only the lines and models you tick.
- Quota: the most this key can ever spend.
- Rate limits: the most it can spend in 5 hours, 1 day and 7 days.
- Expiry: the key stops working after this date.
- IP restriction: allow or block specific IPs.
For example, give a shared automation script its own key with a quota: if the key leaks, the damage is capped.