---
title: "Refill a prepaid API key (x402 payment)"
method: POST
path: "/prepaid/refill"
tags: ["Prepaid"]
---

# Refill a prepaid API key (x402 payment)

`POST /prepaid/refill`

Adds credits to an existing prepaid API key via x402 USDC payment on Base.

**Flow:**
1. POST with just `apiKey` in body (no PAYMENT header) → returns 402 with payment instructions
2. Sign an EIP-3009 `transferWithAuthorization` using EIP-712 typed data with domain `{name: "USD Coin", version: "2", chainId: 8453, verifyingContract: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}`
3. Base64-encode the JSON payload `{from, to, value, validAfter, validBefore, nonce, v, r, s}` and retry with `PAYMENT` header

500 credits per $1 USDC. Minimum payment: $0.01 USDC.

## Headers

- `PAYMENT` string

## Request body

- object
  - `apiKey` string, required — The prepaid API key to refill

## Response `200`

Credits added successfully

- object
  - `apiKey` string
  - `creditsAdded` integer
  - `totalCredits` integer
  - `usage` integer
  - `remaining` integer
  - `txHash` string

## Other responses

- `402` — Payment required. Response includes full x402 payment instructions.
- `404` — Prepaid key not found

---

[API](https://skmtc.dev/coincap/apis/coincap-api.md) · [All operations](https://skmtc.dev/coincap/apis/coincap-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/coincap/coincap-api/revisions/e3d3739c2c03/schema)
