> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mag3nt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Withdraw unspent funds back to your wallet

> Initiates a withdrawal of USDC from your treasury balance to an on-chain wallet address. A flat network fee is deducted from the requested amount. The net amount is sent on-chain via CDP; the fee is retained as platform revenue. Withdrawals are processed asynchronously: check status via GET /api/withdrawals.




## OpenAPI

````yaml /openapi.yaml post /api/withdraw
openapi: 3.1.0
info:
  title: mag3nt API
  version: '2026-06-04'
  description: >
    Payment infrastructure for AI agents. Issue virtual cards, pay for API
    access via x402/AP2/MPP protocols, and settle in USDC on Base.
  contact:
    name: mag3nt
    url: https://mag3nt.com
  license:
    name: Proprietary
    url: https://github.com/mag3nt-com/mag3nt-node/blob/main/LICENSE
servers:
  - url: https://mag3nt.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Payments
    description: Universal outbound protocol payments
  - name: Cards
    description: Virtual payment card lifecycle
  - name: Keys
    description: Developer API key management
  - name: Funding
    description: Treasury deposits and balances
  - name: x402
    description: HTTP 402 payment protocol
  - name: AP2
    description: Agent-to-Agent Payment Protocol
  - name: MPP
    description: Micropayment Protocol with streaming
  - name: Pay Links
    description: Shareable payment URLs
  - name: Withdrawals
    description: Withdraw unspent funds back to wallet
  - name: Settlement
    description: On-chain settlement status
  - name: Webhooks
    description: Signed payment.settled notifications for sellers
  - name: Status
    description: System health and configuration
externalDocs:
  description: mag3nt documentation
  url: https://docs.mag3nt.com
paths:
  /api/withdraw:
    post:
      tags:
        - Withdrawals
      summary: Withdraw unspent funds back to your wallet
      description: >
        Initiates a withdrawal of USDC from your treasury balance to an on-chain
        wallet address. A flat network fee is deducted from the requested
        amount. The net amount is sent on-chain via CDP; the fee is retained as
        platform revenue. Withdrawals are processed asynchronously: check status
        via GET /api/withdrawals.
      operationId: withdrawalsCreate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - network
                - asset
              properties:
                amount:
                  type:
                    - number
                    - string
                  description: Gross amount to withdraw (fee is deducted from this)
                  example: 50
                network:
                  type: string
                  description: CAIP-2 network to withdraw on
                  example: eip155:8453
                asset:
                  type: string
                  example: USDC
                to_address:
                  type: string
                  description: >-
                    Destination wallet address (defaults to authenticated
                    wallet)
            example:
              amount: 50
              network: eip155:8453
              asset: USDC
      responses:
        '200':
          description: Withdrawal initiated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  withdrawal_id:
                    type: string
                  amount:
                    type:
                      - number
                      - string
                    description: Gross amount deducted from balance
                  withdrawal_fee:
                    type:
                      - number
                      - string
                    description: Flat network fee retained by platform
                  net_amount:
                    type:
                      - number
                      - string
                    description: Amount sent on-chain (amount - fee)
                  status:
                    type: string
                    example: PROCESSING
                  balance:
                    $ref: '#/components/schemas/Balance'
              example:
                success: true
                withdrawal_id: wd_abc123
                amount: 50
                withdrawal_fee: 0.5
                net_amount: 49.5
                status: PROCESSING
        '400':
          description: Missing fields or amount too small to cover fee
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  withdrawal_fee:
                    type:
                      - number
                      - string
                  minimum_withdrawal:
                    type:
                      - number
                      - string
                  network:
                    type: string
        '403':
          description: Insufficient balance
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  available:
                    type:
                      - number
                      - string
                  requested:
                    type:
                      - number
                      - string
                  withdrawal_fee:
                    type:
                      - number
                      - string
components:
  schemas:
    Balance:
      type: object
      properties:
        total_funded:
          type:
            - number
            - string
        total_allocated:
          type:
            - number
            - string
        total_spent:
          type:
            - number
            - string
        total_withdrawn:
          type:
            - number
            - string
        available:
          type:
            - number
            - string
        network:
          type: string
        asset:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API key prefixed with 'Bearer sx_live_...'

````