---
title: "Withdraw earned funds"
method: POST
path: "/ais/{aiId}/billing/withdrawals"
tags: ["Billing"]
---

# Withdraw earned funds

`POST /ais/{aiId}/billing/withdrawals`

## Request

- Base URL: `https://api.darwin.so/api/v1`
- URL: `https://api.darwin.so/api/v1/ais/{aiId}/billing/withdrawals`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Withdraws settled earned funds using the selected payout speed. Promotional and card-funded wallet money cannot be withdrawn.

## Path parameters

- `aiId` string, required

## Headers

- `Idempotency-Key` string, required

## Request body

- WithdrawalRequest
  - `amountMinor` integer, required
  - `speed` 'standard' | 'instant'

## Response `201`

The submitted or existing idempotent withdrawal.

- WalletWithdrawal
  - `id` string, required
  - `status` 'submitted' | 'completed' | 'failed' | 'reversed', required
  - `withdrawalAmountMinor` integer
  - `providerFeeMinor` integer
  - `payoutAmountMinor` integer
  - `speed` 'standard' | 'instant'
  - `failureCode` string, nullable

## Other responses

- `400`: The request was invalid.
- `401`: The API key or access token is missing, invalid, expired, or revoked.
- `403`: The principal does not have the required scope or resource access.
- `404`: The resource was not found for this principal.

---

[API](https://skmtc.dev/darwin/apis/darwin-api.md) · [All operations](https://skmtc.dev/darwin/apis/darwin-api/llms.txt) · [OpenAPI document](https://skmtc.dev/darwin/apis/darwin-api/revisions/56166fce7bfb?raw)
