On this page
- An API key. Credit is in US dollars; the price is $0.50 per minute of the longest input, prorated per second.
Check the balance
/v1/creditsThe balance is the sum of an append-only ledger. A job writes a negative hold when it is accepted; on success the hold is released and a job charge of the same amount is written; on failure or cancel only the release is written. The last 50 rows come with the balance.
{
"balance_usd": 14.9,
"ledger": [
{ "id": "9c2f...", "delta_usd": -5.1, "reason": "job", "job_id": "0f9c...", "job_status": "succeeded", "created_at": "2026-08-28T09:34:02Z" },
{ "id": "7b81...", "delta_usd": 5.1, "reason": "hold_release", "job_id": "0f9c...", "job_status": "succeeded", "created_at": "2026-08-28T09:34:02Z" },
{ "id": "41ac...", "delta_usd": -5.1, "reason": "hold", "job_id": "0f9c...", "job_status": "succeeded", "created_at": "2026-08-28T09:21:44Z" },
{ "id": "0a5e...", "delta_usd": 20.0, "reason": "signup_bonus", "job_id": null, "job_status": null, "created_at": "2026-08-27T11:03:00Z" }
]
}| reason | Meaning |
|---|---|
| signup_bonus | The $20 grant a new account gets. |
| hold | Reserved for a job at submission. Negative. |
| hold_release | The reservation given back. job_status says whether it succeeded, failed, or was canceled. |
| job | The charge for a succeeded job: exactly the quote. |
| purchase | A paid top-up. Accounts with one queue ahead of free accounts. |
| adjustment | A manual credit by support. |
curl -H "Authorization: Bearer $DUETA_API_KEY" https://dueta.ai/v1/creditsRead usage
/v1/usage?from=YYYY-MM-DD&to=YYYY-MM-DDBilled seconds and dollars per UTC day, aggregated from succeeded jobs by the day they finished. Both bounds are optional and inclusive.
{
"days": [
{ "date": "2026-08-04", "billed_seconds": 210.3, "billed_usd": 1.75 },
{ "date": "2026-08-09", "billed_seconds": 140.0, "billed_usd": 1.16 }
],
"total_billed_seconds": 350.3,
"total_billed_usd": 2.91
}curl -H "Authorization: Bearer $DUETA_API_KEY" "https://dueta.ai/v1/usage?from=2026-08-01&to=2026-08-31"Top up
/v1/billing/topup/v1/billing/checkout/v1/billing/orders/{id}Read the bounds, start an order for a whole-dollar amount from $5 to $500, open the provider's payment window in a browser with what checkout returns, then poll the order. Credit is added when the order is paid. The price is always in dollars; a Korean card is charged the shown won amount instead.
| Field | Type | Meaning |
|---|---|---|
| amount_usd | int | Whole dollars, 5 to 500. |
| region, currency | string | Optional routing hints. Normally omitted; the server routes by card. |
| order_id | string | Poll GET /v1/billing/orders/{id} for pending, paid, failed, refunded, expired. |
| script_url, entry_point, payload | string, string, object | Load the script, call the entry point with the payload. Browser only. |
| charge_display, credit_usd | string, float | What the card is charged, and the credit it buys. |
# 1. The bounds, presets and rate. Public.
curl https://dueta.ai/v1/billing/topup
# -> {"min_usd": 5, "max_usd": 500, "presets_usd": [10, 20, 50, 100],
# "rate_usd_per_minute": 0.5, "charge_currency": "USD", "provider": "payple_global", ...}
# 2. Start an order for a whole-dollar amount in range.
curl -X POST https://dueta.ai/v1/billing/checkout \
-H "Authorization: Bearer $DUETA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount_usd": 20}'
# -> {"order_id": "...", "provider": "...", "script_url": "...", "entry_point": "...",
# "payload": {...open the provider's payment window with this...}, "credit_usd": 20.0}
# 3. Poll the order until it leaves "pending".
curl -H "Authorization: Bearer $DUETA_API_KEY" https://dueta.ai/v1/billing/orders/$ORDER_IDAuto-recharge
/v1/billing/auto-recharge/v1/billing/auto-rechargeWhen the balance drops below threshold_usd, buy amount_usd more. The amount obeys the top-up bounds. The response says whether it can fire today: active is false with a reason while payments are not live or no billing method is on file.
curl -X PUT https://dueta.ai/v1/billing/auto-recharge \
-H "Authorization: Bearer $DUETA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": true, "threshold_usd": 5, "amount_usd": 20}'
# -> {"enabled": true, "threshold_usd": 5, "amount_usd": 20,
# "active": false, "reason": "payments_not_live", "detail": "...", ...}Cases
- 503
- Not available yet. Card payments are not switched on yet. Contact us and we will top up your account directly.
/v1/billing/topupand/v1/billing/checkoutanswer 503 until then. It is a state, not an outage; do not retry on a timer. - 400
- The amount is not a whole number of dollars in range, or an auto-recharge threshold is out of bounds.
- 402
- A job costs more than the balance. See Run a separation.
- Expired order
- An order left pending for 30 minutes is closed as expired. Start a new one.
- Rounding
- Money fields are floored to the cent on the way out, except ledger rows, which stay exact so they sum to the balance.
- Never charged
- Uploads, quotes, failed jobs, canceled jobs.