Skip to content

Base URL and authentication

Each API format uses a slightly different address; the difference is whether it ends in /v1:

API formatAddressUsed by
OpenAI-compatiblehttps://api.rabah.ai/v1Most apps and SDKs, Codex CLI, OpenCode
Anthropichttps://api.rabah.aiClaude Code and other Claude clients
Gemini nativehttps://api.rabah.aiGemini 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.

Put the key in a request header, either of:

Authorization: Bearer YOUR_KEY
x-api-key: YOUR_KEY

Most OpenAI-compatible apps use the first; Claude clients usually use the second. The Gemini native API also accepts an x-goog-api-key header.

Append these paths to the OpenAI-compatible address https://api.rabah.ai/v1:

PathPurpose
POST /chat/completionsChat — the most widely supported endpoint
POST /responsesOpenAI Responses API, used by Codex
POST /messagesAnthropic Messages API, used by Claude clients
GET /modelsList the models this key can use
POST /embeddingsText embeddings
POST /images/generationsGenerate images
POST /images/editsEdit images

You rarely need to build these yourself: set the base URL in your app and it adds the path.

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.

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.