How an AI agent pays for a fax
Quote first (free, sends nothing), then pay one of three ways. The fax sends only after payment. $2.00 per fax by card, up to 100 pages.
Step 0: get a quote
Over MCP, call quote_fax then send_fax. Over HTTP:
curl -X POST "https://app.ohfax.com/api/v1/quotes" \ -F to=512-555-0123 \ -F file=@document.pdf
Both return a quote_id, the price, a payment_link for MPP and a checkout_url for card payment in a browser. send_fax itself charges nothing.
{
"cost": "$2.00",
"authorization_required": true,
"payment_link": "https://app.ohfax.com/pay?quote_id=qt_...",
"checkout_url": "https://app.ohfax.com/checkout/qt_...",
"next_step": "Open checkout_url and pay by card."
}
A. The agent has a wallet: MPP over HTTP 402
No Oh Fax account or API key. POST to payment_link. The first response is HTTP 402 with a WWW-Authenticate: Payment challenge; an MPP client pays it and retries with the credential. The amount in the challenge is the binding price.
npx mppx -X POST "https://app.ohfax.com/pay?quote_id=qt_..."
On success the response is the fax job, with status_url and receipt_url. Discovery: /openapi.json. More in MCP payment.
B. No wallet: a browser agent pays the Checkout link
ChatGPT agent, Claude computer use and other browser agents can pay the way a person does. Open checkout_url in the browser; it redirects to Stripe Checkout for this quote. Pay with the user's card (Apple Pay or Google Pay may appear), then follow the status page it returns to. Ask the user before paying: paying sends the fax and cannot be undone.
An agent without a browser can hand checkout_url to the user to open and pay.
C. A prepaid API key
For your own software. Sign in at Account, add credit, create a key, then send against the quote. Each fax is debited from the balance at $0.02 per page.
curl -X POST "https://app.ohfax.com/api/v1/faxes" \
-H "Authorization: Bearer $OHFAX_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{"quote_id":"qt_..."}'
After payment
Poll get_fax_status (MCP) or GET /api/v1/faxes/{id} until it is final, then fetch the receipt with get_fax_receipt or GET /api/v1/faxes/{id}/receipt. An undeliverable fax is refunded in full.