AI coding tools

Connect Claude Code, Cursor and Codex to the API

Coding tools are the hardest workload for a model: long context, reliable tool calls and streaming that must not drop. EasyAPI connects every major coding tool through one OpenAI-compatible base URL. Change one setting and switch models whenever you want.

Recommended models available now

Chosen for coding: all support tool calls and streaming, with context large enough for the relevant files of a mid-size repo. The first two favor quality, the rest favor price.

Platform prices per 1M tokens, billed on actual usage. The list follows the live pricing API; retired models never show up here. Pick a model and the config and cost below update to match.

Exact configuration

The API base and the selected model kimi-k2.7-code are already filled in. Replace the key with your own.

shell
# shell env (or ~/.claude/settings.json "env")
export ANTHROPIC_BASE_URL=https://token.easyapi.com
export ANTHROPIC_AUTH_TOKEN=sk-your-key
export ANTHROPIC_MODEL=kimi-k2.7-code
claude

Full Claude Code integration guide →

Get one request working first

Swap in your key and run it as is. A 200 means the base URL, key and model are all right; otherwise match the error against the list below.

curl
curl https://token.easyapi.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"kimi-k2.7-code","messages":[{"role":"user","content":"Hello"}]}'

What to know

  • Claude Code speaks the Anthropic Messages protocol: point ANTHROPIC_BASE_URL at our origin without /v1. Cursor, Codex and Cline speak the OpenAI protocol and need the /v1 suffix.
  • A single coding-tool request is often 10k to 100k tokens, so cost is mostly on the input side. Enabling the tool's context compression option saves a lot.
  • Each key can carry a model allowlist and a spend cap. Give each teammate a key and read bills per person. A model missing from the allowlist returns 403.
  • Some tools' Verify button only hits /models. Passing it does not prove the selected model works. A real request is the only proof.

Common errors

Configured the tool but keep getting 401
The key is missing or wrong. Claude Code uses ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY. In Cursor, click Verify after entering the key. Make sure the key is enabled on the tokens page.
403 or 'model not available'
The key's model allowlist or group does not include the selected model. Remove the restriction on the tokens page, or pick a model from the allowlist.
404 or connection failed
Wrong base URL. OpenAI-protocol tools need the /v1 suffix; Claude Code takes the bare origin without /v1. Never use the website domain.
Output stops midway or is slow
Check time-to-first-token in the logs, then the 24-hour success rate on the model's detail page. Switching to a comparable model quickly tells whether it is the model or the network.

Cost example

At the current price of kimi-k2.7-code, one typical request with 12,000 input + 1,500 output tokens, 80 times a day:

Per request¥0.082
Per day¥6.56
Per month (30 days)¥196.73

You pay only for tokens actually used. No platform fee, routing fee or monthly minimum. Real usage is listed request by request in the console logs.

Connect now

After signing up, the console home shows an onboarding guide that generates copy-ready config for your key and model, and stays until your first successful call.

Other solutions: Build agents on the OpenAI-compatible API · Use models in Dify, n8n and FastGPT