Skip to content

API Overview

Brivionix provides a fully OpenAI-compatible API. Use any OpenAI SDK or client to call it directly.

Base Information

ItemValue
Base URLhttps://brivionix.com
API Path Prefix/v1
Full API URLhttps://brivionix.com/v1
AuthenticationBearer Token
Request FormatJSON (application/json)
Response FormatJSON or SSE (streaming)

Authentication

Include your API Key in the Authorization header:

bash
Authorization: Bearer sk-your-api-key

Create and manage API Keys in the Brivionix Console.

Available Endpoints

EndpointMethodDescription
/v1/chat/completionsPOSTChat completions (primary)
/v1/modelsGETList available models
/v1/images/generationsPOSTImage generation
/v1/embeddingsPOSTText embeddings
/v1/audio/transcriptionsPOSTSpeech to text
/v1/audio/speechPOSTText to speech
/v1/rerankPOSTDocument re-ranking
/v1/realtimeGETReal-time conversation (WebSocket)

Quick Test

bash
curl https://brivionix.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-api-key" \
  -d '{"model": "gpt-5.4-mini", "messages": [{"role": "user", "content": "Hello!"}]}'

Error Codes

HTTP CodeMeaningAction
200Success
400Bad requestCheck request body format
401UnauthorizedCheck API Key
403ForbiddenCheck token permissions for the model
429Rate limitedReduce request frequency, add retry logic
500Server errorRetry later
503Service unavailableUpstream provider issue, retry later

Rate Limiting

When you receive a 429 status, implement exponential backoff:

python
import time
from openai import OpenAI, RateLimitError

client = OpenAI(
    api_key="sk-your-api-key",
    base_url="https://brivionix.com/v1",
)

def chat_with_retry(messages, max_retries=3):
    for i in range(max_retries):
        try:
            return client.chat.completions.create(
                model="gpt-5.4-mini",
                messages=messages,
            )
        except RateLimitError:
            wait = 2 ** i
            print(f"Rate limited, retrying in {wait}s...")
            time.sleep(wait)
    raise Exception("Max retries exceeded")

Next Steps