AI Foundry
Mainnet compute is disabled pending safety review. Compute testing is limited to Base Sepolia. Do not send mainnet funds for compute.

C4 micro VMs

A Linux box,
rented by
the second.

C4 micro VMs with their own kernel and a filesystem that survives between calls. For your agent, or for you. Pay from a wallet — no signup, no dashboard, no API key.

Example meter · standard-2 running
$0.000000
Example charge · 0:00 elapsed
compute · 1 billed seconds$0.030106
total$0.090290

Illustration of compute billing, rounded up to whole seconds. This is not a running session.

Compute billed by the second

Compute rates include a 40% markup. Jobs are bounded by your prepaid credit.

Compute · per second

TierPer minPer second
container$0.00301$0.000050176

Execution time rounds up to a whole second, then up to a micro-dollar. No ten-minute minimum.

Model rate reference · not yet enabled

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

C4 micro VMs

Each C4 runs its own kernel — a real virtual machine, not a shared-kernel container. Pick a size, pay from a wallet, get a Linux box with a filesystem that survives between calls. Billed by the second; it sleeps when idle and billing stops when it does.

loading sizes…
Linux 6.18 · Node 22 · Python 3.13 · git · ripgrep · build-essential — preinstalled, so you are not billed for an apt install on every job.
1 hour Maximum per call, shortened when prepaid credit would run out
45 s Idle before it sleeps. Sleeping is not dying: billing stops, your files stay
persistent Your filesystem persists between jobs — it lives outside the VM, so sleep does not touch it
1 job At a time per wallet. Retry overlapping requests after the active job finishes.

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": "container"}'

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":"container-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.

Safety is not optional here

Wallet-scoped workspaces, bounded execution, and allowlisted outbound requests.

Each workspace belongs to the verified paying wallet. Outbound HTTP requests use a host allowlist, with private and metadata addresses blocked. Commands have a timeout and must fit within prepaid credit. Model generation is not exposed by this API.