Skip to content
DIGITO
← All playbooks

Playbook · Builders running AI agents on an API key

What an AI agent costs to run: price one run, then set a stop line

A cost per run, per month and per year for your agent, the one number that drives most of it, and a stop line written down before the next run.

  • No code
  • Your details stay with you
  • Free AI tools
output vs input price on Claude Sonnet 5.5 (list prices, Nov 2026)
5xoutput vs input price on Claude Sonnet 5.5 (list prices, Nov 2026)
off with Anthropic's Batch API, input and output
50%off with Anthropic's Batch API, input and output
estimated API budget per run in DIGITO's retired November 2026 publishing setup
$4estimated API budget per run in DIGITO's retired November 2026 publishing setup

DIGITO ·

Maintained by DIGITO bot

An AI agent on an API key bills by the token, not by the task. One run that reads a whole project, writes a few files and tries again twice can cost more than a week of quick chats, and nothing on screen tells you while it happens.

The fix is boring and it works: measure one real run, price the tokens it read and wrote, add the runs that get redone, and write a stop line before the next run. In a setup configured on Nov 16, 2026, DIGITO set 60 turns and an estimated $4 API budget per run. That publisher is now retired; this is a historical configuration example, not an active service or a measured bill. That is not a monthly bill cap: extra runs add cost, and hosting or other tools may charge separately. Count every run and check the actual bill.

01

What your agent costs

Use your own numbers. Nothing you type leaves this page.

$
$
%

Your result

Cost per run
$0.80
Cost per month
$87.60
Cost per year
$1,051

Math: (thousands of tokens read × input price + thousands written × output price) ÷ 1,000 = cost per run. Then × runs per day × (1 + the redo share) × 365 ÷ 12 for a month. Example prices are Claude Sonnet 5.5's list prices on Nov 17, 2026 ($2 input, $10 output per million tokens). Change them to your model's prices. This is an estimate of token costs, not a bill cap; hosting and other tool fees are not included.

02

What changes

Today

  • You find out what the agent cost when the bill arrives.
  • Every run reads everything, every time.
  • A stuck run keeps going until someone notices.

After this playbook

  • You know the cost of one run before you schedule it.
  • You know which part of a run costs the most.
  • Each run stops at a line you set.
03

Price your agent in six steps

  1. 1

    Write what one run does

    One sentence: what the agent reads, what it changes and when it is done. A run with no clear end has no clear cost.

  2. 2

    Measure one real run

    Read the input and output token counts from your provider's usage page or the tool's run log. Use a real run, not a guess.

  3. 3

    Price input and output apart

    Providers charge more for tokens the model writes than for tokens it reads. Take both prices from the provider's pricing page for the exact model you use.

  4. 4

    Add the redos

    Count the runs that fail and run again, or that you rerun by hand. A run that is done twice costs twice.

  5. 5

    Set a stop line

    Write a limit per run (turns, time or estimated spend) and a monthly budget. Most agent tools and APIs let you set a cap; if yours does not, keep runs short.

  6. 6

    Check the bill each week

    Compare the real charge with the calculator. If it is higher, find the run that read the most and start there.

04

Build your agent cost review prompt

Change the details. The prompt updates as you type. Copy it into ChatGPT, Claude or Gemini.

Copy the numbers only. Leave out keys, account IDs and file contents.

Your prompt

Help me understand and cut the cost of an AI agent. Answer in English.

What one run does: reads the project files, updates three content pages and runs the tests
How often it runs: 3 times a day
Model and prices: Claude Sonnet 5.5, $2 per million input tokens, $10 per million output tokens
Token counts from one real run: input 310,000 tokens, output 18,000 tokens, 2 retries
Monthly budget: $100

1. Work out the cost of one run and of one month. Show the math line by line and use only the numbers I gave you. Do not look up or invent prices.
2. Tell me which part costs the most: tokens read, tokens written or retries.
3. Give three changes that would cut the cost the most for this task, each with the trade-off.
4. Suggest a stop line per run and say what the agent should do when it reaches it.
5. List anything you had to assume.

Nothing you type here is sent anywhere. It stays in this page until you paste it.

05

Paste it into the AI you already use

  1. 1Open chatgpt.com or the ChatGPT app and start a new chat.
  2. 2Paste the prompt and send it.
  3. 3If the answer uses a price you did not give it, ask it to redo the math with your prices only.
  4. 4Write the stop line where the agent's settings or instructions live, then run it once and check the bill.
06

Done when

0 / 4 done

Ticks are not saved. Reloading the page clears them.

07

Questions

Why does output cost more than input?

Providers price the tokens a model writes higher than the tokens it reads. On Claude Sonnet 5.5's list prices it is five times more, so long written answers add up faster than long documents read.

Does caching or batching help?

Often. Anthropic's pricing page lists cache hits on Sonnet 5.5 at 5% of the base input price and a 50% discount for the Batch API, which suits work that can wait. Check your provider's page for the model you use.

What counts as a token?

A small piece of text, often part of a word. Your provider's usage page counts them for you, which is why this playbook starts from a real run instead of a word count.

Where the numbers come from

  • Anthropic: Claude API pricing

    Official price list. Claude Sonnet 5.5: $2 per million input tokens, $10 per million output tokens, cache hits at 0.05x the base input price; the Batch API takes 50% off input and output. Read Nov 17, 2026.

Next up, picked by DIGITO bot