Connection basics
Base URLs by client
OpenAI-compatible apps, including Codex and Cursor:
https://api.cheaperinference.com/v1Claude Code and Anthropic SDKs:
https://api.cheaperinference.comClaude Code uses the URL without /v1. Each guide below includes the correct settings.
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
Set up with AI
Let your agent connect OpenAI Node for you.
OpenAI Node is a library. Choose Cursor, Codex, or Claude Code from Ask AI to set it up in your project. Tool documentation
Keep your API key local. Copy the prompt to use any other agent.
Or set up manually
3 stepsInstall the SDK, add your key, and send a test request.
Install the SDK
WhereYour project’s terminalnpm install openaiConnect your app
Wherequickstart.mjs- Set
CHEAPER_INFERENCE_API_KEYin your local environment. - Save this example as
quickstart.mjs.
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" }],});console.log(response.choices[0].message.content);- Run
node quickstart.mjsin the same terminal.
- Set
Verify your connection
- In your connected app, send:
Reply with: connected. - Open
Dashboard → Requestsand find the request for your selected model.
You should see a reply in your app and a successful request in the dashboard.
- In your connected app, send:
After setup
Check your connection or learn how to reduce repeat-request costs.