AI credit client wallets

Create a wallet

Returns the id you use from then on. The body and every field in it are optional, so no body or {} creates an empty wallet to fund and assign in separate calls. Not idempotent: a retry creates a second wallet. Errors: no_credit_pool (your account has no AI credit pool yet), invalid_value.

post/api/ai-credits/wallets

Request

  • Base URL
    https://api.duda.co
  • URL
    https://api.duda.co/api/ai-credits/wallets
  • Auth
    HTTP basic

Request body

namestring

Free text, up to 255 characters.

recurrence_amountstring

The recurring allowance, as a decimal string. Defaults to 0, cannot be negative, at most 2 decimals and 99999999.99. The wallet holds all of it immediately.

recurrence_dayinteger

1-31. Defaults to today's day of the month (UTC).

topup_balancestring

An opening top-up on top of the allowance, as a decimal string. Defaults to 0, cannot be negative, at most 2 decimals and 99999999.99.

Example request

{
  "name": "Acme Corp",
  "recurrence_amount": "500.0",
  "recurrence_day": 15,
  "topup_balance": "100.0"
}

Response

OK

created_atstring date-time
idstring

Minted by Duda and immutable. Store it against your own customer record.

namestring

The id when no name was set.

recurrence_amountstring

The recurring allowance, as a decimal string.

recurrence_balancestring

What is left of the recurring allowance this cycle, as a decimal string. Moved by POST /credits.

recurrence_dayinteger

Day of the month (1-31) the cycle turns over. Clamps to the month's length.

topup_balancestring

A single flat top-up figure, as a decimal string. It never expires.

updated_atstring date-time

Example response

{
  "assigned_accounts": [
    {
      "account_name": "acme-corp"
    }
  ],
  "id": "3f9c1a7e-4b21-4d9a-9f0e-8c2d1a5b7e33",
  "name": "Acme Corp",
  "recurrence_amount": "500.0",
  "recurrence_balance": "320.0",
  "recurrence_day": 15,
  "topup_balance": "100.0"
}

Changes

No recorded changes to this operation across all 1 revision of this API.