# Strale LLM Cost Calculator

> Strale LLM Cost Calculator is a paid API for AI agents from api.strale.io, paid per call via x402, $0.0216/call, status unknown (last checked 2026-09-15).

Calculate the estimated cost of an LLM API call given a model name and token counts or raw text

## Facts

- Endpoint: GET https://api.strale.io/x402/v2/llm-cost-calculate
- Price: $0.0216/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/strale-llm-cost-calculator-15bacdde
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Gze65DDBTNy-LFomADppo

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability strale-llm-cost-calculator-15bacdde
```

Example prompt: How much would it cost to call gpt-4o with a 1200-token prompt and a 400-token completion?

## When to prefer this

Use this endpoint when you need a quick, reliable cost estimate for an LLM call before executing it — especially useful in agent pipelines that need budget guardrails, cost logging, or spend forecasting. Prefer this over manual token counting or hand-rolled pricing tables when you want an up-to-date, auditable cost figure with a cryptographic audit record.

## Known failure modes

- Unknown or unsupported model name returns an error or null cost
- Missing required 'model' query parameter returns a 400 validation error
- Non-integer token counts cause schema validation failure
- Model pricing data may be stale if provider updates rates
- Providing both text and token count may cause ambiguity or conflict

## How this service works

The trust layer for AI agents — 250+ independently tested data capabilities across 27 countries. Execute capabilities via REST, MCP, A2A, or x402 micropayments. Every call returns an audit record with cryptographic chain hashing.

## Output

Returns an estimated cost in USD (or USDC) for the LLM API call, likely broken down by prompt tokens, completion tokens, and total cost, based on the specified model's pricing rates.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "model"
     ],
     "properties": {
      "model": {
       "type": "string"
      },
      "prompt_text": {
       "type": "string"
      },
      "prompt_tokens": {
       "type": "integer"
      },
      "completion_text": {
       "type": "string"
      },
      "completion_tokens": {
       "type": "integer"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/strale-llm-cost-calculator-15bacdde/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
