Home / Use cases / mistral-api-budget

Mistral API with per-agent budget cap

The problem

Mistral usage scales fast in agent loops. You need a hard ceiling per agent per day.

What Spawnpay does

Wrap Mistral calls in @spawnpay/paywall with `budget.daily`. Pre-charge enforcement throws BUDGET_DAILY before the call hits Mistral. State persists locally; no server round-trip.

Code

curl -X POST https://spawnpay.ai/api/proxy\
  -H 'Authorization: Bearer spk_live_...'\
  -H 'Content-Type: application/json'\
  -H 'X-Provider-Key: $MISTRAL_API_KEY' \
  -d '{  "provider": "mistral",  "path": "/v1/chat/completions",  "method": "POST",  "body": {    "model": "mistral-small-latest",    "messages": [      {        "role": "user",        "content": "hi"      }    ]  }}'
60-SEC QUICKSTART → PLAYGROUND → TOP UP USDC →

What you get with $7 free credit

Every new spk_ wallet starts with $7. That covers 7,000 proxy calls, 1,400 cloud-scrapes, or 700 screenshots — enough to verify Spawnpay fits your workflow before topping up.

See also