Documentation

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

  1. Get a key. Sign up, then copy it from Keys in your dashboard. It starts with sk-rp-.
  2. Set the base URL to
  3. Pick a model ID from the model list and put it in the model field.
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"}]}'

SillyTavern

Works with any recent SillyTavern. Takes about a minute.

  1. Open the API Connections panel (the plug icon at the top).
  2. Set API to Chat Completion.
  3. Set Chat Completion Source to Custom (OpenAI-compatible).
  4. Paste into Custom Endpoint (Base URL).
  5. Paste your key into Custom API Key, then hit Connect.
  6. Pick a model from the dropdown. For roleplay start with glm-5.3-uncensored.
Keep your character card and system prompt the same between messages. The unchanged part of the context gets cached and counts far less against your limit, so long chats go much further.

Recommended settings

SettingValueWhy
Context sizeYour plan's max (16k to 256k)Anything above it is trimmed by us anyway.
Max response600 to 1200Long enough for a full reply, short enough to stay snappy.
StreamingOnWords appear as they're written.
Temperature0.8 to 1.0A 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.

~/.zshrc or ~/.bashrc
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

  1. API Provider: OpenAI Compatible for GPT, GLM, DeepSeek and Gemini, or Anthropic for Claude models.
  2. Base URL: (OpenAI Compatible) or (Anthropic).
  3. 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.

Cursor no longer allows custom keys for its agent, so we don't recommend it. Use one of the tools above instead.

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

response
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.
Your cache hit rate is on the dashboard overview. Above 60% is good for roleplay. Above 80% is great.

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.

CodeMeaningWhat to do
400The request body is malformed.Check the JSON and the messages format.
401Missing or wrong key.Send Authorization: Bearer sk-rp-.... Revoked keys return 401.
402You've used 100% of this cycle's limit.Wait for the reset or upgrade. The message says when it resets.
403That model isn't on your plan or key.Pick another model or upgrade. Check the key's model access.
404Unknown model ID, or the model is temporarily down.Copy the exact ID from the model list.
413Context is bigger than your plan allows.Lower the context size in your client.
429Too many requests per minute, or too many at once.Wait a few seconds and retry. Most clients do this for you.
503The 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/completionsOpenAI chat format. Most apps use this.
POST/v1/responsesOpenAI Responses format, for Codex and agents.
POST/v1/messagesAnthropic Messages format, for Claude Code.
POST/v1/messages/count_tokensCount tokens without running the model.
GET/v1/modelsThe models your key can use.
GET/v1/accountYour plan, limits and limit used, as a percentage.