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

# Create a wallet

> Creates an escrow wallet. Free. Chain and mode cannot be changed later. Limit: 25 wallets per account.



## OpenAPI

````yaml /openapi.json post /api/v1/wallets
openapi: 3.0.3
info:
  title: Chance API
  version: 1.0.0
  description: >-
    Verify an agent's proposed action against its rules, manage escrow wallets,
    and buy credits. Every verification returns a signed, hash-chained receipt.
servers:
  - url: https://harness.chance.cc
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Verification
    description: Check an action against its rules and fetch past verdicts.
  - name: Credits
    description: Balance and x402 top-ups.
  - name: Escrow wallets
    description: Wallets that only move funds through a verified proposal.
  - name: Trader
    description: Liveness reports from trader containers.
  - name: Gas sponsorship
    description: Sponsored gas for trader instances on Polygon.
  - name: Status
    description: Public deployment facts for checking receipts.
paths:
  /api/v1/wallets:
    post:
      tags:
        - Escrow wallets
      summary: Create a wallet
      description: >-
        Creates an escrow wallet. Free. Chain and mode cannot be changed later.
        Limit: 25 wallets per account.
      operationId: createWallet
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletCreate'
      responses:
        '201':
          description: The new wallet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletRow'
        '400':
          description: Invalid body, or the wallet could not be created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e0:
                  summary: invalid JSON body
                  value:
                    error: invalid JSON body
                e1:
                  summary: name is required
                  value:
                    error: name is required
                e2:
                  summary: chain must be "base", "solana", or "starknet"
                  value:
                    error: chain must be "base", "solana", or "starknet"
                e3:
                  summary: mode must be "autonomous" or "safe"
                  value:
                    error: mode must be "autonomous" or "safe"
                e4:
                  summary: create_failed
                  value:
                    error: create_failed
                    message: wallet limit reached (25 per user)
        '401':
          description: No API key, or the key is unknown or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e0:
                  summary: missing API key (send x-api-key)
                  value:
                    error: missing API key (send x-api-key)
                e1:
                  summary: invalid or revoked API key
                  value:
                    error: invalid or revoked API key
        '503':
          description: Escrow wallets are not configured on this deployment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: escrow_unconfigured
                message: >-
                  Escrow wallets are not configured on this deployment (Privy
                  server-wallet keys and Alchemy are required).
components:
  schemas:
    WalletCreate:
      type: object
      required:
        - name
        - mode
      properties:
        name:
          type: string
          description: Unique per account.
        chain:
          type: string
          enum:
            - base
            - solana
            - starknet
          description: Required unless `chainType` is sent.
        chainType:
          type: string
          enum:
            - ethereum
            - solana
            - starknet
          description: Alternative to `chain`. `ethereum` creates a Base wallet.
        mode:
          type: string
          enum:
            - autonomous
            - safe
          description: >-
            `autonomous` executes an ALLOW with a clean simulation. `safe` holds
            every proposal for the owner. Safe mode supports Base and Starknet.
        mandate:
          type: string
          description: Plain-language rules the judge checks each proposal against.
        limits:
          $ref: '#/components/schemas/WalletLimits'
      example:
        name: trading
        chain: base
        mode: safe
        mandate: Swaps between USDC and WETH only. Never send funds to a new address.
        limits:
          maxPerTxUsd: 200
          dailyCapUsd: 500
    WalletRow:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        chain:
          type: string
          enum:
            - ethereum
            - base
            - solana
            - starknet
          description: '`ethereum` only for wallets created before Base.'
        mode:
          type: string
          enum:
            - autonomous
            - safe
        custody:
          type: string
          enum:
            - server
            - embedded
          description: >-
            `embedded`: the owner's self-custodial wallet signs. `server`: a
            custodian holds the key.
        address:
          type: string
        mandate:
          type: string
          nullable: true
        balanceUsd:
          type: number
          nullable: true
        tokenCount:
          type: integer
        pendingCount:
          type: integer
          description: Proposals awaiting the owner.
        archivedAt:
          type: string
          nullable: true
          format: date-time
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            An error code (for example `out_of_credits`) or a short sentence
            (for example `intent is required`).
        message:
          type: string
          description: Detail, when present.
    WalletLimits:
      type: object
      description: >-
        Deterministic limits checked against the simulated effects before the
        judge runs.
      properties:
        maxPerTxUsd:
          type: number
          description: Ceiling on one transaction's simulated USD outflow.
        dailyCapUsd:
          type: number
          description: Ceiling on simulated USD outflow in any rolling 24 hours.
        tokenAllowlist:
          type: array
          items:
            type: string
          description: Token contract addresses that may be spent or approved.
        recipientAllowlist:
          type: array
          items:
            type: string
          description: Addresses funds may be sent to.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: An API key (`chance_sk_live_…`) from https://harness.chance.cc/keys.
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        The same API key sent as `Authorization: Bearer <key>`. If both headers
        are sent, `x-api-key` is used.

````