Back to blog
Product update

Coding agent support is now available on GraphN

Published
October 27, 2026
Reading time
9 min
Claude Code, Codex, Cursor and OpenCode now run on GraphN's open models. You keep the agent you know; you change its base URL and key.
GraphN's model API at https://model.graphn.ai now speaks the wire format each coding agent expects, so there is no proxy to run and no plugin to install. We gave three agents the same bug report on each of five models and graded each fix with 20 tests the agents never saw. Seven of the fifteen sessions passed all 20, and the most expensive session cost 43 cents.

How it works

Each agent speaks one API. GraphN serves all three on the same host, with the same key, models and billing:
  • Anthropic Messages (/v1/messages) is what Claude Code uses.
  • OpenAI Responses (/v1/responses) is what Codex uses.
  • OpenAI Chat Completions (/v1/chat/completions) is what Cursor, OpenCode and most other tools use.
Streaming, tool calls, thinking and image input work in all three. Each request is billed at GraphN's per-token rates and appears in your workspace's usage and Logs, like any other API call.

Fifteen sessions, one bug report

The task is pkgresolve, a 350-line Python package that picks versions for a set of dependencies, the way npm does. Its ISSUE.md reports three problems:
  • The resolver gives up too early. It takes the newest version of each package and never reconsiders, so it fails on dependency sets that have a valid answer. The fix needs a backtracking search that still prefers the newest versions, keeps only the packages the answer needs, names the package that blocks an impossible set, and stays fast on a registry with hundreds of packages.
  • Caret ranges on 0.x are too loose. ^0.2.3 matches 0.9.0, where npm stops at 0.3.0.
  • Prereleases sort and match wrong. 1.0.0-alpha.10 sorts before 1.0.0-alpha.2, and ^1.4.0 picks 2.0.0-rc.1. Ordering must follow SemVer 2.0.0 exactly, and ranges npm's prerelease rule.
The repository ships 15 tests, and 4 of them fail. Every agent got the same prompt, with nothing else to go on:
Fix the problems described in ISSUE.md. Run the tests with python3 -m unittest discover -s tests. Don't change the existing tests; you may add new ones.
When the agent finished, we graded its code with 20 hidden tests written from the issue, in the style of SWE-bench: the shipped tests show the agent where to start, and the hidden ones check what the issue actually asked for. No session edited the shipped tests.
Hidden tests passed, cost and wall-clock time per session:
Scroll horizontally to compare
Agentglm-5.3deepseek-v4.1-flashkimi-k2.5qwen3.8-27bgpt-oss-120b
Claude Code20/20 · $0.29 · 9.9m20/20 · $0.12 · 6.0m17/20 · $0.37 · 2.5m20/20 · $0.25 · 5.2m17/20 · $0.17 · 2.2m
Codex20/20 · $0.18 · 2.9m20/20 · $0.12 · 7.3m18/20 · $0.26 · 3.1m19/20 · $0.15 · 2.7m17/20 · $0.07 · 0.9m
OpenCode20/20 · $0.43 · 20m†20/20 · $0.10 · 7.8m15/20 · $0.22 · 1.6mNo fix · $0.12 · 2.8m17/20 · $0.11 · 0.8m
Cost is GraphN's list rates applied to each session's token counts, and time is the whole session, including the agent running the tests. All fifteen came to $2.96. † Stopped by our 20-minute limit after the fix was in place.
What stood out:
  • DeepSeek V4.1 Flash passed every hidden test with all three agents, and its sessions were the cheapest perfect ones, at 10 to 12 cents. Each read about 1.5 million input tokens, almost all of it from cache. It was also among the slowest, at 6 to 8 minutes.
  • GLM-5.3 also passed every hidden test with all three agents. In Codex it was the fastest perfect session, under 3 minutes for 18 cents. In Claude Code and OpenCode it reasoned at length: almost 10 minutes in Claude Code, and in OpenCode it kept checking its work after the fix until our time limit stopped it.
  • Passing the shipped tests is not the same as fixing the issue. Every Kimi K2.5 and gpt-oss-120b session got the 15 shipped tests green, then missed details the issue asks for: the error for an impossible set doesn't name the package, build metadata changes the sort order, and some caret ranges on 0.x and prerelease ranges match the wrong versions. Read the diff, not just the test run.
  • Two resolvers never finish on a large registry. Codex on Qwen3.8-27B and OpenCode on Kimi K2.5 wrote searches that try too many combinations, so the hidden test with a wide registry hung. The shipped tests have no such case. Codex on Qwen passed the other 19.
  • An OpenCode session can end quietly when the model thinks too long. On our first OpenCode run, GLM-5.3 and Qwen3.8-27B read the code, then thought until they hit the 32,000-token output limit, and OpenCode ended the session with no error and no change. The tokens were still billed. Setting reasoningEffort to high for GLM-5.3 bounds its thinking: with it, the GLM run in the table never wrote a reply over 15,000 tokens. The Qwen session in the table is the first run; in an earlier run of the same task, OpenCode on Qwen passed all 20.
