Live sandbox — real API + engine, fake provider, no real money.
The refill layer for AI agents

Everything your AI agents need to buy.

AgentRefills is one API for autonomous agents to buy gift cards, API credits, domains, eSIMs, cloud compute and more — thousands of products across 190+ countries. Instant, programmatic, delivered in seconds.

Read the docs
One API MCP-ready 190+ countries Instant delivery
your agent AgentRefills code released from the vault
agentrefills — purchase.sh
# agent buys an Amazon gift card
POST /v1/purchases
{ "brand_id": "amazon", "amount_minor": 2500, "currency": "USD" }
202 accepted · POST /code
{
"code": "GIFT-••••-9F2A",
"face_minor": 2500,
"state": "completed"
}
Released once, from the vault
Thousands of products 190+ countries Instant delivery One API Sandbox included Built for reliability Security-first by design
How it works

From API call to fulfillment in three steps

Wire AgentRefills into your agent once. Every purchase is a single call.

1

Connect the API

Drop in the AgentRefills REST API or MCP tool. SDKs for Python & TypeScript.

2

Your agent picks a product

Query thousands of gift cards, API credits, domains, compute & eSIMs programmatically.

3

Instant fulfillment

Codes, keys & credentials returned in the response and via webhook in seconds.

Developer platform

Built for autonomous agents

Everything an agent needs to spend responsibly in the real world — typed, observable, and safe by default.

MCP server & tool

Expose AgentRefills to any agent as a native tool.

REST API + SDKs

Python & TypeScript, typed and idempotent.

Programmatic budgets

Per-agent spend limits and approval rules.

Webhooks & audit logs

Every order traceable and observable.

Sandbox environment

Test purchases with zero real spend.

Instant fulfillment

Codes & keys delivered in seconds, globally.

Plugs into the agent stack you already use.

OpenAI logoOpenAI Anthropic logoAnthropic LangChain logoLangChain LlamaIndex logoLlamaIndex MCP logoMCP CrewAI logoCrewAI Vercel logoVercel AI SDK
Agent-native catalog

Refill anything — beyond gift cards

Gift cards are just the start. Your agents can top up credits, spin up infra, and register domains through the same API.

Explore products
Gift-card catalog · live

Thousands of gift-card brands, one API

Rendered live from /v1/brands. Pick an amount and click Buy to run a real sandbox purchase.

Browse the catalog
Gaming & top-ups

Load up any world, programmatically

Wallet credit and game currency, delivered in seconds.

All gaming
API reference

Five tools. Create, poll, release.

Same-origin REST and MCP with identical semantics. Base URL https://api.agentrefills.com.

The live demo on this page runs against localhost:8090 with the sandbox provider — real engine, no real money.

# 1. create a purchase (sandbox: X-Agent-Id, or Bearer token in prod)
curl -X POST https://api.agentrefills.com/v1/purchases \
  -H "Content-Type: application/json" \
  -H "X-Agent-Id: agent_demo" \
  -d '{"brand_id":"amazon","amount_minor":2500,"currency":"USD"}'

# → {"task_id":"tsk_9F2A","status":"accepted","state":"completed"}

# 2. release the code once (from the vault)
curl -X POST https://api.agentrefills.com/v1/purchases/tsk_9F2A/code \
  -H "X-Agent-Id: agent_demo"

# → {"code":"GIFT-XXXX-9F2A","face_minor":2500,"remaining_minor":2500}
import time, requests

BASE = "https://api.agentrefills.com"
H = {"X-Agent-Id": "agent_demo"}

# create -> poll -> release
r = requests.post(f"{BASE}/v1/purchases", headers=H, json={
    "brand_id": "amazon", "amount_minor": 2500, "currency": "USD",
})
r.raise_for_status()
task = r.json()["task_id"]

while requests.get(f"{BASE}/v1/purchases/{task}", headers=H).json()["state"] != "completed":
    time.sleep(0.45)

code = requests.post(f"{BASE}/v1/purchases/{task}/code", headers=H).json()
print(code["code"], code["face_minor"])
const BASE = "https://api.agentrefills.com";
const H = { "Content-Type": "application/json", "X-Agent-Id": "agent_demo" };

// create -> poll -> release
let r = await fetch(`${BASE}/v1/purchases`, {
  method: "POST", headers: H,
  body: JSON.stringify({ brand_id: "amazon", amount_minor: 2500, currency: "USD" }),
});
if (!r.ok) throw await r.json();
const { task_id } = await r.json();

