API reference

The Chainless API is the OpenAI Chat Completions API. Point any OpenAI client at the base URL below and use a Chainless key.

Base URL and authentication

Base URLhttps://chainless.one/v1
Auth headerAuthorization: Bearer cl-… (or x-api-key: cl-…)
Keyscreate and limit them at dashboard/keys
EndpointsGET /v1/models, POST /v1/chat/completions

Requests need an active plan on the account (pricing). Each key can carry its own spending limit and expiry date.

List models

shell
curl https://chainless.one/v1/models

Returns {"object": "list", "data": [...]} where each item has id, name, context_length and a pricing object. No key is needed. Current models:

ModelidContextMax outputCapabilitiesSpeed
GLM 5.3 Uncensoredglm-5.3-uncensored1M128Kreasoning, toolsStandard
GLM 5.3 Fast Uncensoredglm-5.3-fast-uncensored1M128Kreasoning, tools, imagesFast (low-latency route)
DeepSeek V4.1 Uncensoreddeepseek-v4.1-uncensored1M128Kreasoning, tools, imagesStandard
DeepSeek V4.1 Fast Uncensoreddeepseek-v4.1-fast-uncensored1M128Kreasoning, tools, imagesFast (low-latency route)
Kimi K3.1 Pro Uncensoredkimi-k3.1-pro-uncensored1M128Kreasoning, tools, imagesStandard

Model ids are case-insensitive and also accepted with a chainless/ prefix (chainless/glm-5.3-fast-uncensored).

Chat completions

shell
curl https://chainless.one/v1/chat/completions \
  -H "Authorization: Bearer $CHAINLESS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3-fast-uncensored",
    "messages": [
      {"role": "system", "content": "You are a concise security engineer."},
      {"role": "user", "content": "List the HTTP response headers that matter for clickjacking protection."}
    ],
    "max_tokens": 800
  }'
python
from openai import OpenAI

client = OpenAI(base_url="https://chainless.one/v1", api_key="cl-...")
resp = client.chat.completions.create(
    model="glm-5.3-fast-uncensored",
    messages=[{"role": "user", "content": "Summarise RFC 9116 (security.txt) in five bullets."}],
)
print(resp.choices[0].message.content)
print(resp.usage)
typescript
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://chainless.one/v1", apiKey: process.env.CHAINLESS_API_KEY });
const res = await client.chat.completions.create({
  model: "glm-5.3-fast-uncensored",
  messages: [{ role: "user", content: "Explain SameSite=Lax vs Strict in two sentences." }],
});
console.log(res.choices[0].message.content);

Standard OpenAI request fields are passed through to the model: model, messages (non-empty), stream, stream_options, max_tokens or max_completion_tokens, temperature, top_p, stop, tools, tool_choice, response_format, reasoning_effort. Fields that identify your end users (user, safety_identifier, metadata) and storage hints (store) are dropped before the request reaches the model.

The response is a standard chat.completion object. usage has prompt_tokens, completion_tokens, total_tokens, prompt_tokens_details.cached_tokens and completion_tokens_details.reasoning_tokens.

Output limits

max_tokens defaults to the model's maximum output and is capped so that one request never costs more than the account (or the key's limit) can pay. If the remaining balance is too small for a useful answer, the API returns 402 before calling the model.

Streaming

Set "stream": true to receive Server-Sent Events in the OpenAI format, ending with data: [DONE]:

text
data: {"choices":[{"index":0,"delta":{"reasoning":"The user wants…"}}]}
data: {"choices":[{"index":0,"delta":{"content":"Use "}}]}
data: {"choices":[{"index":0,"delta":{"content":"X-Frame-Options"}}]}
data: [DONE]
  • Answer text arrives in choices[0].delta.content.
  • Reasoning text, when the model sends it, arrives in delta.reasoning (on some routes delta.reasoning_content). Most OpenAI clients ignore unknown fields, so it is safe to leave it.
  • Add "stream_options": {"include_usage": true} to get a final chunk with usage.
  • If the client disconnects mid-stream, the request is billed for what was generated up to that point.

Reasoning effort

All current models reason before answering. reasoning_effort takes minimal, low, medium, high, xhigh, max, or none/off, and is mapped to the closest level each model supports. Lower effort means fewer reasoning tokens (billed as output) and a faster first token.

Tool calling

Models with tool support accept tools and tool_choice in the OpenAI format and return message.tool_calls. Run the function yourself, append a {"role": "tool", "tool_call_id": "...", "content": "..."} message and call the API again. GLM, DeepSeek and Kimi models all support tools; see /models.

Images

Every model except GLM 5.3 Uncensored accepts image_url content parts in user messages (https URLs or data:image/...;base64, URLs):

json
{"role": "user", "content": [
  {"type": "text", "text": "What does this login page leak?"},
  {"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBOR..."}}
]}

Errors

Errors use the OpenAI shape: {"error": {"message": "...", "type": "...", "code": "..."}}.

Statustype / codeWhen
400invalid_request_errorbody is not JSON, or messages is missing or empty
401authentication_error / invalid_api_keymissing, wrong or revoked key
401authentication_error / key_expiredthe key passed its expiry date
402insufficient_quota / plan_requiredno active plan on the account
402insufficient_quota / insufficient_quotaplan credit and balance are used up
402insufficient_quota / key_limit_reachedthe key reached its spending limit
404invalid_request_error / model_not_foundunknown model id, or the model is temporarily unavailable
404invalid_request_error / not_foundan endpoint other than the two above
429rate_limit_errormore than 600 requests per minute on one key
502upstream_errorthe model is busy everywhere; retry with backoff

Retry 429 and 502 with exponential backoff. Do not retry 400, 401 or 402 without changing something.

CORS

/v1/* answers CORS preflight requests from any origin, so browser tools and local web UIs can call it directly. Keep keys out of public front-end code.

Clients and tools

Setup notes for Cursor, Cline, OpenCode, Kilo Code, Continue, Open WebUI, LiteLLM, LangChain, the Vercel AI SDK and pi are on /integrations. For agent work under an authorized scope, see the ready-made brief on /guides.

Questions

Is the Chainless API compatible with the OpenAI SDKs?

Yes. Set base_url (Python) or baseURL (JavaScript) to https://chainless.one/v1 and use your cl- key as the API key. Chat Completions, streaming and tool calling behave like OpenAI's.

Does Chainless support the Responses API or embeddings?

No. Only GET /v1/models and POST /v1/chat/completions are served; other /v1 paths return 404. Tools that default to the Responses API must be switched to Chat Completions.

What is the rate limit?

600 requests per minute per API key. Above that the API answers 429; back off and retry.

Can I call the API from a browser?

CORS is open on /v1, so it works technically, but a key in browser code is visible to every visitor. Call the API from your server, or give the browser a separate key with a small spending limit.