Skip to main content

SDKs

Point any OpenAI-compatible client at https://api.refuseless.com/v1.

Python

Node / TypeScript

Anthropic SDK

The same keys work with the Anthropic SDKs through POST /v1/messages. Set the base URL to the host without /v1, because the SDK adds /v1/messages itself.
On reasoning models the first content block is thinking, so read the last block (or filter for type: "text") to get the answer.

Agent harnesses

Anything that accepts a custom baseURL works unchanged — Codex, OpenClaw, and similar OpenAI-compatible harnesses. Set the base URL to https://api.refuseless.com/v1, set the model id from the lineup, stream as usual. Anthropic-native harnesses such as Claude Code use /v1/messages instead. See Claude Code.

OpenCode

OpenCode talks to any OpenAI-compatible API through a custom provider entry. You add Refuseless once, connect your key, then pick it like a built-in model. Base URL: https://api.refuseless.com/v1 Model: glm-5.3-abliterated (context 1,048,576 tokens). Key: create one in the console. It starts with abl_. Step 1: Add Refuseless to your config
  • Mac / Linux: ~/.config/opencode/opencode.json
  • Windows: %USERPROFILE%\.config\opencode\opencode.json
  • Optional per-project override: ./opencode.json in your repo root (same shape, loads on top of the global file).
If the file is new, paste the whole thing. If it already has content, merge only the "refuseless" block into the existing "provider" object.
Step 2: Connect your key Start opencode, type /connect, choose Refuseless and paste your key. If Refuseless isn’t listed, pick Other and enter refuseless as the provider id.
OpenCode stores the /connect key separately, and it takes priority over any apiKey in opencode.json. If you create a new key, run /connect again. Otherwise OpenCode keeps sending the old one and you get Invalid API key.
Step 3: Select the model and verify
Or type /models in OpenCode and pick Refuseless › GLM 5.3 Refuseless. Send a test prompt like Say ok.. The first response confirms the key, base URL and model id are all correct. Other ids from the lineup work after the refuseless/ prefix. Still not working? Check that:
  • the model id is lowercase (refuseless/…, not Refuseless/…)
  • baseURL ends in /v1
  • the JSON has no trailing commas

Claude Code

Claude Code speaks the Anthropic API, so point it at the host (no /v1) and pick a model from the lineup:
ANTHROPIC_DEFAULT_HAIKU_MODEL covers Claude Code’s background calls, which otherwise ask for a Claude model id that does not exist here. Thinking settings (think, ultrathink) map to reasoning levels as described in Thinking and effort.

Pi (pi-coding-agent)

Pi talks to any OpenAI-compatible endpoint through models.json — no extension needed. Base URL: https://api.refuseless.com/v1 Model: glm-5.3-abliterated (context 1,048,576 tokens). Key: create one in the console. It starts with abl_. Step 1 — Save your API key Export it before you start Pi — Pi reads it at request time. Mac (zsh, Terminal):
Windows (PowerShell):
Start Pi from that same terminal afterwards. Step 2 — Open models.json Pi’s agent directory defaults to ~/.pi/agent (overridden by PI_CODING_AGENT_DIR). The file you want is:
  • Mac / Linux: ~/.pi/agent/models.json
  • Windows: C:\Users\<you>\.pi\agent\models.json (in PowerShell: $env:USERPROFILE\.pi\agent\models.json)
Create it if it does not exist:
If the file already exists and has a "providers" object, only add the "refuseless" entry inside it — do not delete your other providers. Step 3 — Paste this block Copy the whole block below. If models.json is empty, paste it as-is. If it already has providers, copy just the "refuseless": { ... } entry inside your existing "providers" object.
Notes:
  • "api": "openai-completions" is required for tool calls (agentic coding).
  • "$REFUSELESS_API_KEY" is Pi syntax — it reads the variable from Step 1 at request time. A literal key string also works but env is preferred.
  • cost zeros mean Pi tracks tokens without inventing a price. See the console for actual pricing.
Step 4 — Pick the model inside Pi
Or start pi, type /model, and choose refuseless / glm-5.3-abliterated. The picker reloads models.json automatically — no restart needed after editing the file (but you do need the env var set before Pi starts). Send a test prompt like Say ok. Model does not appear? Check: the env var is set in the terminal that launched Pi, baseUrl ends in /v1, the JSON is valid (no trailing commas), and the "refuseless" entry sits inside "providers". Other ids from the lineup work after the refuseless/ prefix.

Responses API

Harnesses on the newer API (Codex, client.responses) use POST /v1/responses — same models, same keys: