Connection basics
Base URLs by client
OpenAI-compatible apps, including Codex and Cursor:
https://api.cheaperinference.com/v1
Claude Code and Anthropic SDKs:
https://api.cheaperinference.com
For Claude Code, set ANTHROPIC_BASE_URL to the URL above with no /v1 suffix. Claude Code appends /v1/messages itself; including /v1 produces /v1/v1/messages and a 404. Follow the Claude Code setup guide below.
Before you start
Create an API key, then copy an exact model ID from the live model catalog. Store keys in an environment variable when the app supports it.
OpenAI Node
OpenAI Node SDK
import OpenAI from "openai";const client = new OpenAI({ apiKey: process.env.CHEAPER_INFERENCE_API_KEY, baseURL: "https://api.cheaperinference.com/v1",});const response = await client.chat.completions.create({ model: "gpt-5.4", messages: [{ role: "user", content: "Hello" }],});