API reference
The API follows the OpenAI chat completions format. If your code or tool already talks to an OpenAI-compatible endpoint, change the base URL to https://ablitllm.com/v1, use a AblitLLM key and pick a model id.
Quickstart
Create an account, create a key under API keys, and send a request.
curl https://ablitllm.com/v1/chat/completions \
-H "Authorization: Bearer ab_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-27b-abliterated",
"stream": true,
"messages": [{"role": "user", "content": "Write a port scanner in Go."}]
}'Authentication
Send your key in the Authorization header as a bearer token. Keys start with ab_live_. Keep them on a server: a key in browser code can be read and spent by anyone who opens the page.
Authorization: Bearer ab_live_...
Chat completions
POST https://ablitllm.com/v1/chat/completions
Fields not listed here are ignored.
| Field | Type | Meaning |
|---|---|---|
| model | string, required | A model id from the models table. |
| messages | array, required | The conversation: objects with role (system, user, assistant, tool) and content. |
| stream | boolean | Send the answer as server-sent events while it is generated. Default false. |
| stream_options | object | Set include_usage to true to receive a final chunk with token counts. |
| max_tokens | integer | Upper bound on generated tokens. Capped at the model's maximum and at what your balance can pay for. |
| temperature, top_p, top_k, min_p | number | Sampling controls, passed to the model unchanged. |
| stop | string or array | Sequences that end the answer. |
| seed | integer | Makes sampling repeatable where the model supports it. |
| tools, tool_choice | array, string or object | Function definitions the model may call. |
| response_format | object | Ask for JSON output, optionally with a schema. |
| presence_penalty, frequency_penalty, repetition_penalty | number | Repetition controls. |
The response is a standard chat completion object, with token counts in usage.
Streaming
With stream: true the answer arrives as server-sent events, one chat.completion.chunk per event, ending with data: [DONE]. Closing the connection stops generation, and you are billed for what was produced up to that point.
Tool calls
Pass function definitions in tools. When the model decides to call one, the answer carries tool_calls instead of text. Run the function, append a message with role tool and the result, and call the API again. This is what coding agents do on every step.
Models
GET https://ablitllm.com/v1/models
| Id | Context | Max output | Input / 1M | Output / 1M |
|---|---|---|---|---|
| qwen3.8-27b-abliterated | 196,000 | 16,384 | $0.30 | $1.20 |
| coder-abliterated (planned) | 128,000 | 16,384 | n/a | n/a |
Errors
Errors use the OpenAI shape, so existing clients surface them correctly.
{
"error": {
"message": "Your credit balance is empty. Add credits to continue.",
"type": "insufficient_credits",
"code": "insufficient_credits"
}
}| Status | Type | Meaning |
|---|---|---|
| 401 | invalid_api_key | The key is missing, wrong or revoked. |
| 402 | insufficient_credits | The balance is empty. Add credits to continue. |
| 400 | invalid_request_error | The body is not valid, or the model rejected it (for example, the prompt exceeds the context). |
| 400 | content_policy_violation | The request asks for sexual content involving minors, the one blocked category. |
| 404 | model_not_found | No model with that id. |
| 404 | model_not_available | The model is listed as planned and cannot be called yet. |
| 429 | rate_limit_exceeded | Too many requests per minute. The Retry-After header says how long to wait. |
| 429 | too_many_concurrent_requests | Too many requests in progress for this account, or the balance is already committed to them. |
| 429 | daily_limit_reached | The fair-use limit of included chat was reached (chat only). |
| 502 | upstream_error | The inference server failed. Failed requests are not billed. |
Limits and billing
- 60 requests per minute per key.
- 4 requests in progress at the same time per account.
- Request bodies up to 2 MB.
- Each request costs prompt tokens times the input price plus generated tokens times the output price, taken from your prepaid balance when the request ends.
- If the inference server does not report token counts, they are estimated from the text length and the request is marked as estimated in your usage table.
What is stored
For each request: the account, the key, the model, token counts, cost, status, duration and time. The text of prompts and answers is not written to disk or to logs by the gateway. A blocked request leaves the rule that blocked it and the time, not its text. Details in the privacy policy.