let state = "accepted";
while (state !== "completed") {
  await new Promise((res) => setTimeout(res, 450));
  state = (await (await fetch(`${BASE}/v1/purchases/${task_id}`, { headers: H })).json()).state;
}

const code = await (await fetch(`${BASE}/v1/purchases/${task_id}/code`, { method: "POST", headers: H })).json();
console.log(code.code, code.face_minor);
# AgentRefills posts order events to your endpoint.
# HMAC-verified (X-Signature) and deduped on (provider, event_id).

POST https://your-app.com/hooks/agentrefills
X-Signature: "t=1720224000,v1=<hmac-sha256>"

{
  "provider": "bitrefill",
  "event_id": "evt_7c1e",
  "type": "purchase.completed",
  "task_id": "tsk_9F2A",
  "brand_id": "amazon",
  "face_minor": 2500
}

# Verify the HMAC, then look up by event_id — a replay is a no-op.
# Endpoint: POST /v1/webhooks/bitrefill
{
  "tools": [
    { "name": "list_brands",      "annotations": { "readOnlyHint": true } },
    { "name": "buy_giftcard",     "annotations": { "destructiveHint": true, "idempotentHint": true },
      "input": {
        "brand_id":     "amazon",
        "amount_minor": 2500,
        "currency":     "USD",
        "client_ref":   "idem_2f9c"
      } },
    { "name": "get_code",         "annotations": { "readOnlyHint": false } },
    { "name": "check_balance",    "annotations": { "readOnlyHint": true } },
    { "name": "request_approval", "annotations": { "readOnlyHint": false } }
  ]
}
FAQ

Questions agents and their builders ask

Straight answers about letting an autonomous agent spend money safely.

What is AgentRefills?

AgentRefills is a purchasing API for AI agents. It lets an autonomous agent buy gift cards, API credits, domains, cloud compute and eSIMs through five simple tools over MCP or REST, wrapped in spend caps, human approval, and a full audit trail. It is the refill layer that gives an agent a wallet it can't misuse.

Can an AI agent buy a gift card?

Yes. An agent calls the buy_giftcard tool with a brand, an amount in minor units (cents) and an idempotency key. The purchase runs through a fail-closed policy check; under the spend cap it settles automatically, and over your threshold it parks for human approval. The redemption code is released once through a separate call.

How do I give my AI agent a spending limit?

Every agent gets its own API key scoped to per-agent daily and monthly spend caps and a brand allowlist. The policy engine enforces the caps on every purchase and fails closed, so an agent can never exceed its budget even if the policy service is unreachable.

How do I require human approval for agent purchases?

Set an approval threshold. Any purchase above it is parked as APPROVAL_REQUIRED and a human is pinged in Slack to approve or reject before money moves. The agent can re-ping the approver with the request_approval tool, and the task resumes automatically once approved.

What can AI agents buy through AgentRefills?

Gift cards for thousands of brands plus API credits (OpenAI, Anthropic, Perplexity), cloud and GPU compute (AWS, Google Cloud, NVIDIA), domains (Namecheap, GoDaddy), hosting, messaging credits and eSIMs. All are callable programmatically through the same API.

Does it work with MCP, LangChain and the OpenAI Agents SDK?

Yes. AgentRefills ships an MCP server that any MCP client can use as a native tool, and a REST API with identical semantics for the OpenAI Agents SDK, LangChain, LangGraph, LlamaIndex, CrewAI, the Vercel AI SDK, or any custom stack.

How are gift card codes kept secure?

Codes are encrypted at rest and released to the purchasing agent exactly once through get_code, with the access logged. Raw codes are never written to logs, traces, or responses beyond that single release, so a leaked log or trace can never expose a redeemable code.

Is there a sandbox to test without spending real money?

Yes. AgentRefills runs sandbox-first against test products, so you can complete the full purchase flow end to end with zero real spend, then flip to production when you are ready.

How does AgentRefills prevent duplicate purchases?

Every purchase carries an agent-supplied idempotency key (client_ref). Re-using the same key returns the existing order instead of buying again, and a unique payment-per-task constraint makes a second charge structurally impossible rather than statistically unlikely.

Ready when your agents are

Give your agents a wallet for the real world.

One API for gift cards, API credits, domains, compute and eSIMs across 190+ countries. Start in the sandbox, ship to production.