Cost of a call
A call has two costs, its tool's price, paid by the caller, and what its run used, paid by the service's owner. crab call prints what each run cost to run.
crab call notes echo '{"query": "hi"}'Two costs
- Price. A tool's price is set in its
crab.toml, the same for every call, and paid from the calling account's credit. The service's owner and its org's members pay none. See Priced calls. - Cost to run. What the run used, at the rates on Pricing, paid by the service's owner: one run, CPU time past the run's first 100µs, rows read, rows written and memory held.
crab ratesprints the rates.
Every cost to run, here and on crabtalk.ai, is before the plan's included amounts. What the plan covered is on the account's Usage page; see Plans.
Before a call
crab bench measures a local WebAssembly workload repeatedly and estimates its execution cost before deployment. HTTP fixtures can include response delays to account for memory held while waiting.
crab callprints what the run used and what it cost to run, at the rates of the context's Cloud. On the local host,crab dev, that is crabtalk.ai's. Call a tool with the inputs you expect, and multiply by the calls you expect.- CPU time stays close for the same inputs. Rows read grow with the data a query reads; the SQL API returns read and write counts. Memory held grows with the time a call waits on fetches and on other services.
crab budget <service> <tool>prints what a typical and the slowest run of the last 30 days used and cost to run, memory held included, from its first run that ended done. From 100 runs it prints the 99th percentile in place of the slowest.crab inspect <service>prints each public tool's price and budget, and what a typical and the slowest run cost to run. Anyone may read it. Search in MCP answers each tool's price.crab inspectandcrab budgetalso print the most one run of a tool costs to run: its whole budget of CPU, rows read and rows written spent, and its memory budget held until the node stops the call. At the default budget that is about $0.013. Its calls to other services count against their own budgets, and are left out.
The fits line from crab budget is a usage-based suggestion; it does not check host ceilings. Choosing a deployable budget: Budgets.
The CrabTalk and Cloudflare index-cost example shows how a read/write tradeoff changes before and after row allowances. Substitute your measured counters and the account’s remaining allowances; row charges alone do not give the whole bill.
Capping it
- A key spends at most its daily budget on prices, $5 a UTC day unless an owner sets another. A call past it is refused with E0010. See Keys.
- A tool's budget caps the CPU time, rows and memory one call of it uses.
berm_lang::limitlowers it for one call.
After a call
crab calls <service>prints each call of the last 30 days with what it cost to run.crab cost <service>prints what a service cost in a UTC month, by resource.crab usageprints the prices the account paid this period, by service and tool.
See Monitoring.