AI Foundry

Metered compute for agents

Your agent needs
a terminal. Rent one
by the minute.

A durable Linux workspace with a shell, a filesystem that survives between calls, and network access to the APIs you use. Pay with a wallet over x402 — no signup, no dashboard, no API key.

Live meter · standard-2 running
$0.000000
Billed this session · 0:00 elapsed
compute · 10 min minimum$0.030106
tokens · gpt-oss-120b$0.038000
safety · llama-guard-3-8b$0.008184
storage · 50 MB month$0.014000
total$0.090290

A real session bills like this. The sandbox sleeps 45 seconds after its last command, and billing stops when it does.

Every line metered separately

Each item is marked up 40% on its own cost. You are not subsidising anyone else's model choice — a job on a cheap model is billed cheaply.

Compute · per minute

TierPer min10-min min
isolate$0.00065$0.0065
container$0.00301$0.0301

Billed on awake minutes, not wall-clock. Storage is $0.28 per GB-month.

Model tokens · per million

ModelInOut
llama-3.1-8b-fp8$0.063$0.538
glm-5.3-flash$0.210$0.700
gpt-oss-120b$0.490$1.050
llama-3.3-70b-fp8$0.410$3.154
kimi-k2.7-code$1.330$5.600
llama-guard-3-8b$0.678$0.042

Two tiers, one filesystem

Switch between them against the same files. Most agent work never needs the container.

isolate $0.00065 / min

A V8 isolate with a POSIX-ish shell. Starts in about five milliseconds, so there is nothing to wait for and no idle instance to pay for.

shellcurl, jq, grep, awk, sed
resources0.25 vCPU · 1 GiB
cold start~5 ms
best forAPI work, data, text
container $0.00301 / min

Real Debian with a real kernel. Install packages, compile things, run native binaries. Warm capacity scales with demand and drains to zero when idle.

runtimeNode 22, Python 3, git
resources1 vCPU · 6 GiB · 12 GB
cold startseconds, usually warm
best forbuilds, tests, native

Three calls from nothing to running code

An unpaid request returns the payment terms. Pay it with any x402 client and keep going.

api.aifoundry.sh
# 1 · ask for a session
$ curl -X POST https://api.aifoundry.sh/v1/session \
    -d '{"credit_usd": 5, "tier": "isolate"}'

HTTP/1.1 402 Payment Required
{ "accepts": [{ "network": "eip155:8453",
               "asset": "USDC", "amount": "5000000" }] }

# 2 · pay it, retry, keep the token
$ export TOKEN=$(x402 pay --url .../v1/session | jq -r .token)

# 3 · run something
$ curl -X POST https://api.aifoundry.sh/v1/compute/run \
    -H "authorization: Bearer $TOKEN" \
    -d '{"backend":"worker-shell",
         "source":"curl -s https://api.github.com/zen"}'

{ "stdout": "Design for failure.",
  "exit_code": 0,
  "charged": { "total_usd": 0.0065 },
  "balance_usd": 4.9935 }
Built on Cloudflare Computer, which is preview software — good for real work, not yet for something you would page an engineer about at 3am. Every charge is itemised at /v1/account and the arithmetic matches the table above.

Bounded on purpose

Limits are enforced in the runtime, not promised in a document.

10 minHard cap per job — wall-clock and CPU both
100kAI tokens per session, then refresh free
10 GBDurable workspace, persists between calls
45 sIdle sandboxes sleep and stop billing
Every model call is screened both ways by Llama Guard and fails closed. That is not decoration: tool output becomes model input, so a page your agent fetches can carry a prompt injection. Screening the return path is what stops it becoming instructions.