Connect in two minutes.
Unhinged speaks the OpenAI and Anthropic API formats. If your app lets you set a base URL and a key, it works.
Quickstart
- Get a key. Sign up, then copy it from Keys in your dashboard. It starts with
sk-rp-. - Set the base URL to
- Pick a model ID from the model list and put it in the
modelfield.
curl {{BASE}}/v1/chat/completions \ -H "Authorization: Bearer $UNHINGED_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "deepseek-v4.1-flash", "messages": [{"role": "user", "content": "hi"}]}'
from openai import OpenAI client = OpenAI(base_url="{{BASE}}/v1", api_key="sk-rp-...") r = client.chat.completions.create( model="deepseek-v4.1-flash", messages=[{"role": "user", "content": "hi"}], ) print(r.choices[0].message.content)
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "{{BASE}}/v1", apiKey: "sk-rp-..." }); const r = await client.chat.completions.create({ model: "deepseek-v4.1-flash", messages: [{ role: "user", content: "hi" }], }); console.log(r.choices[0].message.content);
SillyTavern
Works with any recent SillyTavern. Takes about a minute.
- Open the API Connections panel (the plug icon at the top).
- Set API to Chat Completion.
- Set Chat Completion Source to Custom (OpenAI-compatible).
- Paste
into Custom Endpoint (Base URL). - Paste your key into Custom API Key, then hit Connect.
- Pick a model from the dropdown. For roleplay start with
glm-5.3-uncensored.
Recommended settings
| Setting | Value | Why |
|---|---|---|
| Context size | Your plan's max (16k to 256k) | Anything above it is trimmed by us anyway. |
| Max response | 600 to 1200 | Long enough for a full reply, short enough to stay snappy. |
| Streaming | On | Words appear as they're written. |
| Temperature | 0.8 to 1.0 | A good start for creative writing. |
Claude Code
Claude Code uses the Anthropic format. Point it at Unhinged with two environment variables. Claude models need the Smart tier (Pro and up), Opus and Fable need Ultra. Any other model works too, for example deepseek-v4.1-flash on any plan. Claude Code sends a lot of context, so Pro or Ultra fits it best.
export ANTHROPIC_BASE_URL="{{BASE}}" export ANTHROPIC_API_KEY="sk-rp-..." export ANTHROPIC_MODEL="claude-sonnet-5-5"
Open a new terminal and run claude. Coding agents send a lot of context, so give them their own key with a limit share so they can't use up your whole plan.
Cline and OpenCode
Cline, Roo Code and Continue
- API Provider: OpenAI Compatible for GPT, GLM, DeepSeek and Gemini, or Anthropic for Claude models.
- Base URL:
(OpenAI Compatible) or(Anthropic). - API key: your
sk-rp-key. Model ID: any ID from the model list.
OpenCode
Add a provider with "npm": "@ai-sdk/openai-compatible", set baseURL to and use your key. Every model in the list works.
Streaming
Add "stream": true and you get server-sent events. Each chunk is a line starting with data:. The last data chunk includes usage, then data: [DONE].
data: {"choices":[{"delta":{"content":"The"}}]} data: {"choices":[{"delta":{"content":" rain"}}]} data: {"choices":[],"usage":{"prompt_tokens":812,"completion_tokens":96, "prompt_tokens_details":{"cached_tokens":640}}} data: [DONE]
Lines starting with : are keep-alive comments. Every SSE client ignores them, and you should too.
Caching
When the start of your request matches a recent request, that part is read from cache. Cached tokens count for a small fraction of fresh ones against your limit. In a long chat, most of every request is history, so caching decides how far your plan goes.
How to get more cache hits
- Put things that never change first: system prompt, character card, tool definitions.
- Put things that change last: the newest messages.
- Don't add timestamps or random IDs near the top of the prompt.
- Use the same key for one conversation. The cache stays warm for a few minutes between requests.
Limits
Each plan has a monthly usage limit plus speed limits on your key. Your dashboard shows the monthly limit as a percentage, so you always know where you stand.
Bigger models and longer contexts use more of your limit per request. Cached context uses much less. At 80% we email you, at 100% requests pause until the reset. Nothing is charged extra, ever.
Errors
Errors come back as JSON with a plain-English message.
| Code | Meaning | What to do |
|---|---|---|
| 400 | The request body is malformed. | Check the JSON and the messages format. |
| 401 | Missing or wrong key. | Send Authorization: Bearer sk-rp-.... Revoked keys return 401. |
| 402 | You've used 100% of this cycle's limit. | Wait for the reset or upgrade. The message says when it resets. |
| 403 | That model isn't on your plan or key. | Pick another model or upgrade. Check the key's model access. |
| 404 | Unknown model ID, or the model is temporarily down. | Copy the exact ID from the model list. |
| 413 | Context is bigger than your plan allows. | Lower the context size in your client. |
| 429 | Too many requests per minute, or too many at once. | Wait a few seconds and retry. Most clients do this for you. |
| 503 | The model is down right now. | Check status. We never swap in a different model. |
Models
Tap an ID to copy it.
Endpoints
All under . claude-sonnet-5-5 works on /v1/messages only; every other model works on all three formats. Send your key as a Bearer token (OpenAI format) or x-api-key (Anthropic format).
| POST/v1/chat/completions | OpenAI chat format. Most apps use this. |
| POST/v1/responses | OpenAI Responses format, for Codex and agents. |
| POST/v1/messages | Anthropic Messages format, for Claude Code. |
| POST/v1/messages/count_tokens | Count tokens without running the model. |
| GET/v1/models | The models your key can use. |
| GET/v1/account | Your plan, limits and limit used, as a percentage. |