Docs have been updated. Questions? info@abr5.com
abr5.com

abr5 Docs

The abr5 AI Gateway uses request and response formats compatible with OpenAI. If you have worked with the official OpenAI library, just change base_url and replace the key.

Full platform docs, the cloud service, and all products in Persian at docs.abr5.com . This page is only the API reference for the AI gateway.

Quickstart

1) Create an account and use the Account panel to get an API key. 2) Set the base URL to abr5. 3) Send your first request.

bash
curl https://llm.abr5.com/v1/chat/completions \
  -H "Authorization: Bearer $ABR5_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "abr5-chat",
    "messages": [{"role": "user", "content": "سلام!"}]
  }'
python
from openai import OpenAI

client = OpenAI(
    base_url="https://llm.abr5.com/v1",
    api_key="abr5_...",
)

res = client.chat.completions.create(
    model="abr5-chat",
    messages=[{"role": "user", "content": "سلام!"}],
)
print(res.choices[0].message.content)

Authentication

All requests must include the header Authorization on every request. Create the key in the account panel and protect it like a password; never put the key in browser-side code.

http
Authorization: Bearer abr5_xxxxxxxxxxxxxxxx

Base URL: https://llm.abr5.com/v1

Endpoints

MethodPathUsage
POST/v1/chat/completionsChat and text generation
POST/v1/embeddingsText to embeddings
GET/v1/modelsList of available models
GET/v1/usageAccount quota usage

Streaming responses

By setting stream: true The response comes back in chunks. In the browser, use fetch and ReadableStream for that.

javascript
const res = await fetch("https://llm.abr5.com/v1/chat/completions", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer abr5_..."
  },
  body: JSON.stringify({
    model: "abr5-chat",
    stream: true,
    messages: [{ role: "user", content: "سلام!" }]
  })
});

Error codes

CodeMeaningAction
401Invalid or expired keyRegenerate the key in the account panel
403Access to the model or service is not permittedCheck your account plan
429Rate limit exceededRetry with exponential backoff
500Temporary server errorStatus page for details.

Libraries

The official OpenAI libraries and any tool where base_url can be configured will work:

  • Python: pip install openai
  • Node.js: npm i openai
  • Any HTTP client that supports the header Authorization

Support

If you see an unexpected error, include the request ID (x-request-id) and the error text to info@abr5.com and send it. For enterprise sales matters, use sales@abr5.com for that.