Introducing Relay
Fix it once, never twice. Relay is a gateway for coding agents that learns the fixes your model makes and applies them itself the next time the same failure shows up, with no model call.

Every coding agent pays its model to rediscover fixes it has already made. The same off-by-one, the same missing null check, the same wrong import path: each copy costs a fresh round of reading, reasoning and tokens, as if the model had never seen it before.
A frontier model is the right tool for a failure nobody has seen. It is an expensive way to fix the fiftieth copy of one you already have.
Today we are opening a private beta of Relay, an OpenAI-compatible gateway that remembers verified fixes and hands them back for free. In a replay of 50 real agent tasks, Relay wrote 43 of the fixes itself, cutting model calls by about 70%, and not one of its fixes failed.
One line to integrate
Relay sits between your agent and its model provider. You change base_url,
use a Relay key, and keep your own provider key, which Relay stores encrypted
and uses only to forward your requests.
It speaks Chat Completions and the Responses API, streaming included. We have tested it end to end with the Codex CLI, the OpenAI SDK, Claude (forwarded with your Anthropic key), Gemini, and open models on any OpenAI-compatible host.
Capability transfer, not caching
Relay never replays a stored response. A cache only helps when the exact same request comes back, and in a codebase it almost never does: the variable is named differently, the loop lives in another file, the language is different.
Instead Relay learns capabilities. It watches the conversation, and when it sees a failing test, then an edit by the model, then the same test passing, it has evidence of a verified fix. The engine parses the before and after with tree-sitter, generalizes the edit past names and layout, and keeps it only if it transfers to renamed and restructured variants with zero regressions. It works across 12 languages: JavaScript, TypeScript, TSX, Python, Go, Java, Rust, Ruby, PHP, C#, C/C++ and Bash.
01
Watch
Read each conversation: files read and edited, test runs, pass or fail.
02
Learn
Failing run, model edit, same run passing: a verified fix, compiled into a capability.
03
Transfer
Same kind of failure again: Relay reads the code, writes the fix, re-runs the test.
04
Fail safe
Re-run fails: the model takes over with the failure in context.
When a later conversation reaches a failure Relay has a capability for, Relay acts for the model. It reads the failing code, writes the fix with the agent's own edit tool, and re-runs the same test, all as ordinary tool calls in the agent's loop. It never touches your machine directly; your agent executes every step, and your tests are the judge.
Two rules keep this honest:
- Learn only from the model. Relay compiles fixes the model made and the tests confirmed. Fixes Relay wrote itself are never re-learned, so it cannot reinforce its own mistakes.
- Fail open. If Relay's re-run fails, the model takes over with the failure already in context. Repeated failures pause that capability, and any Relay error is treated as a miss, so your agent's normal path always runs.
What we measured
Replay: 150 real agent tasks
We recorded a real agent working through 50 bug-fixing tasks with three different models, then streamed those tasks through the gateway in arrival order, starting from an empty library. Each task is a real agent loop with real files and real test runs: run the tests, read the source, write the fix, re-run.
Model wrote the fix (7)Relay wrote the fix (43)
The model pays for the first fix of each kind. After that, Relay handles the repeats. Across all three models, 42 to 43 of 50 tasks were fixed by Relay, all 50 were solved, and none of Relay's fixes failed and fell back to the model.
Saved by Relay, recorded real-agent stream (50 tasks per model)
| Model | Model calls | Tokens |
|---|---|---|
| GPT | 70.4% | 69.6% |
| Gemini | 71.6% | 69.5% |
| Open-weight | 71.6% | 71.8% |
Live: a real model behind Relay
The replay reuses recorded answers, so we also put a live model, gpt-oss-120b on
Groq, behind Relay in a real agent loop on 12 small Python and JavaScript
tasks. Every step was the model's own decision. We ran each task twice: once
with Relay active, and once in shadow mode, where Relay never changes a
response, as the model-only baseline.
Live run, 12 tasks: model calls
| Without Relay | |
|---|---|
| With Relay |
Real code: Claude Code and Codex
The numbers above are from the gateway. Since launch we have also built the Relay CLI, a terminal agent that runs on your installed, unmodified Claude Code or Codex, signed in with your own plan. Relay never sees those credentials, and your code never leaves your machine.
Before handing a task to your agent, the CLI tries a cheaper route. Renames are done with no model at all. A change with a failing check first goes to one call on a small model (Claude Haiku, or Codex's fast model) with only the files that matter and how similar tasks were done before in the project. That edit is kept only if the failing check turns green and nothing else breaks. Otherwise the workspace is restored exactly and your agent does the task as usual.
We measured it on real code: Relay's own repository.
- Planted bugs. 17 realistic one-line bugs (a flipped comparison, an
off-by-one,
&&for||), each kept only if the repo's real tests catch it. - Real bugs. 9 bugs that actually happened while building Relay, put back over their fixes, each caught by the regression test written at the time.
Each task ran in a fresh copy of the repo, once through Relay and once with the agent alone. A task counts as solved only if the named test passes and a hidden check, every test file in the package, still passes.
Saved by the Relay CLI on Relay's own codebase
| Benchmark | Cost | Tokens |
|---|---|---|
| 17 planted bugs, Claude Code | 80.5% | 62.5% |
| 9 real bugs, Claude Code | 70.3% | 55.1% |
| 9 real bugs, Codex | — | 54.7% |
The small-model fast path finished 15 of the 17 planted bugs and 7 of the 9 real ones on Claude Code; the rest fell through to the full agent. With Relay, every task passed its visible test and the hidden check, on both agents. The Codex agent alone left one of the nine real bugs unsolved.
Safe by default
Relay is built for teams that cannot afford a clever gateway breaking their agents:
- Shadow mode first. Point your traffic at Relay and it only records what it would have done. Nothing is served, and shadow decisions are free.
- Yours only. Capabilities learned in a project are only ever used in that project.
- Reversible. Every promotion is logged. Retire one capability, or stop everything, in a click.
- Pay per verified fix. Relay never resells model tokens. You pay only when Relay delivered a fix and the re-run tests passed. Misses cost nothing.
Join the beta
We are onboarding a handful of teams running coding agents in production, in
small batches so we can watch every rollout closely. The path is three steps:
point your base_url at Relay, run in shadow mode, then switch to active when
the numbers make sense.
The CLI is in the same private beta and installs in one line with an invite.
Read more about Relay, or get in touch to join the waitlist.



