Minimal, self-contained examples for the AbliteratedLLM API.
AbliteratedLLM is a pay-per-token API for abliterated (refusal-removed) and stock open-weight models. It serves the OpenAI Chat Completions, Responses and Completions APIs and the Anthropic Messages API, so existing SDKs and tools work once you change the base URL and the API key. Credit is prepaid by card or crypto.
| API | Base URL | Endpoints |
|---|---|---|
| OpenAI-compatible | https://api.abliteratedllm.dev/v1 |
POST /chat/completions, POST /responses (stateless), POST /completions, GET /models, GET /balance |
| Anthropic-compatible | https://api.abliteratedllm.dev |
POST /v1/messages |
Anthropic SDKs and Claude Code append /v1/messages themselves, so their base URL has no /v1.
Create a key on the API keys page. A key is sk- followed by 48 letters and digits, and it is shown once. Send it in either header; both work on every endpoint:
Authorization: Bearer <key>(OpenAI SDKs and most tools)x-api-key: <key>(Anthropic SDKs)
Every example here reads the key from the ABLITERATEDLLM_API_KEY environment variable:
export ABLITERATEDLLM_API_KEY="sk-..."$env:ABLITERATEDLLM_API_KEY = "sk-..."To check a key without running a model, call GET /v1/balance (curl/balance.sh). A missing or invalid key gets HTTP 401 with error code invalid_api_key.
GET https://api.abliteratedllm.dev/v1/models is public (no key needed) and returns the live catalog in the OpenAI list format, with extra fields per model: context_length, max_output_tokens, pricing (USD per 1M tokens, as decimal strings), variant ("abliterated" or "stock"), input_modalities and capabilities.
curl -s https://api.abliteratedllm.dev/v1/modelsThe examples use glm-5.3-flash-abliterated. Models with "variant": "stock" run the vendor's original weights and are not abliterated. To use another model, change the MODEL constant (or the "model" field) in an example to an id from the list.
| Directory | Contents |
|---|---|
| curl/ | Chat completion, streaming, model list, balance |
| python/ | OpenAI SDK: chat, streaming, tool calling. Anthropic SDK: /v1/messages |
| typescript/ | OpenAI SDK: chat, streaming, tool calling. Vercel AI SDK with @ai-sdk/openai-compatible |
| agents/ | Setup for Claude Code, Codex, OpenCode, Pi, Cline, Open WebUI and SillyTavern |
- Every model reasons before it answers. On chat completions,
reasoning_efforttakes"low","medium"or"high", and the reasoning arrives inreasoning_content. Reasoning tokens are output tokens: they count towardmax_tokensand are billed at the output price. - Streams always end with a usage chunk whose
choicesarray is empty, so checkchoicesbefore readingchoices[0]. - Tools: only
type: "function"tools are accepted on chat completions. POST /v1/responsesis stateless:storeis alwaysfalseandprevious_response_idis rejected, so send the whole conversation each time.- Trial accounts (before the first top-up) allow 1 concurrent request; a second one at the same time gets 429
rate_limit_exceeded. Their output budget is capped at 4096 tokens: a largermax_tokensis lowered to 4096, not rejected. - Errors use the OpenAI shape (
{"error": {"type", "code", "message"}}) on/v1/chat/completions,/v1/responses,/v1/modelsand/v1/balance, and the Anthropic shape on/v1/messages, so each SDK raises its usual exceptions.
- Documentation: https://abliteratedllm.dev/docs (plain-text index: https://abliteratedllm.dev/llms.txt)
- Pricing: https://abliteratedllm.dev/pricing
- Privacy: https://abliteratedllm.dev/privacy
- Support: support@abliteratedllm.dev
The service is for adults (18+) only.