ACCA Router Documentation

Full API reference v1: authentication, endpoints, streaming, JSON examples, rate limits, and the error catalogue.

Quickstart

ACCA Router is an AI Router & Marketplace gateway with a single OpenAI-compatible endpoint for many models. You get centralized token quota, per-key rate limits, and model access control.

  1. Get an API key from the dashboard (My Key menu) or the Telegram bot.
  2. Set the base URL to https://ai.accarouter.site/v1.
  3. Use a model name from GET /v1/models.
  4. Send a request to POST https://ai.accarouter.site/v1/chat/completions.
30-second smoke test
curl https://ai.accarouter.site/v1/chat/completions \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"model":"nama-model-publik","messages":[{"role":"user","content":"ping"}]}'
InfoThe base URL for OpenAI SDKs is https://ai.accarouter.site/v1. Do not append /chat/completions to the SDK base URL.

Quickstart

ACCA Router is an AI Router & Marketplace gateway with a single OpenAI-compatible endpoint for many models. You get centralized token quota, per-key rate limits, and model access control.

  1. Get an API key from the dashboard (My Key menu) or the Telegram bot.
  2. Set the base URL to https://ai.accarouter.site/v1.
  3. Use a model name from GET /v1/models.
  4. Send a request to POST https://ai.accarouter.site/v1/chat/completions.
30-second smoke test
curl https://ai.accarouter.site/v1/chat/completions \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"model":"nama-model-publik","messages":[{"role":"user","content":"ping"}]}'
InfoThe base URL for OpenAI SDKs is https://ai.accarouter.site/v1. Do not append /chat/completions to the SDK base URL.

Authentication

