Journalguides

Field guide / 7 min read

How to use ISH API with Claude Code

A practical setup guide for routing Claude Code through api.ish.chat, with model IDs, env vars, verification, and common fixes.

Aug 21, 20267 min readBy ISH Team
How to use ISH API with Claude Code
Advertisement

Claude Code is most useful when it feels boring in the best way: open a project, ask it to inspect files, let it stream the work, and see usage in one place. If you already use ISH for chat, the API side lets you route Claude Code through the same account and balance.

This guide shows the clean setup for api.ish.chat, plus the small details that usually cause errors.

What you need

You need three things before opening Claude Code:

  • An ISH account.
  • A purchased API balance. API and connector usage does not spend the free daily web balance.
  • An API key from api.ish.chat/keys.

Create the key, copy it once, and keep it somewhere safe. ISH only stores a hash of the key, so the dashboard cannot show the full secret again later.

The important base URL detail

For Claude Code, set the base URL to:

https://api.ish.chat

Do not add /v1 to ANTHROPIC_BASE_URL.

Claude Code adds the Anthropic route itself when it calls the Messages API. Manual curl tests use /v1/messages, but the Claude Code environment variable should stay at the origin.

That one detail prevents a lot of confusing 404s, retries, and "gateway unreachable" style errors.

Quick setup for zsh or bash

Open the same terminal where you plan to run Claude Code:

export ANTHROPIC_BASE_URL="https://api.ish.chat"
export ANTHROPIC_API_KEY="ish_live_your_key_here"
export ANTHROPIC_MODEL="claude-sonnet-4.6"
export ANTHROPIC_SMALL_FAST_MODEL="claude-haiku-4.5"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4.6"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4.5"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4.8"

claude

If your local Claude Code build or gateway mode expects bearer-token auth, set this too:

export ANTHROPIC_AUTH_TOKEN="$ANTHROPIC_API_KEY"

ISH accepts the API key for connector traffic, and setting both variables is a harmless way to avoid header mismatch issues across Claude Code versions and surfaces.

Persistent setup

For a setup that survives new terminals, put the same values into a Claude Code settings file.

User-wide file:

~/.claude/settings.json

Project-local private file:

.claude/settings.local.json

Use settings.local.json for project-specific configuration because it is meant to stay private. Do not commit API keys into a shared repository.

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.ish.chat",
    "ANTHROPIC_API_KEY": "ish_live_your_key_here",
    "ANTHROPIC_AUTH_TOKEN": "ish_live_your_key_here",
    "ANTHROPIC_MODEL": "claude-sonnet-4.6",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4.5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4.6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4.5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4.8"
  },
  "model": "claude-sonnet-4.6"
}

After saving it, start Claude Code and run:

/status

You want to see the API base URL and key source listed there. Then run:

/model

Pick one of the supported ISH model IDs.

Supported model IDs

Use canonical model IDs when possible:

Model IDGood default for
claude-haiku-4.5Fast edits, small checks, lightweight tasks
claude-sonnet-4.6Everyday coding, repo reading, debugging
claude-opus-4.8Harder planning and larger reasoning tasks
claude-opus-5Heavy reasoning when available on your account
claude-sonnet-5Newer Sonnet-class work when available

Some tools send provider-style or alias-style model names. ISH normalizes common variants, but canonical IDs are still the safest choice for Claude Code.

Test the API before opening Claude Code

If Claude Code fails, test the API directly first:

curl https://api.ish.chat/v1/messages \
  -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-haiku-4.5",
    "max_tokens": 64,
    "messages": [
      { "role": "user", "content": "Reply exactly: ISH_OK" }
    ]
  }'

A normal JSON response means the key, balance, model, and endpoint are working. If curl works but Claude Code does not, the problem is almost always local environment loading or a credential variable mismatch.

Common errors

"Only Rootnull model ids are supported"

Claude Code or another client sent a model name ISH could not normalize. Set the model directly:

export ANTHROPIC_MODEL="claude-sonnet-4.6"

Then restart Claude Code and check /model.

401 or authentication failed

Check that the key starts with ish_live_, is not revoked, and has no extra spaces. If you used only ANTHROPIC_API_KEY, try setting ANTHROPIC_AUTH_TOKEN to the same value too.

No streaming, or response appears all at once

This can be client-side buffering. First test a normal prompt in Claude Code. Then check api.ish.chat/usage to confirm requests are arriving and being charged. If usage appears but the UI delays output, the request is reaching ISH and the remaining issue is usually the client surface.

Insufficient balance

Add balance from the API dashboard. Free daily web usage is for the chat app, not connector/API traffic.

How usage is tracked

Every Claude Code request through ISH is logged in the API dashboard:

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

That matters because coding agents can send large context. A small prompt like "check this file" may include file contents, tool results, project instructions, and prior context. The dashboard makes those costs visible instead of hiding them behind a vague session total.

The mental model

Claude Code is the client. ISH API is the gateway. The upstream model is selected by model ID.

Claude Code decides what context to send. ISH authenticates the key, checks balance, routes the request, streams the response, and records usage.

That is the whole setup. Keep the base URL clean, use canonical model IDs, and verify with curl before debugging the CLI.

Useful links:

#ish-api#claude-code#coding-agents#developer-tools
Advertisement

Keep reading

Related stories

Browse the archive