# Riley Craig x402 Agent Store – Truck Cost Per Mile (CPM) Calculator

> Riley Craig x402 Agent Store – Truck Cost Per Mile (CPM) Calculator is a paid API for AI agents from x402-agent-store.rileycraig14.workers.dev, paid per call via x402, $0.09/call, status unknown (last checked 2026-09-14).

Calculates the cost per mile breakdown and minimum profitable rate per mile for trucking operations based on fuel, fixed, maintenance, tires, insurance, and other costs.

## Facts

- Endpoint: GET https://x402-agent-store.rileycraig14.workers.dev/truck/cpm
- Price: $0.09/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/riley-craig-x402-agent-store-truck-cost-per-mile-cpm-calculator-c07c3b98
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_k4nekG4nNAfRiWjQGL8Oi

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 riley-craig-x402-agent-store-truck-cost-per-mile-cpm-calculator-c07c3b98
```

Example prompt: Calculate my truck's cost per mile — I drive 120,000 miles a year, fuel is $3.80/gallon, my truck gets 6.5 MPG, my truck payment is $1,800/month, insurance is $900/month, maintenance is $0.18 per mile, tires are $0.04 per mile, and other monthly costs are $200.

## When to prefer this

Use this endpoint when you need a per-mile cost breakdown for trucking operations, especially when you want to determine the minimum profitable rate per mile. Ideal for owner-operators, freight brokers, or fleet managers who need a quick financial sanity check before accepting a load. Prefer this over generic financial calculators because it models trucking-specific cost categories (fuel burn, tires, maintenance) and outputs actionable per-mile metrics.

## Known failure modes

- Missing required 'annual_miles' parameter returns a 400 or validation error
- Non-numeric values for numeric fields cause schema validation failure
- Payment not fulfilled via x402 returns HTTP 402 Payment Required
- Zero or negative annual_miles may produce divide-by-zero or nonsensical output
- Extremely high/low values outside real-world ranges may return mathematically valid but practically meaningless results

## How this service works

Computes a trucking operation's true cost per mile from annual miles and cost inputs (truck payment, insurance, fuel, maintenance, tires, permits). Returns itemized CPM and the minimum profitable rate per mile.

## Output

Returns a JSON object with a breakdown of cost components: fuel_cpm, fixed_cpm, maintenance_cpm, tires_cpm, other_cpm, total_cpm (all in dollars per mile), and min_profitable_rate_per_mile — the floor rate a trucker must charge to cover all operating costs.

## 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": [
      "annual_miles"
     ],
     "properties": {
      "mpg": {
       "type": "number"
      },
      "other_mo": {
       "type": "number"
      },
      "tires_cpm": {
       "type": "number"
      },
      "fuel_price": {
       "type": "number"
      },
      "annual_miles": {
       "type": "number"
      },
      "insurance_mo": {
       "type": "number"
      },
      "maintenance_cpm": {
       "type": "number"
      },
      "truck_payment_mo": {
       "type": "number"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "total_cpm": {
       "type": "number"
      },
      "min_profitable_rate_per_mile": {
       "type": "number"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fuel_cpm": 0.6,
  "fixed_cpm": 0.41,
  "other_cpm": 0.05,
  "tires_cpm": 0.04,
  "total_cpm": 1.27,
  "maintenance_cpm": 0.18,
  "min_profitable_rate_per_mile": 1.46
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/riley-craig-x402-agent-store-truck-cost-per-mile-cpm-calculator-c07c3b98/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-agent-store.rileycraig14.workers.dev](https://www.zero.xyz/host/x402-agent-store.rileycraig14.workers.dev/llms.txt)
