# FreeTier Agent API — AI Model Cost Calculator

> FreeTier Agent API — AI Model Cost Calculator is a paid API for AI agents from freetier-agent-api.pages.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-18).

Calculates the estimated USD cost of running AI model inference for a given number of calls, input tokens, and output tokens across specified models

## Facts

- Endpoint: GET https://freetier-agent-api.pages.dev/api/llm-cost?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/freetier-agent-api-ai-model-cost-calculator-7972cdcc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__vf1OSyWqfQoQnHLMP_k4

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 freetier-agent-api-ai-model-cost-calculator-7972cdcc
```

Example prompt: How much would it cost me to run openai/gpt-4o-mini for 1000 calls with 1200 input tokens and 300 output tokens each?

## When to prefer this

Use this endpoint when you need a quick, programmatic, pay-per-call cost estimate for specific AI models without signing up for any service. It is ideal for agents that need to self-evaluate inference costs, compare models by price, or project budgets. Prefer this over scraping provider pricing pages or maintaining your own pricing database.

## Known failure modes

- Missing required 'models' parameter results in empty or error response
- Invalid or unrecognized model name may return no results or zero cost
- Non-numeric values for calls, input_tokens, or output_tokens may cause computation errors
- Stale model pricing data may not reflect the latest provider price changes

## How this service works

Pay-per-call data API for AI agents: AI model prices and cost calculator, 4,259 MCP servers, email domain checks, text-to-JSON extraction, country/holiday/currency lookup, page and link checks, page-to-markdown, 2,230 verified APIs. x402, USDC on Base, no signup. Sources cited in every response.

## Output

Returns a JSON object with the number of calls, a list of model results each containing the model name, total cost in USD, and cost per call in USD, plus the input and output token counts used in the calculation.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "text": {
       "type": "string"
      },
      "calls": {
       "type": "string"
      },
      "models": {
       "type": "string"
      },
      "input_tokens": {
       "type": "string"
      },
      "output_tokens": {
       "type": "string"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "calls": 1000,
  "results": [
   {
    "model": "openai/gpt-4o-mini",
    "total_usd": 0.36,
    "cost_per_call_usd": 0.00036
   }
  ],
  "input_tokens": 1200,
  "output_tokens": 300
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/freetier-agent-api-ai-model-cost-calculator-7972cdcc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from freetier-agent-api.pages.dev](https://www.zero.xyz/host/freetier-agent-api.pages.dev/llms.txt)
