Blogs / Product

The OpenAI Agents API, on a harness that spends fewer tokens

We deleted our SDK for a standard API, then made everything underneath it cheaper. Here is what we learned.

14 min readAgentsProductPerformance
Same model, same tasksagents api
The same 48 attempts on the same model: 1.86M tokens through Claude Code against 384K through the Orca harness

Until this month, using Orca meant learning our SDK. Not anymore. Your app now talks to Orca through the OpenAI Agents API: the official openai package, pointed at our URL. Behind it, every session runs on our own harness. In our latest benchmark, it used 4.8x fewer tokens than Claude Code on the same model. Here is what we learned getting here.

The shape of it

A standard on top. Everything we compete on underneath.

Orca rests on two bets. First, an agent platform's interface should be a standard nobody has to learn. So we speak the OpenAI Agents API, and nothing else. Second, once every provider looks the same from above, they can only compete below. That is where we put the work.

Figure 01 / the stackOrca architecture
INTERFACE AND INFRASTRUCTURESame request everywhere. Different bill underneath.your app, with the official openai packageTHE INTERFACE · ONE LINE TO CHANGEOpenAI Agents API /v1 the same at every providerharnesstokens per task,answers rightmeteringwhat each call cost,checked every dayretrieswhat a failurecosts your usersandboxesmachine time, onlywhen work needs itUNDERNEATH, ON ORCA · WHERE PROVIDERS DIFFER
Above the line, Orca is identical to any provider of the same API, so moving costs one line. Below it is everything we built, and where your bill and your reliability come from.
Lesson one

The model sets the price. The harness sets the bill.

For a business, the harness matters more than the model. A model's price per token is public and the same for everyone. Your bill is that price times the tokens. The harness decides the tokens: tool schemas re-read every turn, raw tool output dragged along, the same file read twice. None of that is intelligence. All of it is billed like intelligence.

So we measured it. Four harnesses, one model (claude-haiku-4.5 via OpenRouter), the same 16 tasks run 3 times each, the same limits. Orcacode, our terminal agent, runs on the same harness as every Orca session.

Figure 02 / 48 attempts eachRun 20260926T131127Z · 26 Sep 2026
CORRECT, OF 48orcacode42pi41omp41claude code30TIMEOUTSorcacode0pi3omp0claude code7TOTAL TOKENS, THOUSANDSorcacode384pi779omp877claude code1856NORMALIZED COST, USDorcacode$0.44pi$0.67omp$0.84claude code$1.33
Each panel keeps its own scale, so bars compare within a panel and never across one. Cost is normalized from the run's price schedule: a comparison, not an invoice.
384Kour harness (claude code 1.86M)
4.8xfewer tokens, same model
42/48correct (claude code 30)
0timeouts (claude code 7)

Same model, same price per token: 4.8x fewer tokens, and more answers right. At scale, that ratio becomes a line on the invoice.

Figure 03 / 10,000 tasksScaled from run 20260926T131127Z
MODEL SPEND PER 10,000 TASKS, USDorcacode$92pi$140omp$175claude code$277
The run's normalized cost per attempt, times 10,000. Same model and same price per token on every row; only the harness changes.

$185 saved per 10,000 tasks, before any machine is involved. A cheaper model gets cheaper for everyone at once. A wasteful harness keeps wasting at the new price, on every turn. How ours avoids it is in the harness deep dive. The caveat stays next to the number: one small model, a synthetic suite, and Claude Code under our caps, not its own defaults.

Lesson two

A harness small enough to disappear into the server.

Tokens are the big bill. Keeping the harness running is the second. Most harnesses ship as a CLI, one process per session. Anthropic's hosting guide for its Agent SDK says so: "One agent session maps to one subprocess." It suggests 1 GiB of RAM and a CPU per agent to start.

Ours is a Rust library inside one server process. Every session is a task in that process, subagents included. A sandbox is attached only when the session asks for one, or its tools need one.

Figure 04 / where the harness runsorca-agent-server · footprint table
WHERE THE HARNESS RUNSOne process for every session. Machines only for work.A CLI HARNESS, HOSTED PER SESSIONcontainer, session 1456 MBthe workcontainer, session 2456 MBthe workcontainer, session 3456 MBthe workidle harness, before its first tool call,in every session you keep openORCAthe server: one Rust processa square is a session; white ones have a sandboxsandbox, 2 GiB17 MB broker,the rest for the worksandbox, 2 GiB17 MB broker,the rest for the worka session that only talks, searchesand calls APIs gets no machine at all
Left, to scale: Claude Code's 456 MB idle footprint on a 2 GiB machine, in every session. Right: sessions are tasks in one process; inside a sandbox, the only thing of ours is a 17 MB broker.

That is why we picked Rust, and not only for speed. Every customer's sessions share one process, so they must not trample each other's memory. In Rust, data races are compile errors, not production incidents. The Rust book calls it fearless concurrency. Tasks are cheap, too: in the harness stress suite, one process held 131,072 concurrent subagents and finished 1,444,844 calls with zero failures. That suite uses a fake instant model, so it measures only the scheduler (deep dive).

Figure 05 / a 2 GiB sandboxorca-harness footprint table
IDLE HARNESS MEMORY INSIDE A 2 GIB SANDBOXclaude code456 MB, 22%omp406 MB, 20%codex340 MB, 17%pi211 MB, 10%orca session17 MB, 1%: a broker, not the harness
Idle CLI harness memory (footprint table, measured on a Mac) as a share of a 1 vCPU, 2 GiB sandbox. On Orca the harness stays in the server; the 17 MB is our command broker, measured in our sandbox image.

In dollars: a session that only talks, searches and calls APIs uses no machine time at all. A session with a sandbox gets all of it but 17 MB. The same guide puts a minimal container at about $0.05 an hour. A container for each of 1,000 open sessions is about $50 an hour, before a single token. Where our harness runs as a program, it stays small: Orcacode 0.7.0 is a 6.5 MB binary that idles at about 26 MB (footprint table).

Lesson three

We deleted our own SDK for a standard.

Until this month we shipped our own SDKs in TypeScript, Python and Go. They worked. They were also a second vocabulary: our nouns (profiles, pools, runs, workflows), code that only ran against us, and a migration the day you left. A proprietary agent SDK is a tax. You pay it in learning, again in lock-in, and again on the way out.

Models got one standard API. Agents are next.

We had seen this before. OpenAI shipped Chat Completions in March 2023 as one company's endpoint. Today OpenRouter, Groq, DeepSeek, Ollama and vLLM all speak it, and so do Google and Anthropic for their own models. Nobody voted. Developers had code written against that shape, and vendors followed the code.

Figure 06 / the precedentVendor docs, linked above
THE PRECEDENTVendors followed the code once. They will again.MODELS, FROM 2023/v1/chat/completionsOpenAIOpenRouterGroqDeepSeekOllamavLLMGoogle GeminiAnthropicAGENTS, FROM 2026/v1/agentsOpenAIOrcanext
One request shape, adopted by every kind of provider: aggregators, inference clouds, local runtimes and rival labs. The agent shape is at the start of the same curve, and Orca is on it.

We believe agents go the same way. The OpenAI Agents API entered public beta on 10 September 2026. It has the nouns a production agent needs: agents, sessions, turns, events, files, skills, environments. It ships in the openai clients people already have. Every month of code written against it makes any other shape harder to adopt.

Even OpenAI's guide says its Agents API runs on "a managed Codex harness". The API is how you reach an agent. The harness is what you pay for. That is exactly where we want to compete.

One interface helps everyone except vendors counting on lock-in. Tracing, evals and gateways work against every implementation, and your team and your coding agent already know the openai package. So we rebuilt our server as that API. The official clients talk to it unchanged, checked against Python openai 3.13.0 and TypeScript openai 7.15.0. Nothing of ours lives inside /v1, so nothing of ours can break your code.

Moving in

One line in, one line out.

Pythonpython
import os
from openai import OpenAI


client = OpenAI(
    base_url="https://api.orcapods.ai/v1",  # the one line
    api_key=os.environ["ORCA_API_KEY"],     # an Orca key, not an OpenAI key
)
agents = client.beta.agents
TypeScripttypescript
import OpenAI from 'openai'


const client = new OpenAI({
  baseURL: 'https://api.orcapods.ai/v1', // the one line
  apiKey: process.env.ORCA_API_KEY,      // an Orca key, not an OpenAI key
})
const agents = client.beta.agents

That is the whole integration: our URL, and an Orca key where the OpenAI key was. Your agents, sessions and streaming code stay as they are:

Stream one turnpython
session = agents.sessions.create(agent_id=scout.id, environment={"type": "none"})


with agents.sessions.stream(session.id, input="What is the latest Node.js LTS release?") as stream:
    for event in stream:
        if event.type == "agent.session.turn.output_text.delta":
            print(event.delta, end="", flush=True)

Leaving is the same edit in reverse. Your agents are plain Agents API objects, so they recreate anywhere that speaks the API. We think that is the only honest way to sell infrastructure. If we stop being the best place for your agents, leaving should cost one line, not a quarter.

Lesson four

Small misses add up.

Lose a tenth of a cent per call and nobody notices on one session. At 100,000 calls a day, it is $100 a day. So we treat cost like the answer: recorded exactly, and checked.

Figure 07 / meteringorca-agent-server
METERINGEvery call is a row. Every day is checked.model callits cost, as OpenRouterreports itusage rowmicro-dollars, rounded up,four token classesyour usageper session, agentor modelsum of rowsOpenRouterwhat our key spentthat daydaily checkcompare thetwo sumsalertwhen they driftmore than $0.10
Every call is a row; every day the rows are checked against what the provider says our key spent.

Every model call writes its own row. Its cost is what OpenRouter reported for that call, in micro-dollars, rounded up, plus the credit fee. Its tokens are split four ways: uncached input, cache reads, cache writes and output. Read it per session, agent or model with orca usage --group-by or the usage API. Once a day, a job checks OpenRouter's total for our key against our rows, and alerts us past ten cents of drift.

Here is one real session, read back from Claude Code through the MCP server:

Figure 08 / one real sessionClaude Code · orca mcp serve
Claude Code reports a margin-check session cost $0.004528, 4,528 micro-USD, on one model call, with 2,555 cached input tokens, 3 uncached, 3,532 output and 2,588 reasoning tokens
The cost is the server's own figure for the session, to the micro-dollar, with its tokens split by class. Nothing was estimated.

That precision is how we caught our own misses:

  • A web search cancelled mid-flight left no usage row. Fixed.
  • One micro-dollar of rounding per call would have tripped the alert at 100,000 calls a day. The check now allows for it.
  • The harness counted cache writes as input tokens, one extra per turn. Fixed in September.

One rule we keep on purpose: if a call ends before its cost is reported, because you cancelled it, the stream was cut or our server restarted, we charge it later from OpenRouter's own record of that call, usually within minutes, and never from an estimate. On Orca credit, tokens cost OpenRouter's price plus their fee, with no markup from us. On your own provider key, we charge nothing for tokens. Every number is on the pricing page.

Lesson five

When a call fails, your user should not have to know.

Providers fail all the time: rate limits, 5xx errors, cut streams, calls that go silent. Retrying everything is easy. We classify first, because a retry only helps when a second try can change the answer.

Figure 09 / failuresorca-agent-server · reliability guide
FAILURESClassify first. Retry only what can change.a model call failstransient408, 429, 5xx, a cut stream,10 minutes of silenceretry, up to 4 times0.5 s doubling to 30 s,never before Retry-Afterthe same turn continuespermanent400, 401, 403, 404the turn failswith that error's own codeour server restartsin the middle of a turnthe turn is marked failedno action replayed; say continue
Transient failures retry up to 4 times in a row and continue the same turn with its transcript. Permanent ones stop at once. A restart never replays a side effect.

A retry continues the same turn, transcript intact, so your user sees one answer. Malformed tool arguments go back to the model as a correction. Each attempt is billed once, at what the provider reported. Your own retries are safe too: an Idempotency-Key returns the original result, and Last-Event-ID resumes a dropped stream (reliability guide).

What we never do is replay side effects. If our server restarts mid-turn, the turn is marked failed and its actions are not rerun. We would rather report a failed turn than send an email twice. Say "continue" and the session picks up. And we never switch your model, or who pays, to get past a failure.

Shipping

From an idea, to an agent, to production.

An agent is a model, its instructions and its tools. No loop to write, no history to store. The fastest start is copying one that works:

Ten minutesplain
curl -fsSL https://orcapods.ai/install.sh | sh
orca login
orca kits copy https://app.orcapods.ai/kits/kit-tdCEUXGA3NbuIWJJ6
orca chat scout "What's new in the latest Python release? Cite your sources."
orca chat scout --sandbox "Chart the last five Python releases into /workspace/outputs"

That copies Scout, a research agent that cites its sources, and gives it a sandbox. orca kits copy prints what the kit holds, then asks y/N before it copies anything. Shared agents are kits: a link anyone can copy an agent from. For production, put the streaming snippet above in your service with a key from orca keys create. The CLI and your app call the same API, so nothing changes in between. Full walkthrough: start here.

Tuning

Let your coding agent tune your agent.

Tuning an agent is a loop: run it on real inputs, read what happened and what it cost, edit the instructions, run again. That is reading and editing text, which coding agents do best. So the orca CLI ships an MCP server:

Add the MCP serverplain
claude mcp add orca -- orca mcp serve     # Claude Code
codex mcp add orca -- orca mcp serve      # Codex
# Cursor: "orca": { "command": "orca", "args": ["mcp", "serve"] } in ~/.cursor/mcp.json
Figure 10 / the looporca mcp serve
TUNINGThe loop that makes an agent good, driven for you.3. edit the instructions, then run againyour coding agentClaude Code, Codexor Cursororca mcp servea tool per CLI actionyour agentreal sessions,transcripts, cost1. run1. run2. read the transcripts and what each session costevery step is a real session you can open afterwards
Every step is a real session on Orca that you can open afterwards.

It has a tool for every CLI action: agents, chats, sessions, artifacts, usage, the wallet and kits. Here is a real run. We asked Claude Code to make Margin Check's answers shorter without changing a rule or a number, and to prove it with a before and after.

Figure 11 / a real tuning runClaude Code · orca mcp serve
Claude Code reruns the three questions, finds a Brightline counter-offer drifted to 17.5 percent, under the margin floor, tightens the instructions, and runs the deal a second time because one run could be luckBefore and after table: answers about 85 percent shorter and cheaper, but a repeat Brightline run named VP Sales instead of the CFO and Elmwood counter-offer margins were wrong; the agent is back on its original instructions, with two safe options offered
Claude Code changed only the answer format, checked by diff, and ran every question again. A repeat run caught a wrong approver, so it put the original instructions back.

The short answers were about 85% shorter and 40 to 70% cheaper. Then Claude Code ran one deal a second time, because one run could be luck, and the short answer named the wrong approver. It traced why: with no working table to write out, the model reasoned about half as much. It put the original instructions back and offered two safe ways to get short answers. That is the loop doing its job. The regression was caught in a tuning session, not by a customer.

Figure 12 / cleaning upClaude Code · orca mcp serve
Claude Code deletes the margin-check agent and its three sessions from the Orca organization after saving a backup of the agent definition
Asked to delete the agent, Claude Code saved a copy of its definition first, then removed the agent and its three sessions, and checked they were gone.
The pattern

Business logic behind an agent, used from any coding agent.

Put business logic in an agent: its rules, its data and credentials to your systems. Then let people reach it from the coding agent they already use. A developer in Claude Code asks Margin Check, our sample pricing agent, what a contract change does to margin. Only the answer comes back through chat. The rules and the data behind it stay inside the agent, and the credentials never leave Orca.

Get it into your organization from the CLI, or by asking your coding agent:

Figure 13 / two ways to copyorca CLI · Claude Code
orca kits copy with the Margin Check kit link copies one asset, the margin-check agentIn Claude Code, asked to copy the Margin Check kit by its link, the coding agent copies it and explains it is sample data on Orca credit with no sandbox needed
The same published kit, copied with one command or one sentence. Either way it lands as an ordinary agent in your organization.

Here is that exchange, unedited:

Figure 14 / the real exchangeClaude Code · Margin Check
In Claude Code, the margin-check agent answers that one free month for Elmwood Labs is allowed with VP Sales approval, with a table of its working: 76.7 percent gross margin and an 18.3 percent total discountThe counter-offers, 10 percent for a rep at 78.2 percent margin and 15 percent for a sales manager at 77.3 percent, and Claude Code noting it redid the arithmetic and it is correct
The verdict first, then every figure with its working, so anyone can check it. Claude Code redid the arithmetic on its own and found it correct.
Figure 15 / the boundarycredentials guide
BUSINESS LOGIC BEHIND AN AGENTThe answer crosses over. The credentials do not.ON ORCAa questionthe answera developerin Claude Code, throughthe MCP chat toolMargin Check agentinstructions: pricing rules,price list, policy, contractsvaultthe model never sees a credential;the API never returns oneyour systemsCRM, billingcredentials never cross
A credential in a vault is used by the agent's tools; the model never sees it and the API never returns it once stored. The coding agent works with the answer.

That is Orca. The interface everyone already uses, as easy to leave as to join. Underneath it, every reason to stay. Fewer tokens for the same work. A harness small enough to disappear. Cost you can audit to the micro-dollar. Failures your users never see. We think every agent platform ends up here. We would rather be there first. Start here takes about ten minutes.

Source and measurement note

Benchmark: orca-harness run 20260926T131127Z, 16 tasks over a synthetic project, 3 repetitions, 48 attempts per harness, anthropic/claude-haiku-4.5 through OpenRouter at low reasoning effort, a 45 second limit per attempt; Orcacode 0.7.0 and Claude Code 2.1.280 under the same caps. Cost is normalized from the run's price schedule, a comparison and not an invoice; the per 10,000 task figures scale it linearly. Idle memory is the footprint table in the orca-harness README (idle RSS, core CLI only, measured on a Mac); the 17 MB broker was measured idle inside our sandbox image on 16 October 2026. Container sizing and price are from Anthropic's Agent SDK hosting guide. Server behaviour (sessions as tasks in one process, retries, idempotency, metering, the daily reconciliation) was read from the orca-agent-server source and README on 16 October 2026, and is documented publicly in the reliability guide, the wallet and usage docs and the API reference. Prices are on the pricing page; we quote none here.

Run the execution plane

Build the agent. Orca handles the infrastructure.

Start with one agent: a model, instructions, tools and skills. One call runs it, and Orca does the rest.

Sign up