All /v1/* endpoints require an Authorization header in Bearer format. Keys look like acca-... and are secret: store them in environment variables, never in client code.

Header
Authorization: Bearer acca-xxxxxxxxxxxxxxxx
Content-Type: application/json
  • Keys cannot be viewed again after creation; only the hash and last4 are stored.
  • Keys can carry an expiry, IP allow-list, and a restricted model list.
  • Keys with the viewer role may only call GET endpoints.
  • A leaked key means someone else spends your quota. Rotate via the dashboard if it leaks.
Check key & quota
curl https://ai.accarouter.site/v1/account \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx"
/v1/account response (abridged)
{
  "object": "acca.account",
  "key_prefix": "YOUR_KEY_PREFIX",
  "name": "key-produksi",
  "status": "active",
  "quota": {
    "total_token_quota": 1000000,
    "tokens_used": 123456,
    "tokens_remaining": 876544
  },
  "per_request_limits": {
    "by_model": {
      "acca-chat-large": {"max_prompt_tokens": 32000, "max_completion_tokens": 4096}
    }
  },
  "rate_limits": {
    "max_concurrent": 5,
    "rpm_limit": 60,
    "effective_rpm_limit": 60
  },
  "models": ["acca-chat-large", "acca-embed"],
  "expires_at": "2026-12-31 23:59:59"
}

Base URL & Endpoints

MethodPathDescription
POST/v1/chat/completionsChat (OpenAI-compatible), mendukung streaming / supports streaming
POST/v1/completionsLegacy text completion
POST/v1/responsesResponses API
POST/v1/embeddingsEmbedding vektor / Vector embeddings
GET/v1/modelsDaftar model yang diizinkan untuk key / Models allowed for the key
GET/v1/models/{id}Detail satu model beserta batasnya / One model with its limits
GET/v1/accountKuota, batas, dan daftar model key / Key quota, limits, model list
GET/v1/usageRingkasan pemakaian (group_by=day|model) / Usage summary
GET/healthzHealth gateway (tanpa auth / no auth)

All paths are relative to the gateway base URL: https://ai.accarouter.site/v1. /v1/models on the gateway origin lists the models owned by your key; the https://ai.accarouter.site origin also serves the public dashboard.

List models
curl https://ai.accarouter.site/v1/models \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx"
/v1/models response (abridged)
{
  "object": "list",
  "data": [
    {
      "id": "acca-chat-large",
      "object": "model",
      "owned_by": "acca",
      "acca": {
        "input_weight": 1.0,
        "output_weight": 3.0,
        "max_input_tokens": 32000,
        "max_output_tokens": 4096,
        "supports_streaming": true
      }
    }
  ]
}

Chat Completions

The main endpoint. The body follows the OpenAI Chat Completions spec; extra OpenAI properties are safely ignored.

ParameterTypeRequiredDescription
modelstringwajib / requiredNama publik model (lihat GET /v1/models). / Public model name (see GET /v1/models).
messagesarraywajib / required[{role, content}], role: system/user/assistant.
streamboolopsional / optionaltrue untuk SSE. Dibungkus data: per chunk. / true for SSE. Wrapped in data: per chunk.
stream_optionsobjectopsional / optional{"include_usage": true} untuk chunk usage final. / for the final usage chunk.
temperaturenumberopsional / optional0-2, default 1.
top_pnumberopsional / optionalNucleus sampling.
max_tokensintopsional / optionalDipotong otomatis ke batas model/key. / Auto-clamped to the model/key limit.
stopstring | arrayopsional / optionalUrutan berhenti. / Stop sequences.
presence_penaltynumberopsional / optional-2-2.
frequency_penaltynumberopsional / optional-2-2.
userstringopsional / optionalID pengguna akhir untuk pelacakan. / End-user ID for tracking.
Non-stream request
curl https://ai.accarouter.site/v1/chat/completions \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nama-model-publik",
    "messages": [
      {"role": "system", "content": "Anda asisten yang ringkas."},
      {"role": "user", "content": "Jelaskan HTTP/3 dalam 2 kalimat."}
    ],
    "temperature": 0.7,
    "max_tokens": 512,
    "stream": false
  }'
200 response
{
  "id": "chatcmpl-acca-1f2e3d4c5b6a",
  "object": "chat.completion",
  "created": 1735689600,
  "model": "nama-model-publik",
  "choices": [
    {
      "index": 0,
      "message": {"role": "assistant", "content": "HTTP/3 memakai QUIC di atas UDP..."},
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 118,
    "total_tokens": 160
  }
}
InfoThe model field in the response always carries your public model name, never the upstream name.

Useful response headers:

  • X-Acca-Remaining-Tokens — remaining token quota after this request.
  • X-Acca-Token-Source — upstream when the provider reports usage, estimated when counted locally.
  • X-Acca-Request-Id — correlation ID when reporting bugs.

Streaming (SSE)

Set stream: true to receive Server-Sent Events. Each line is prefixed with data: , terminated by data: [DONE]. Clients must handle chunks split across buffer boundaries.

Stream request
curl -N https://ai.accarouter.site/v1/chat/completions \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nama-model-publik",
    "messages": [{"role": "user", "content": "Hitung 1 sampai 5"}],
    "stream": true,
    "stream_options": {"include_usage": true}
  }'
SSE flow
data: {"id":"chatcmpl-acca-1f2e","object":"chat.completion.chunk","model":"nama-model-publik","choices":[{"index":0,"delta":{"role":"assistant","content":""}}]}

data: {"id":"chatcmpl-acca-1f2e","object":"chat.completion.chunk","model":"nama-model-publik","choices":[{"index":0,"delta":{"content":"1"}}]}

data: {"id":"chatcmpl-acca-1f2e","object":"chat.completion.chunk","model":"nama-model-publik","choices":[{"index":0,"delta":{"content":", 2, 3..."}}]}

data: {"id":"chatcmpl-acca-1f2e","object":"chat.completion.chunk","model":"nama-model-publik","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":{"prompt_tokens":18,"completion_tokens":9,"total_tokens":27}}

data: [DONE]
  • : queued comment lines may appear while a request waits for an upstream slot. Ignore lines that do not start with data:.
  • The final chunk with usage only appears when stream_options.include_usage is set.
  • If the upstream fails before the first byte, the stream opens with a data: {"error":{...}} frame.
Stream with the Python SDK
from openai import OpenAI

client = OpenAI(base_url="https://ai.accarouter.site/v1", api_key="acca-xxxxxxxxxxxxxxxx")
stream = client.chat.completions.create(
    model="nama-model-publik",
    messages=[{"role": "user", "content": "Hitung 1 sampai 5"}],
    stream=True,
)
for chunk in stream:
    piece = chunk.choices[0].delta.content if chunk.choices else None
    if piece:
        print(piece, end="", flush=True)

SDK Examples

Because the API is OpenAI-compatible, just point baseURL/base_url at https://ai.accarouter.site/v1 and use your ACCA API key.

Python (openai)
from openai import OpenAI

client = OpenAI(
    base_url="https://ai.accarouter.site/v1",
    api_key="acca-xxxxxxxxxxxxxxxx",
)

resp = client.chat.completions.create(
    model="nama-model-publik",
    messages=[
        {"role": "system", "content": "Anda asisten yang ringkas."},
        {"role": "user", "content": "Jelaskan HTTP/3 dalam 2 kalimat."},
    ],
    temperature=0.7,
    max_tokens=512,
)
print(resp.choices[0].message.content)
print(resp.usage)   # prompt_tokens, completion_tokens, total_tokens
Node.js (openai)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://ai.accarouter.site/v1",
  apiKey: "acca-xxxxxxxxxxxxxxxx",
});

const resp = await client.chat.completions.create({
  model: "nama-model-publik",
  messages: [{ role: "user", content: "Jelaskan HTTP/3 dalam 2 kalimat." }],
});
console.log(resp.choices[0].message.content);
cURL
curl https://ai.accarouter.site/v1/chat/completions \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nama-model-publik",
    "messages": [
      {"role": "system", "content": "Anda asisten yang ringkas."},
      {"role": "user", "content": "Jelaskan HTTP/3 dalam 2 kalimat."}
    ],
    "temperature": 0.7,
    "max_tokens": 512,
    "stream": false
  }'
PHP
<?php
$ch = curl_init("https://ai.accarouter.site/v1/chat/completions");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer acca-xxxxxxxxxxxxxxxx",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "model" => "nama-model-publik",
        "messages" => [["role" => "user", "content" => "Halo!"]],
    ]),
]);
$body = curl_exec($ch);
$json = json_decode($body, true);
echo $json["choices"][0]["message"]["content"];
Go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	body, _ := json.Marshal(map[string]any{
		"model": "nama-model-publik",
		"messages": []map[string]string{
			{"role": "user", "content": "Halo!"},
		},
	})
	req, _ := http.NewRequest("POST", "https://ai.accarouter.site/v1/chat/completions", bytes.NewReader(body))
	req.Header.Set("Authorization", "Bearer acca-xxxxxxxxxxxxxxxx")
	req.Header.Set("Content-Type", "application/json")
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	var out struct {
		Choices []struct {
			Message struct{ Content string }
		}
	}
	json.NewDecoder(res.Body).Decode(&out)
	fmt.Println(out.Choices[0].Message.Content)
}
Java
import java.net.URI;
import java.net.http.*;

var client = HttpClient.newHttpClient();
var req = HttpRequest.newBuilder()
    .uri(URI.create("https://ai.accarouter.site/v1/chat/completions"))
    .header("Authorization", "Bearer acca-xxxxxxxxxxxxxxxx")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString("""
        {"model":"nama-model-publik","messages":[{"role":"user","content":"Halo!"}]}
        """))
    .build();
var res = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());

Completions & Responses

The legacy /v1/completions endpoint accepts a prompt string or array. /v1/responses accepts input (a string or message list) and returns a response object.

/v1/completions
curl https://ai.accarouter.site/v1/completions \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nama-model-publik",
    "prompt": "Sebutkan tiga warna primer:",
    "max_tokens": 64
  }'
/v1/responses
curl https://ai.accarouter.site/v1/responses \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nama-model-publik",
    "input": [
      {"role": "user", "content": "Ringkas berita teknologi hari ini."}
    ],
    "max_output_tokens": 256
  }'

Embeddings

The /v1/embeddings endpoint returns vectors for a string or string-array input. Embedding models do not support streaming.

Request
curl https://ai.accarouter.site/v1/embeddings \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "acca-embed",
    "input": ["teks pertama", "teks kedua"]
  }'
Response
{
  "object": "list",
  "model": "acca-embed",
  "data": [
    {"object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, ...]},
    {"object": "embedding", "index": 1, "embedding": [0.0789, 0.0011, ...]}
  ],
  "usage": {"prompt_tokens": 8, "total_tokens": 8}
}

Models & Naming

The model name used in requests is the public (white-label) name. The upstream name never leaks to clients; the model field in responses is rewritten to the public name.

Example public nameTypeStreamingDescription
acca-chat-largechatya / yesChat umum, konteks panjang / General chat, long context
acca-chat-fastchatya / yesLatensi rendah untuk chat pendek / Low latency for short chats
acca-reasonchatya / yesPenalaran bertahap (lebih mahal) / Step-by-step reasoning (pricier)
acca-embedembeddingstidak / noEmbedding teks untuk RAG / Text embeddings for RAG
CautionThe table above is illustrative only. The models you can actually call are whatever GET /v1/models returns (shaped by per-key allow-lists and model status).
  • Every model carries its own input/output weights: cost = prompt_tokens × input_weight + completion_tokens × output_weight.
  • Some keys are restricted to a model list; otherwise the request is rejected with ACCA_MODEL_NOT_ALLOWED.

Quota & Rate Limits

Limits are enforced per ACCA API key (not per user).

InfoInput/output token limits are not set per key. Every request always follows the limits of the called model; keys only cap quota, RPM, and concurrency.
LimitDescription
Kuota token / Token quotaKuota terpakai dengan bobot per model. Habis → 429 ACCA_TOKEN_LIMIT. / Weighted per-model usage. Exhausted → 429 ACCA_TOKEN_LIMIT.
RPMFixed window per menit, dikonfigurasi admin. Terlampaui → 429 ACCA_RPM_LIMIT + Retry-After. / Fixed per-minute window, admin-configured. Exceeded → 429 ACCA_RPM_LIMIT + Retry-After.
ConcurrencyJumlah request paralel per key. Penuh → 429 ACCA_RATE_LIMIT. / Parallel requests per key. Full → 429 ACCA_RATE_LIMIT.
Max input tokensDitentukan model itu sendiri (max_input_tokens). Prompt lebih besar → 400 ACCA_PROMPT_TOO_LARGE. / Set by the model itself (max_input_tokens). Larger prompts → 400 ACCA_PROMPT_TOO_LARGE.
Max output tokensDitentukan model itu sendiri (max_output_tokens); max_tokens/max_output_tokens dipotong otomatis ke nilai itu. / Set by the model itself (max_output_tokens); max_tokens/max_output_tokens are auto-clamped to it.
Batas body / Body limitBody request maksimum 2 MB → 413 ACCA_BODY_TOO_LARGE. / Request body max 2 MB → 413 ACCA_BODY_TOO_LARGE.
429 example
HTTP/1.1 429 Too Many Requests
Retry-After: 12
Content-Type: application/json

{
  "error": {
    "message": "Requests-per-minute limit reached for this key.",
    "type": "rate_limit_error",
    "param": null,
    "code": "ACCA_RPM_LIMIT"
  }
}
Retry with backoff (Python SDK)
import time
import openai
from openai import OpenAI

client = OpenAI(base_url="https://ai.accarouter.site/v1", api_key="acca-xxxxxxxxxxxxxxxx")

def ask(messages, attempts=5):
    for i in range(attempts):
        try:
            return client.chat.completions.create(
                model="nama-model-publik", messages=messages)
        except openai.RateLimitError as exc:
            wait = float(exc.response.headers.get("Retry-After", 2 ** i))
            print(f"rate limited, tunggu {wait}s")
            time.sleep(wait)
    raise RuntimeError("masih rate limited setelah retry")

Check historical usage through the gateway:

GET /v1/usage
curl "https://ai.accarouter.site/v1/usage?group_by=day&from=2026-10-01&to=2026-10-31" \
  -H "Authorization: Bearer acca-xxxxxxxxxxxxxxxx"
/v1/usage response
{
  "object": "list",
  "group_by": "day",
  "data": [
    {"bucket": "2026-10-30", "requests": 128, "prompt_tokens": 51234,
     "completion_tokens": 20112, "weighted_cost": 111570}
  ]
}

Error Handling

Every error uses the same envelope, compatible with OpenAI SDKs:

Error envelope
{
  "error": {
    "message": "Model 'foo' not found for this key.",
    "type": "invalid_request_error",
    "param": "model",
    "code": "ACCA_MODEL_NOT_FOUND",
    "upstream_status": 404
  }
}
  • type follows OpenAI (authentication_error, permission_error, invalid_request_error, rate_limit_error, insufficient_quota, api_error).
  • upstream_status only appears when the error originates from the upstream provider.
  • 499 ACCA_CLIENT_DISCONNECTED means the client closed the connection early; no automatic retry needed.
HTTPCodeMeaning
400ACCA_INVALID_JSONBody bukan JSON valid. / Body is not valid JSON.
400ACCA_MISSING_PARAMParameter wajib tidak ada (mis. model). / Required parameter missing (e.g. model).
400ACCA_INVALID_PARAMNilai parameter tidak valid. / Invalid parameter value.
400ACCA_PROMPT_TOO_LARGEPrompt melebihi batas input model/key. / Prompt exceeds the model/key input limit.
401ACCA_NO_AUTHHeader Authorization tidak ada. / Authorization header missing.
401ACCA_INVALID_KEY_FORMATFormat bukan Bearer acca-.... / Format is not Bearer acca-....
401ACCA_INVALID_KEYKey tidak dikenali. / Unknown key.
401ACCA_KEY_EXPIREDKey sudah kedaluwarsa. / Key has expired.
403ACCA_KEY_INACTIVEKey tidak aktif. / Key is inactive.
403ACCA_MODEL_NOT_ALLOWEDModel tidak diizinkan untuk key ini. / Model not allowed for this key.
403ACCA_MODEL_DISABLEDModel sedang dinonaktifkan. / Model is currently disabled.
403ACCA_IP_NOT_ALLOWEDIP klien tidak ada di allow-list. / Client IP is not on the allow-list.
403ACCA_VIEWER_READONLYKey viewer hanya boleh endpoint baca. / Viewer keys may only call read endpoints.
404ACCA_MODEL_NOT_FOUNDModel tidak ada untuk key ini. / No such model for this key.
404ACCA_ENDPOINT_NOT_SUPPORTEDPath tidak didukung. / Unsupported path.
405ACCA_METHOD_NOT_ALLOWEDMetode HTTP salah untuk path tersebut. / Wrong HTTP method for this path.
413ACCA_BODY_TOO_LARGEBody melebihi batas ukuran. / Body exceeds the size limit.
422ACCA_SCHEMA_INVALIDStruktur body tidak sesuai skema. / Body does not match the schema.
429ACCA_RATE_LIMITConcurrency key penuh. Coba lagi setelah Retry-After. / Key concurrency full. Retry after Retry-After.
429ACCA_RPM_LIMITRPM key terlampaui. Coba lagi setelah Retry-After. / Key RPM exceeded. Retry after Retry-After.
429ACCA_TOKEN_LIMITKuota token habis. Lakukan top-up. / Token quota exhausted. Top up required.
499ACCA_CLIENT_DISCONNECTEDKlien menutup koneksi sebelum selesai. / Client closed the connection early.
500ACCA_INTERNALKesalahan internal. / Internal error.
502ACCA_UPSTREAM_UNREACHABLEProvider upstream tidak bisa dihubungi. / Upstream provider unreachable.
502ACCA_UPSTREAM_BAD_RESPONSERespons upstream tidak valid. / Invalid upstream response.
502ACCA_UPSTREAM_ERRORUpstream membalas error 5xx. / Upstream answered with a 5xx error.
503ACCA_UPSTREAM_NOT_FOUNDProvider untuk model ini hilang/nonaktif. / The provider for this model is missing/inactive.
503ACCA_UPSTREAM_CIRCUIT_OPENCircuit breaker provider sedang terbuka. / Provider circuit breaker is open.
503ACCA_UPSTREAM_CAPACITYSemua key upstream sedang cooldown. / All upstream keys are cooling down.
503ACCA_QUEUE_TIMEOUTTidak ada slot key upstream dalam batas waktu antrian. / No upstream key slot within the queue deadline.
504ACCA_UPSTREAM_TIMEOUTUpstream melewati batas waktu. / Upstream timed out.

Full JSON Examples

Ready-to-use payloads. Replace nama-model-publik with a name from GET /v1/models.

1. Multi-turn chat + system prompt
{
  "model": "nama-model-publik",
  "messages": [
    {"role": "system", "content": "Anda asisten teknis. Jawab singkat dan akurat."},
    {"role": "user", "content": "Apa perbedaan TCP dan UDP?"},
    {"role": "assistant", "content": "TCP andal dan berurutan, UDP cepat tanpa jaminan."},
    {"role": "user", "content": "Kapan pilih UDP?"}
  ],
  "temperature": 0.3,
  "max_tokens": 400,
  "stream": false
}
2. Chat + stop sequences + penalties
{
  "model": "nama-model-publik",
  "messages": [{"role": "user", "content": "Tulis slogan kopi."}],
  "temperature": 0.8,
  "top_p": 0.95,
  "max_tokens": 120,
  "stop": ["\n\n", "===="],
  "presence_penalty": 0.4,
  "frequency_penalty": 0.2,
  "user": "user-1234"
}
3. Streaming + usage chunk
{
  "model": "nama-model-publik",
  "messages": [{"role": "user", "content": "Hitung 1 sampai 5"}],
  "stream": true,
  "stream_options": {"include_usage": true}
}
4. Legacy completions
{
  "model": "nama-model-publik",
  "prompt": ["Sebutkan tiga warna primer:", "Ibukota Indonesia adalah"],
  "max_tokens": 40,
  "temperature": 0
}
5. Responses API
{
  "model": "nama-model-publik",
  "input": [
    {"role": "user", "content": "Buat 3 poin singkat tentang REST."}
  ],
  "max_output_tokens": 200
}
6. Embeddings batch
{
  "model": "acca-embed",
  "input": [
    "ACCA Router menyatukan banyak model.",
    "Embedding dipakai untuk pencarian semantik."
  ]
}

Upstream & Queue Behaviour

The gateway runs a pool of upstream API keys per provider. What you should know as a client:

  • When an upstream key is at its RPM cap, the request is queued until a slot opens (it does not fail immediately). The default queue ceiling is 10 minutes.
  • When the queue exceeds the ceiling, you receive 503 ACCA_QUEUE_TIMEOUT.
  • For streaming requests, while queued the gateway emits periodic : queued SSE comments so proxies do not cut the idle connection.
  • 5xx/provider errors are retried internally with a short backoff; upstream 4xx responses are forwarded as ACCA_UPSTREAM_ERROR with their original status.
InfoTreat 5xx ACCA_* errors as transient: retry with exponential backoff, except ACCA_QUEUE_TIMEOUT, where you should lower the request rate.

FAQ

**Model not found (ACCA_MODEL_NOT_ALLOWED / ACCA_MODEL_NOT_FOUND)?** Make sure the model name comes from GET /v1/models using the same key. Keys can be restricted to a specific model list.

**Empty responses[0] or truncated content?** Check finish_reason. length means the max_tokens cap was reached; raise it if the model/key limit still allows.

How do I add quota? Buy a package via the Telegram bot @acca_aibot; the quota is credited to your key and takes effect immediately, no restart.

**Why is there X-Acca-Token-Source: estimated?** The provider did not report usage, so the gateway counts tokens itself with a local tokenizer.

Can I use the official OpenAI SDKs? Yes, just swap the base URL and API key; every example on this page uses the official SDKs.

Leaked key, what now? Create a new key from the dashboard, then revoke the old one; remaining quota stays on the old key unless an admin moves it.