Buy credits
buy_creditsBuy a credit pack with a wallet that pays MPP (Machine Payments Protocol) challenges, such as Stripe Link. The credits go on the account or prepaid card of the API key you send. Without a key, the purchase makes a prepaid card: a new API key holding the credits, in the result's api_key; pass it as api_key on later calls, and keep it (it is shown again only while the card is unused, for 24 hours). Name the pack by pack, price_usd or credits (the packs: https://api.zip-codes.com/pricing.json). The first call answers Payment Required (-32042) with a challenge for that pack and charges nothing; a wallet that pays it sends the same call again with its credential and gets the purchase back: its purchase_id, the credits added and a receipt. The same payment sent again is never charged twice. A payment still clearing reads processing, with no credits yet: send the same call again later. Without a wallet, ask your human to buy at https://www.zip-codes.com/api/pricing. By paying you accept the Terms of Service: https://www.zip-codes.com/api/tos
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "buy_credits"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pack | No | The pack name from pricing.json, any case, for example Mini. | |
| api_key | No | Your ZIP-Codes.com API key, only when you cannot send it as the X-Api-Key or Authorization: Bearer header (for example a key bought with buy_credits in this conversation). Leave it out to use the free tier. It is never shown back in a response. | |
| credits | No | The pack's credits, for example 6250. | |
| price_usd | No | The pack's price in US dollars, for example 5. |