Use this base URL
https://api.cheaperinference.com/v1
App integrations
Cheaper Inference supports OpenAI-compatible Chat Completions and a stateless Responses API for Codex. Most agents, coding tools, and chat apps only need a base URL, an API key, and a model ID.
https://api.cheaperinference.com/v1
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.
Send new local Codex tasks through Cheaper Inference's Responses API.
Supported: streamed responses, function calls, local Codex tools such
as apply_patch, and usage accounting. This configuration applies to new
local tasks in the Codex CLI, desktop app, and IDE extension. It does not change Codex cloud
chats.
If codex --version already prints a version, continue to step 2.
npm install --global @openai/codex codex --version
Create a key in the Cheaper Inference dashboard. Replace the placeholder below, then run the command in the same terminal window you will use to start Codex. This sets the key for that terminal session only.
export CHEAPER_INFERENCE_API_KEY="ir_live_YOUR_API_KEY"
$env:CHEAPER_INFERENCE_API_KEY = "ir_live_YOUR_API_KEY"
Open ~/.codex/config.toml and add the configuration below. In the desktop
app, choose Settings → Configuration → Open config.toml. Replace
gpt-5.4 with any currently available text-model ID from the
live catalog; models with reliable tool calling work best
for coding tasks.
model = "gpt-5.4" model_provider = "cheaper-inference" [model_providers.cheaper-inference] name = "Cheaper Inference" base_url = "https://api.cheaperinference.com/v1" env_key = "CHEAPER_INFERENCE_API_KEY" wire_api = "responses"
Apps opened from the Dock may not inherit a key exported in Terminal. Store a dedicated key in macOS Keychain, then use Codex's command-backed authentication. Paste your key when prompted; it will not appear in the command itself.
read -s "CHEAPER_KEY?Paste your Cheaper Inference API key: " echo security add-generic-password -U -a codex -s cheaper-inference-codex -w "$CHEAPER_KEY" unset CHEAPER_KEY
In the provider configuration, remove the env_key line and add:
[model_providers.cheaper-inference.auth] command = "/usr/bin/security" args = ["find-generic-password", "-a", "codex", "-s", "cheaper-inference-codex", "-w"]
Use either env_key or the auth block, not both.
From the terminal where you set the key, open your project and run:
codex exec --model gpt-5.4 --sandbox read-only "Run pwd without changing files, then tell me the directory."
Inspect this project without changing files and tell me its framework.
Confirm it worked: open Cheaper Inference History.
The completed request should show the selected model, endpoint
/v1/responses, token usage, and a settled charge.
codex: command not foundcodex --version again.EACCES or “permission denied”401config.toml, restart Codex, and begin a new local task.
This endpoint is stateless and requires store: false. Stored responses,
previous_response_id, conversations, background mode, and
provider-hosted web or file search are not supported. Local Codex tools continue to
work.
Add Cheaper Inference as a custom Chat Completions provider.
CHEAPER_INFERENCE_API_KEY in the environment that starts OpenClaw.cheaper-inference/gpt-5.4.{
"env": {
"CHEAPER_INFERENCE_API_KEY": "ir_live_YOUR_API_KEY"
},
"agents": {
"defaults": {
"model": {
"primary": "cheaper-inference/gpt-5.4"
}
}
},
"models": {
"providers": {
"cheaper-inference": {
"baseUrl": "https://api.cheaperinference.com/v1",
"apiKey": "${CHEAPER_INFERENCE_API_KEY}",
"api": "openai-completions",
"models": [
{
"id": "gpt-5.4",
"name": "GPT-5.4 via Cheaper Inference"
}
]
}
}
}
}
Important: keep api set to openai-completions. Add another object to models for each Cheaper Inference model ID you want OpenClaw to expose.
Capability metadata: OpenClaw supplies generic context, output-token, reasoning, and input-modality defaults when optional model fields are omitted. Add explicit values only after verifying them for the exact model you selected.
Use Hermes' custom endpoint option.
hermes model.gpt-5.4.For a manual setup, put CHEAPER_INFERENCE_API_KEY=ir_live_YOUR_API_KEY in ~/.hermes/.env, then edit ~/.hermes/config.yaml:
custom_providers:
- name: cheaper-inference
base_url: https://api.cheaperinference.com/v1
key_env: CHEAPER_INFERENCE_API_KEY
api_mode: chat_completions
model:
default: gpt-5.4
provider: custom:cheaper-inference
Recommended: use hermes model so Hermes writes the configuration in its current format. Protect ~/.hermes/.env because it contains your key.
Configure an OpenAI-compatible custom provider.
/connect, choose Other, enter cheaper-inference, and add your API key.opencode.json, then use /models to select it.{
"$schema": "https://opencode.ai/config.json",
"provider": {
"cheaper-inference": {
"npm": "@ai-sdk/openai-compatible",
"name": "Cheaper Inference",
"options": {
"baseURL": "https://api.cheaperinference.com/v1"
},
"models": {
"gpt-5.4": {
"name": "GPT-5.4"
}
}
}
}
}
Important: use @ai-sdk/openai-compatible so OpenCode sends Chat Completions requests. Add more entries under models using exact IDs from the live catalog.
Use Cheaper Inference in the OpenCode-powered desktop agent.
The OpenCode schema is intentional: OpenWork uses OpenCode as its model engine and reads OpenCode provider configuration for each workspace.
opencode.json in that workspace's root folder.{
"$schema": "https://opencode.ai/config.json",
"provider": {
"cheaper-inference": {
"npm": "@ai-sdk/openai-compatible",
"name": "Cheaper Inference",
"env": ["CHEAPER_INFERENCE_API_KEY"],
"options": {
"baseURL": "https://api.cheaperinference.com/v1"
},
"models": {
"gpt-5.6-sol": {
"name": "GPT-5.6 Sol"
},
"gpt-5.6-terra": {
"name": "GPT-5.6 Terra"
},
"deepseek-v4-flash": {
"name": "DeepSeek V4 Flash"
}
}
}
}
}
Keep the key out of the file: the env declaration tells
OpenWork that this provider accepts an API key; it does not contain the secret.
OpenWork stores the key locally through OpenCode after you connect the provider.
Add or replace model entries using exact IDs from the
live catalog.
If Cheaper Inference does not appear: completely reload the workspace engine after saving the file. If it is still missing, capture the exact error and your OpenWork version before contacting support.
Connect a hosted or self-hosted chat interface.
https://api.cheaperinference.com/v1 and your API key, then save.Feature scope: chat and model discovery work through the Cheaper Inference connection. Configure a separate provider for Open WebUI features that require embeddings, speech-to-text, or text-to-speech.
Use the OpenAI Compatible provider in VS Code.
https://api.cheaperinference.com/v1.gpt-5.4.Advanced model settings: enable image support, computer/tool use, and context or output limits only when the selected model supports them. These settings are model-specific, even when the same OpenAI-compatible connection is reused.
Point the terminal pair programmer at the compatible endpoint.
export OPENAI_API_BASE=https://api.cheaperinference.com/v1 export OPENAI_API_KEY=ir_live_YOUR_API_KEY cd /path/to/your/project aider --model openai/gpt-5.4
Windows PowerShell:
$env:OPENAI_API_BASE = "https://api.cheaperinference.com/v1" $env:OPENAI_API_KEY = "ir_live_YOUR_API_KEY" Set-Location C:\path\to\your\project aider --model openai/gpt-5.4
Model naming: keep Aider's openai/ prefix, followed by the exact Cheaper Inference model ID. If Aider warns that a newer model is unknown, its official model settings can be used to describe the model's context and edit format.
Add a custom OpenAI-compatible endpoint for a team chat deployment.
Add the key to LibreChat's .env:
CHEAPER_INFERENCE_API_KEY=ir_live_YOUR_API_KEY
Add the endpoint to librechat.yaml, then restart LibreChat:
version: 1.3.13
endpoints:
custom:
- name: Cheaper Inference
apiKey: '${CHEAPER_INFERENCE_API_KEY}'
baseURL: 'https://api.cheaperinference.com/v1'
models:
default:
- gpt-5.4
- claude-opus-4.6
fetch: true
titleConvo: true
titleModel: gpt-5.4
modelDisplayLabel: Cheaper Inference
Claude model IDs: keep this as a custom OpenAI-compatible endpoint even when selecting a Claude model. Cheaper Inference translates the common request format to the serving provider.
Add a model to Continue's YAML configuration.
name: Cheaper Inference
version: 0.0.1
schema: v1
models:
- name: GPT-5.4 through Cheaper Inference
provider: openai
model: gpt-5.4
apiBase: https://api.cheaperinference.com/v1
apiKey: ir_live_YOUR_API_KEY
useResponsesApi: false
Recommended for Continue: keep useResponsesApi: false so Continue uses the broadly compatible Chat Completions path. The Responses endpoint is currently targeted at stateless Codex workloads.
Codex can use /v1/responses. For other apps, use OpenAI-compatible
Chat Completions unless the guide says otherwise. Configure a separate
provider for embeddings, audio, stored Responses conversations, or hosted web and file
search. For raw HTTP examples, parameters, and error handling, see the
API documentation.