API reference
Endpoints, auth, and errors.
Public base URL: https://serveras.click/v1. Inference uses API keys. Dashboard pages use a customer session instead.
Authentication
Authorization: Bearer asai_sk_...
Keys are shown once at creation and can be revealed later from the dashboard. Max 3 active keys per account; they share one credit balance.
Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
POST | /v1/chat/completions | API key | OpenAI Chat Completions. Streaming and non-streaming. |
POST | /v1/responses | API key | Responses compatibility for Codex CLI with asai/gpt-* models. See Codex setup. |
POST | /v1/messages | API key | Anthropic Messages compatibility for Claude Code. Streaming and non-streaming. |
GET | /v1/models | Public | List customer model aliases and rates. |
GET | /v1/balance | API key | Read available credits for the key's account. |
POST /v1/chat/completions
OpenAI-compatible. Send a messages array. max_tokens is capped per model (customer max output 16,384). stream defaults to false.
POST /v1/chat/completions
Content-Type: application/json
Authorization: Bearer asai_sk_...
{
"model": "asai/gpt-6-sol",
"messages": [
{"role": "system", "content": "You are helpful."},
{"role": "user", "content": "What is 2+2?"}
],
"max_tokens": 100,
"stream": false
}
{
"object": "chat.completion",
"model": "asai/gpt-6-sol",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "2 + 2 = 4."},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 23, "completion_tokens": 8, "total_tokens": 31}
}
POST /v1/responses
Codex CLI compatibility is available for asai/gpt-6-sol over HTTP SSE. Use the tested provider configuration and current support limits under Codex setup. This endpoint is not advertised as full OpenAI Responses API parity.
GET /v1/balance
For server-side use only. Never expose an API key in browser JavaScript or a URL. Multiple keys on the same account share one balance. Available credits can change with expiring lots and concurrent reservations. This reads the asAi customer wallet, not upstream provider credits.
curl -H 'Authorization: Bearer YOUR_ASAI_API_KEY' https://serveras.click/v1/balance
{"available_credits": 5000}
Balance reads are limited to 30 per key per minute; excessive reads return HTTP 429 with a Retry-After header.
GET /v1/models
No authentication required. Returns aliases only — never upstream provider names.
GET https://serveras.click/v1/models
{
"object": "list",
"data": [
{
"id": "asai/gpt-6-sol",
"object": "model",
"owned_by": "aSaI",
"context_length": 1050000,
"max_output": 16384,
"rates": {"input": "10", "output": "50", "cache": "2.5"}
}
]
}
Error codes
Inference errors use a structured error object. Failures before output delivery are not charged. Partial streamed output may settle.
| Status | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | Missing, malformed, or unknown API key. |
| 402 | insufficient_credits | Not enough available credits to reserve the request. |
| 403 | key_expired | This API key has expired. |
| 403 | account_disabled | The customer account is disabled. |
| 403 | email_not_verified | Verify your email before running inference. |
| 404 | model_not_found | Unknown model alias. |
| 429 | rate_limit_exceeded | Account hit 20 RPM. |
| 429 | concurrency_limit_exceeded | Account hit 7 concurrent requests. |
| 503 | model_disabled | That alias is temporarily disabled. |
| 503 | gateway_paused | Inference is paused by a safety control. |
| 503 | upstream_unavailable | The gateway cannot reach inference right now. |
| 503 | accounting_unavailable | Reservation/settlement is unavailable. |
{
"error": {
"code": "insufficient_credits",
"message": "Insufficient credits",
"type": "asai_error"
}
}