Quickstart

OpenCheap speaks the OpenAI API for chat. A key from the console is the only thing you add.

Call a model

Send the key as a bearer token to https://api.opencheap.si/v1. The model id is the name without a vendor prefix.

curl https://api.opencheap.si/v1/chat/completions \
  -H "Authorization: Bearer $OPENCHEAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "claude-sonnet-5", "messages": [{ "role": "user", "content": "Hello" }] }'

With the OpenAI SDK

Set the SDK's base URL to https://api.opencheap.si/v1 and its key to your OpenCheap key. Prompts, tools and parsing stay the same.

from openai import OpenAI
import os

client = OpenAI(base_url="https://api.opencheap.si/v1", api_key=os.environ["OPENCHEAP_API_KEY"])

r = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content, r.usage)
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.opencheap.si/v1", apiKey: process.env.OPENCHEAP_API_KEY });

const stream = await client.chat.completions.create({
  model: "claude-sonnet-5",
  messages: [{ role: "user", content: "Hello" }],
  stream: true,
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");

Or leave the code as it is and set two variables: the OpenAI Python and JavaScript SDKs read OPENAI_BASE_URL (set it to https://api.opencheap.si/v1) and OPENAI_API_KEY (your OpenCheap key) when the client is built with no arguments. Set them only for the program that should call OpenCheap.

If it does not answer: 401 invalid_api_key means the key is wrong or empty; 402 with an accepts list means no key was sent at all (the API quoted the price of paying for that call in USDC); 404 not_found means the base URL is not exactly https://api.opencheap.si/v1.

Ids and aliases

claude-sonnet-5 and gpt-oss-120b are the ids to use. A provider's native id, and the vendor/model spelling, are accepted as aliases of the same model.

Every id also works with opencheap/ in front (opencheap/claude-sonnet-5), on every endpoint: the console's copy buttons copy that form, so a pasted id works in any tool, Cursor included. Logs show the plain id.

In Cursor, Claude Code and Codex

The console's setup page, and Create key on Models or API keys, show these steps with your key filled in. By hand: Cursor takes the key and the base URL in its own settings (its own page: Cursor).

  1. 1
    Open Cursor Settings, then Models.
  2. 2
    Under OpenAI API Key, paste your key.
    The key from the console.
  3. 3
    Turn on Override OpenAI Base URL, paste the URL and click Verify.
    https://api.opencheap.si/v1
  4. 4
    Click Add Custom Model, type the name as it is here (opencheap/ and the model id), and enable it.
    For example opencheap/claude-sonnet-5: opencheap/ and any id from the Models page.
  5. 5
    Pick it in the chat's model menu.

Keep the opencheap/ in front of the model id: Cursor keeps names that start with claude- for its own Anthropic connection and answers "Model name is not valid", so a plain claude-sonnet-5.5 never reaches the base URL. OpenCheap accepts opencheap/ in front of every model id.

Claude Code reads three variables. Keep them in your shell profile, or under "env" in ~/.claude/settings.json.

export ANTHROPIC_BASE_URL=https://api.opencheap.si
export ANTHROPIC_API_KEY=<your key>
export ANTHROPIC_MODEL=claude-sonnet-5

Codex takes OpenCheap as a model provider in ~/.codex/config.toml, with the key in OPENCHEAP_API_KEY.

model = "claude-sonnet-5"
model_provider = "opencheap"
# model_context_window = <the model's context length, from Models: Codex assumes 272k>

[model_providers.opencheap]
name = "OpenCheap"
base_url = "https://api.opencheap.si/v1"
env_key = "OPENCHEAP_API_KEY"
wire_api = "responses"