Skip to content
clusters: prooflayer · edgemarket · edgefinance · synthforge · mediakit · wordmint · webprobe · locale · comppoint · rollforge · bestiary · statline · matchpoint · retail · agentops · browserworkflow · modelrouter · compose
$ man llm-cost-estimate

/llm-cost-estimate

agentutility / model-router / llm-cost-estimate
PRICE / CALL
$0.005
USDC · base mainnet · scheme: exact
METHOD
POST
CATEGORY
uncategorized
STATUS
live
NAME
llm-cost-estimate llm cost estimate api and token cost calculator for comparing inference cost across models before you run a prompt
SYNOPSIS
POST https://x402.agentutility.ai/llm-cost-estimate
     Content-Type: application/json
     X-PAYMENT:    <signed-transferWithAuthorization>

     { ... }
↳ first call → 402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.
DESCRIPTION

LLM cost estimate API and token cost calculator for comparing inference cost across models before you run a prompt. Send input_tokens and output_tokens (or raw text, auto-estimated at roughly 4 characters per token) plus a list of model names, and get a per-model price breakdown from a built-in snapshot price table, with the cheapest known model called out. Pass price_overrides to price your own negotiated rates or a model missing from the table instead of getting a guess. The table is stamped with an as_of date so you know how fresh the snapshot is. Use it as a token cost calculator, a model price compare tool, or a pre-flight budget check before an LLM run or agent workflow.

INPUTrequest schema
propertytypedescriptionreq?
input_tokensnumberNumber of input/prompt tokens. Optional if 'text' is given.optional
output_tokensnumberNumber of output/completion tokens. Optional, defaults to 0.optional
textstringRaw prompt text; used to estimate input_tokens (~chars/4) when input_tokens is not given directly. Max 500,000 chars.optional
modelsarrayModel names to estimate cost for, e.g. ['gpt-4o-mini', 'claude-sonnet-4.5']. Defaults to a small built-in comparison set. Max 30.optional
price_overridesobjectOptional per-model price overrides keyed by model name: { input_per_1m?: number, output_per_1m?: number }. Use for current pricing or models missing from the built-in table.optional
OUTPUTresponse shape
fieldtypedescription
input_tokensstring
output_tokensstring
token_sourcestring
estimatesstring
cheapest_knownstring
price_table_as_ofstring
notestring
EXAMPLEStwo ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.agentutility.ai/llm-cost-estimate \
  -H 'Content-Type: application/json' \
  -d '{ }'
first response = 402 Payment Required with payment requirements; sign + retry with X-PAYMENT.
EXAMPLE 2 · mcp
# Install the MCP package for this endpoint's cluster
npx -y @agentutility/mcp-<cluster>

# Required: EVM private key with USDC on Base
export X402_PRIVATE_KEY=0x...

# Then call the llm-cost-estimate tool from your MCP-aware agent.
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
tags
model-routerllmcostestimatellm-cost-estimate
methods
POST
cluster
modelrouter
price
$0.005 USDC per call
ADJACENTother endpoints in modelrouter
endpointdescriptionprice
model-route-recommendModel routing API that answers 'which model should I use' from plain task requirements.$0.01
SEE ALSO
agentutility · modelrouter · x402 · mcp · llms.txt · registry.json · bazaar.x402.org