Buy a credit pack
Buys exactly what a quote showed. confirmed: true states that the person who pays said yes to that quote; pass their own words in user_confirmation. Every purchase records who confirmed it, when, through which key or connection, the amount and the quote. Buy with the same key or connection that asked for the quote; a quote from another one is refused with 409 quote_other_session. With pay_with: auto the saved card the owner allowed in the app is charged right away when the amount fits the owner's monthly limit and the workspace's limits; the credits are added at once and a receipt is emailed. Otherwise you get checkout_url, a payment page the person pays themselves; the credits arrive with that payment. The quote id makes this safe to retry: the same quote is never charged twice, and a repeat returns the first answer with replayed: true.
| Cost | What it does | Key scopes |
|---|---|---|
| The pack price, charged only after the person who pays confirmed the quote | Charges money | argorant:manage_lists |
Authorization
BearerAuth Your API key from app.argorant.com/profile, sent as Authorization: Bearer <key>. A connector sign-in token (ag_mcp_...) works the same way.
In: header
Header Parameters
Any unique text up to 128 characters. A retry with the same key and the same body within 24 hours returns the first answer (with the header Idempotent-Replayed: true) instead of doing the work twice. The same key with another body answers 409 idempotency_conflict.
length <= 128Your own id for this request, 8 to 64 letters, digits, dot, dash or underscore. Returned as X-Request-Id; one is made for you when you send none.
^[A-Za-z0-9._-]{8,64}$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://app.argorant.com/api/v1/credits/purchases" \ -H "Idempotency-Key: 6f1c2e7a-run-42" \ -H "Content-Type: application/json" \ -d '{ "quote_id": "2f8a1b3c-4d5e-4f70-8192-a3b4c5d6e7f8", "confirmed": true, "pay_with": "auto", "user_confirmation": "Yes, buy the 5,000 credits for $69", "price_shown_cents": 6900 }'{ "purchase_id": "2f8a1b3c-4d5e-4f70-8192-a3b4c5d6e7f8", "status": "awaiting_payment", "paid_with": "payment_link", "checkout_url": "https://checkout.example.com/pay/cs_live_a1B2c3", "credits": 5000, "amount_cents": 6900, "currency": "usd", "message": "Not charged to the saved card: The account owner has not allowed AI assistants to buy credits with the saved card. The owner can switch it on in Settings > Billing. Send this payment link to the user. 5,000 credits for $69.00 are added as soon as they pay. Nothing is charged before that.", "saved_card": { "used": false, "code": "not_opted_in", "reason": "The account owner has not allowed AI assistants to buy credits with the saved card. The owner can switch it on in Settings > Billing." }}