This is one task with one session per pair. It shows that the agents do real multi-file work on GraphN and what that work costs. It does not rank the models, so try them on an issue of your own.

Why the cached rate matters

A coding agent resends the same long prefix on every turn: its system prompt, its tool definitions and the conversation so far. Input served from cache bills at the cached input rate, a tenth of the input price.
Claude Code on DeepSeek V4.1 Flash sent 1,504,309 input tokens over 31 tool calls, and 94% of them came from cache. That session cost $0.12. At the full input rate it would have cost $0.51, four times as much.
Scroll horizontally to compare
SessionInput tokensFrom cacheCost
Codex · deepseek-v4.1-flash1,576,10998%$0.12
OpenCode · deepseek-v4.1-flash1,580,83298%$0.10
Codex · glm-5.3542,25895%$0.18
Claude Code · deepseek-v4.1-flash1,504,30994%$0.12
Claude Code · qwen3.8-27b566,72085%$0.25
Claude Code · kimi-k2.5746,79225%$0.37
Claude Code · gpt-oss-120b1,068,7390%$0.17
Cache hits depend on the model. Every GLM, DeepSeek and Qwen session that made a fix read 85% to 98% of its input from cache. Kimi K2.5 read 25% to 31%, and gpt-oss-120b sessions didn't hit it, which is why Claude Code on Kimi cost the most of the Claude Code sessions despite being one of the shortest. DeepSeek read three times as many tokens as Kimi in Claude Code and cost a third as much. Logs show the cached tokens on every request, so you can see this for your own sessions.

Set up your agent

Pick your agent and a model to get its config with the model and context window filled in:
Claude Code on glm-5.3
modelcalls /v1/messages
export ANTHROPIC_BASE_URL=https://model.graphn.ai
export ANTHROPIC_API_KEY=<your GraphN API key>
export ANTHROPIC_MODEL=glm-5.3
export ANTHROPIC_DEFAULT_OPUS_MODEL=glm-5.3
export ANTHROPIC_DEFAULT_SONNET_MODEL=glm-5.3
export ANTHROPIC_DEFAULT_HAIKU_MODEL=glm-5.3
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=1048576
export CLAUDE_CODE_AUTO_MODE_SERVER=0
claude
The coding agents guide explains every setting, how to check your key, the Codex and Cursor caveats, and fixes for the errors you are most likely to hit.

Which model to use

Scroll horizontally to compare
ModelContextImagesInput / output per 1M tokensCached input
glm-5.31,048,576No$1.40 / $4.40$0.14
deepseek-v4.1-flash1,048,576Yes$0.30 / $1.20$0.03
kimi-k2.5256,000Yes$0.60 / $3.00$0.06
qwen3.8-27b262,144Yes$0.45 / $3.20$0.045
gpt-oss-120b131,072No$0.15 / $0.60$0.015
  • GLM-5.3 is Z.ai's open-weights reasoning model built for complex coding and long-horizon agent work, with a 1M-token window. It costs more per token than the others, so reach for it when the task is hard enough to need it.
  • DeepSeek V4.1 Flash is where to start. It has a 1M-token window, passed every hidden test with all three agents for the lowest cost of any perfect session, and reads almost all of its input from cache, so long sessions in large repositories stay cheap.
  • Kimi K2.5 is the largest model in the catalog, trained for agentic work with many tool calls.
  • Qwen3.8-27B is a dense 27B model with thinking and image input, for work that starts from a screenshot.
  • gpt-oss-120b has the lowest per-token price, for high-volume tasks that don't need images.

Start with a real task

Before moving a team over, give one model a real issue in your repository and compare the result with what you use today. Then open Logs in your workspace: every turn the agent took is there, with its tokens, cache hits and cost.
Create an API key in GraphN, or see the models guide for everything the catalog serves.

Primary sources

  • Claude Code LLM gateway configuration

    Documents ANTHROPIC_BASE_URL for routing Claude Code to any endpoint that serves the Anthropic Messages API.

  • Claude Code environment variables

    Documents ANTHROPIC_MODEL, the ANTHROPIC_DEFAULT_*_MODEL tier variables and CLAUDE_CODE_MAX_CONTEXT_TOKENS used in the setup.

  • Claude Code auto mode classifier request charges

    Documents CLAUDE_CODE_AUTO_MODE_SERVER=0 for sessions whose requests go through a gateway that can't run the server-side checks.

  • Codex configuration reference

    Documents model_providers, wire_api = "responses", env_key and model_context_window.

  • Codex advanced configuration: profiles

    Documents per-profile config files loaded with --profile.

  • Cursor API keys

    Documents bringing your own key, that requests route through Cursor's servers, and that Tab completion keeps using Cursor's models.

  • OpenCode providers

    Documents adding an OpenAI-compatible provider with a custom baseURL.

  • Anthropic Messages API

    Defines the request and streaming format GraphN serves at /v1/messages.

  • Open Responses

    Defines the open Responses API schema and compliance suite GraphN's /v1/responses was tested against.