bn-router

API reference

A single OpenAI-compatible endpoint for every connected model.

Endpoint

All chat completions go to a single endpoint. Replace the placeholder with the base URL shown in your dashboard.

Endpoint
POST https://YOUR-BASE-URL/v1/chat/completions

Chat completions

The request body follows the OpenAI chat completions format. Set model to any model id from the model plaza.

Request body
{
  "model": "your-model-id",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Write a haiku about gateways."}
  ],
  "temperature": 0.7
}

Errors

Errors follow the OpenAI error format: a JSON object with an error code and message. Common codes include authentication failures, rate limits, and insufficient balance.

Error body
{
  "error": {
    "code": "insufficient_balance",
    "message": "Your balance is too low to complete this request."
  }
}