Journalguides

Field guide / 6 min read

How to use ISH API with Codex CLI

A practical Codex CLI setup guide for api.ish.chat, including custom provider config, Responses wire API, tool-call verification, and usage tracking.

Aug 21, 20266 min readBy ISH Team
How to use ISH API with Codex CLI
Advertisement

Codex CLI supports custom model providers, which makes it a good fit for api.ish.chat. You add ISH as a provider in ~/.codex/config.toml, point it at the OpenAI-compatible /v1 endpoint, and tell Codex to use the Responses wire format.

This guide gives you the working config and the quick tests that prove text responses and tool calls are flowing correctly.

What you need

Before editing config:

  • An ISH account.
  • Purchased API balance. Codex/API traffic does not spend the free daily chat balance.
  • An API key from api.ish.chat/keys.
  • Codex CLI installed locally.

Keep the API key out of your repo. Put it in your shell environment or a private secret manager, not in a committed config file.

Add ISH as a Codex provider

Open:

~/.codex/config.toml

Add this config:

model = "claude-sonnet-4.6"
model_provider = "ish"
model_context_window = 200000
model_auto_compact_token_limit = 120000

[model_providers.ish]
name = "ISH API"
base_url = "https://api.ish.chat/v1"
wire_api = "responses"
env_key = "ISH_API_KEY"

The important pieces are:

  • base_url = "https://api.ish.chat/v1"
  • wire_api = "responses"
  • env_key = "ISH_API_KEY"

Codex’s custom-provider docs support this shape: provider ID, base URL, wire API, and environment-backed auth key.

Export your key

In the same shell where you start Codex:

export ISH_API_KEY="ish_live_your_key_here"
codex

For fish:

set -gx ISH_API_KEY "ish_live_your_key_here"
codex

Verify the setup

Start with a tiny text-only request:

codex exec --skip-git-repo-check "Reply exactly: ISH_OK"

Then verify the tool loop:

printf "TOOL_OK\n" > hello.txt
codex exec --skip-git-repo-check "Read hello.txt and reply exactly with its contents."

If both work, Codex can reach ISH, receive model output, and complete a local tool-read loop.

Supported models

Good defaults:

Codex modelUse for
claude-haiku-4.5quick checks and small edits
claude-sonnet-4.6normal coding work
claude-opus-4.8heavier reasoning and planning
claude-sonnet-5newer Sonnet-class work when available
gpt-5.6-solGPT-style reasoning when available

Use canonical model IDs in Codex CLI. Cursor-style ish-... aliases are accepted by ISH, but canonical IDs keep CLI configs easier to read.

Track usage

Every Codex request appears in api.ish.chat/usage. You can see:

  • key name and prefix
  • endpoint type
  • model
  • input and output usage
  • charged amount
  • status

This is especially helpful for Codex because tool calls and project context can make a request larger than the message you typed.

Common errors

Empty response

Make sure the ISH provider has:

wire_api = "responses"

Without the Responses wire format, Codex may not speak the expected protocol for tool-call loops.

401 authentication error

Check that ISH_API_KEY is set in the same shell where Codex starts, and that the value starts with ish_live_.

Model not supported

Use a canonical Rootnull model ID such as:

claude-sonnet-4.6

Then restart Codex so the provider and model selection reload cleanly.

Insufficient balance

Add balance from api.ish.chat/dashboard. Codex traffic is API usage, so it does not spend free daily web chat usage.

Best default

Start with claude-sonnet-4.6. It is the safest balance for normal coding tasks. Move to claude-haiku-4.5 for cheap quick checks, and only move up to Opus-class models when the task needs it.

Useful links:

#ish-api#codex-cli#coding-agents#developer-tools
Advertisement

Keep reading

Related stories

Browse the archive