Skip to content
abliteratedllmPublic

About

Minimal examples for the AbliteratedLLM API: curl, Python, TypeScript, and agent setups (Claude Code, Codex, OpenCode, Pi, Cline, Open WebUI, SillyTavern).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AbliteratedLLM examples

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.

Base URLs

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.

Authentication

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.

Models

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/models

The 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.

Examples

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

Good to know

  • Every model reasons before it answers. On chat completions, reasoning_effort takes "low", "medium" or "high", and the reasoning arrives in reasoning_content. Reasoning tokens are output tokens: they count toward max_tokens and are billed at the output price.
  • Streams always end with a usage chunk whose choices array is empty, so check choices before reading choices[0].
  • Tools: only type: "function" tools are accepted on chat completions.
  • POST /v1/responses is stateless: store is always false and previous_response_id is 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 larger max_tokens is lowered to 4096, not rejected.
  • Errors use the OpenAI shape ({"error": {"type", "code", "message"}}) on /v1/chat/completions, /v1/responses, /v1/models and /v1/balance, and the Anthropic shape on /v1/messages, so each SDK raises its usual exceptions.

Links

The service is for adults (18+) only.

License

MIT

About

Minimal examples for the AbliteratedLLM API: curl, Python, TypeScript, and agent setups (Claude Code, Codex, OpenCode, Pi, Cline, Open WebUI, SillyTavern).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages