Back to blog

Cost optimizationBreakdown

Budget a long agent project: compute vs tokens (RSA-260 case)

The $400k RSA-260 headline is GPU rental, not model tokens. Split a long agent project into three budget lines and size the token part with sessions × steps × tokens.

By CheapTokens TeamPublished 6 min read

Cover: where the money goes in a long agent project — GPU compute, model tokens, human steering
On this page
  1. What the $400k actually pays for
  2. What the agents did, and what the report doesn't say
  3. The third line: human steering
  4. Estimate your token line
  5. Get your own numbers in ten minutes
  6. Narrow the task before you raise the budget

That ~$400k figure from Cognition's RSA-260 factoring is GPU rental, not a model bill. The report doesn't price the agent side at all, so if you plan a long agent project, you estimate the token line yourself: sessions × steps × tokens per step, on live prices. That's what the rest of this page does.

The source is Cognition's write-up by Eric Lu, an engineer at Cognition (Factoring RSA-260, published 9 September 2026, checked 6 November 2026). It's being re-shared with the dollar figure in the headline, and the figure is easy to misread.

What the $400k actually pays for#

The author factored a 260-digit number with GNFS, using a heavily modified CADO-NFS that runs on GPUs. The report gives GPU time for each phase:

  • polynomial selection: 643 GPU-days
  • sieving: 3,813 GPU-days
  • linear system solving: 467 GPU-days

That's 643 + 3,813 + 467 = 4,923 GPU-days, which the report rounds to ~4,900. At the report's assumed $3.50 per GPU-hour:

4,923 × 24 × 3.50 = 413,532

That matches the $414k GPU figure in its appendix. So the headline is rented hardware running a number-crunching job for weeks. No model tokens are in that sum.

Key numbers from the report: 4,923 GPU-days, 233 sessions, up to 18 parallel sessions, 3,328 messages
Numbers from Cognition's RSA-260 report, 9 September 2026

Quick check

What is the ~$400k figure in the RSA-260 report?

Show answer

Answer: Market-rate rental of GPUs for the factoring run

It comes from GPU-days × $3.50 per GPU-hour. The report names no models and gives no token counts for the agent part.

What the agents did, and what the report doesn't say#

The agent side is described by activity, not by cost. The first prompt went out on 13 August 2026, the work took about three weeks, and the numbers are:

  • 233 Devin sessions for the factoring, on average 3 running in parallel and 18 at the peak
  • 192 of them got messages from the author, 36 ran with no human intervention at all
  • 101 child sessions were started by other sessions
  • Devin's own accounting: 14,450 ACUs (that's Devin's unit, not tokens)

The sessions handled measurement, cluster operations, tuning and debugging. The human set priorities and built the benchmarks. Two honest details from the author: the decomposition around CADO-NFS was designed by a person and was essential, and the agents got more confused the further the code drifted from upstream.

What's missing is exactly what a budget needs: which models, how many tokens. So don't try to back out a token bill from 14,450 ACUs. Anything you read online that does is a guess.

The third line: human steering#

The author sent 3,328 messages, 82,702 words in total. That's 82,702 ÷ 3,328 ≈ 25 words per message, short nudges rather than essays. Those words cost almost nothing in tokens. They cost attention: someone has to read what the agents did and decide what's next. When you budget an agent project, put that on its own line in hours, not dollars of API usage.

So a long agent project has three lines:

Line In the RSA-260 report What sets it for you
Compute ~$414k of GPU time, priced at $3.50 per GPU-hour Your job itself: builds, tests, training, simulations
Model tokens Not reported Sessions × steps × tokens per step
Human steering 3,328 messages over ~3 weeks How often you review and redirect

Estimate your token line#

Here's the formula, and the one thing people forget: every step re-sends the history. An agent doesn't remember a session; each call carries the task, the files it read and the tool output so far. That's why input tokens usually dwarf output tokens (more on that in why AI agents use so many tokens).

Budget formula flow: sessions, steps per session, tokens per step
The token line of an agent budget

Say you plan a project the size of Cognition's, 233 sessions, and you assume 60 steps per session. These two numbers are assumptions of this page, not Cognition data. Then:

233 × 60 = 13,980

that's 13,980 model calls. Now the size of one call. Suppose an average step sends 60,000 tokens in (task, history, a file or two) and gets 1,500 tokens back (a command or a patch). Totals:

60,000 × 13,980 = 838,800,000

1,500 × 13,980 = 20,970,000

So about 839M input tokens and 21M output tokens. Input is forty times the output, and that's the side where your budget lives. On DeepSeek-V4-Flash that project costs $14.68, and one session of 60 steps is $0.063. Here is the same load on every model, with the OpenRouter reference next to it:

Model Per request 13,980 requests OpenRouter, 13,980 requests
GLM-5.3-Flash $0.0013 $17.61 $29.84
DeepSeek-V4-Flash $0.0011 $14.68 $61.65
MiniMax-M2.7 $0.0032 $45.09 $541.03

60,000 input and 1,500 output tokens per request. Prices per 1M tokens are current and change together with our tariffs; the OpenRouter column shows reference prices for the same workload.

Counted in total, with input and output together, each of our models comes out cheaper than OpenRouter for this load. Prices are live from the pricing page, so the table moves when tariffs do.

Try it yourselfTry it: the 60-step session averages 60,000 tokens in. Does step 1 send as much as step 60?Show answer

No. Step 1 sends little (the task and a few files), step 60 re-sends everything gathered along the way. Taking 60,000 as an average assumes the session starts small and ends near 100K or more. If you know your sessions end at, say, 120K, the average is about half of that, so measure the largest request, not only the average.

Get your own numbers in ten minutes#

Assumptions are only a starting point. Run one real session of your task on a cheap model and read the usage object the API returns on every response. OpenAI-compatible endpoints report prompt_tokens and completion_tokens per call:

bash
curl https://api.cheaptokens.dev/v1/chat/completions \
  -H "Authorization: Bearer $CHEAPTOKENS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek-ai/DeepSeek-V4-Flash-0731", "max_tokens": 1500, "messages": [{"role": "user", "content": "Summarize this test failure and propose a fix: ..."}]}'

Sum usage over the whole session, divide by the number of calls, and replace the 60,000 and 1,500 above with your averages. Setup details are in the CheapTokens docs; the per-step tracking in code is in track AI agent token cost in Python. For the same arithmetic on a single 50-step session, see agent session cost on GLM, DeepSeek or MiniMax.

For long loops, DeepSeek-V4-Flash has a 380K context window and up to 32,768 output tokens per answer, with one price at any hour. GLM-5.3-Flash has a 390K window and MiniMax-M2.7 has 180K, so check that your largest request fits.

Pick your case

Which project looks like yours?

Many short sessions

Small tasks, each starting fresh: the input per call stays low. Multiply sessions by steps, and expect the total to be dominated by the count of calls, not their size.

A few very long sessions

History grows through the session, so the last steps are the expensive ones. Estimate with the largest request, split the work into child sessions with a short brief each, and the input stops snowballing.

Heavy compute plus agents

Like RSA-260: the job itself needs hardware. Price the hardware per hour from your provider, and keep the token line as a separate estimate. They don't add up in your head, only in a spreadsheet.

Narrow the task before you raise the budget#

The report has one more lesson that fits a budget: the further the code drifted from upstream, the more confused the agents got. Confused agents take more steps. If your estimate looks too high, shrink steps per session first: a clearer brief, a smaller area of code, fixed steps moved into scripts (see do agents need the model at every step). Halving the steps halves the token line; that's the easiest lever you have.