---
title: "Create a wallet"
method: POST
path: "/api/ai-credits/wallets"
tags: ["AI credit client wallets"]
---

# Create a wallet

`POST /api/ai-credits/wallets`

## Request

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

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.

## Request body

- ApiCreateSubWalletRequest
  - `name` string: Free text, up to 255 characters.
  - `recurrence_amount` string: 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_day` integer: 1-31. Defaults to today's day of the month (UTC).
  - `topup_balance` string: 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.

## Response `200`

OK

- ApiSubWalletResponse
  - `assigned_accounts` ApiAccountRefInfo[]: The client accounts drawing from this wallet, empty when none is. Moved by assign and unassign.
    - `account_name` string: The client's account name, as the Accounts API returns it.
  - `created_at` string, date-time
  - `id` string: Minted by Duda and immutable. Store it against your own customer record.
  - `name` string: The id when no name was set.
  - `recurrence_amount` string: The recurring allowance, as a decimal string.
  - `recurrence_balance` string: What is left of the recurring allowance this cycle, as a decimal string. Moved by POST /credits.
  - `recurrence_day` integer: Day of the month (1-31) the cycle turns over. Clamps to the month's length.
  - `topup_balance` string: A single flat top-up figure, as a decimal string. It never expires.
  - `updated_at` string, date-time

## Other responses

- `400`: Bad request. The request is malformed or failed validation.
- `401`: Unauthorized. The credentials are missing or invalid.
- `429`: Too many requests. The rate limit was exceeded.

---

[API](https://skmtc.dev/duda/apis/duda-partner-api.md) - [All operations](https://skmtc.dev/duda/apis/duda-partner-api/llms.txt) - [OpenAPI document](https://skmtc.dev/duda/apis/duda-partner-api/revisions/52be4d41cb12?raw)
