ArgorantDocs

Buy a credit pack

posthttps://app.argorant.com/api/v1/credits/purchases
POST
/api/v1/credits/purchases

The quote the person said yes to.

true: the person who pays saw the quote and said yes.

auto: the saved card when allowed, else a payment link. link: always a payment link.

The person's own words that said yes to the quote, quoted exactly (up to 1,000 characters). Recorded with the purchase; without it the record says confirmed=true.

The price you showed the person, in cents of the quote's currency. Recorded with the purchase. A price that differs from the quote is refused with 409 price_mismatch.

The id of your tool call that carries this yes, if your app has one. Recorded with the purchase.

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.

CostWhat it doesKey scopes
The pack price, charged only after the person who pays confirmed the quoteCharges moneyargorant:manage_lists

Authorization

BearerAuth
AuthorizationBearer <token>

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

Idempotency-Key?string

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.

Lengthlength <= 128
X-Request-Id?string

Your 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.

Match^[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

Shell
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  }'

JSON
{  "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."  }}