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

# Create deposit addresses

> Only needed if you haven’t already created a deposit address in the Lean app. Creates every deposit address the key’s trading account is missing on one venue and returns all of them. An address the provider cannot open right now is listed in missing while the others are still created and returned; call again later for it. Repeating it returns the same addresses and creates no others. It moves no money. Send only an asset GET /deposits/assets lists for the same venue, provider and address type. Hyperliquid addresses come only from Relay and credit Hyperliquid spot USDC. Do not use Hyperliquid’s own bridge: sending to Hyperliquid’s own bridge lands in perps, not in the spot balance these addresses fund. A test key gets placeholders that are not addresses on any chain.



## OpenAPI

````yaml api-reference/openapi.json POST /deposits/addresses
openapi: 3.0.0
info:
  title: Lean API
  version: 0.1.0
  description: >-
    Programmatic access to Lean: canonical sports markets, quotes, orders,
    positions and balances.
servers:
  - url: '{baseUrl}/v1'
    description: Lean API
    variables:
      baseUrl:
        default: https://api.lean.xyz
        description: >-
          The Lean API base URL, without /v1. Same value as LEAN_API_URL in the
          guides.
security:
  - apiKey: []
paths:
  /deposits/addresses:
    post:
      tags:
        - Deposits
      summary: Create deposit addresses
      description: >-
        Only needed if you haven’t already created a deposit address in the Lean
        app. Creates every deposit address the key’s trading account is missing
        on one venue and returns all of them. An address the provider cannot
        open right now is listed in missing while the others are still created
        and returned; call again later for it. Repeating it returns the same
        addresses and creates no others. It moves no money. Send only an asset
        GET /deposits/assets lists for the same venue, provider and address
        type. Hyperliquid addresses come only from Relay and credit Hyperliquid
        spot USDC. Do not use Hyperliquid’s own bridge: sending to Hyperliquid’s
        own bridge lands in perps, not in the spot balance these addresses fund.
        A test key gets placeholders that are not addresses on any chain.
      operationId: createDepositAddresses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                venue:
                  type: string
                  enum:
                    - polymarket
                    - hyperliquid
              required:
                - venue
            example:
              venue: hyperliquid
      responses:
        '200':
          description: Every deposit address of the key’s trading account
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      success:
                        type: boolean
                        enum:
                          - true
                      data:
                        oneOf:
                          - type: object
                            properties:
                              venue:
                                type: string
                                enum:
                                  - hyperliquid
                              addresses:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    provider:
                                      type: string
                                      enum:
                                        - relay
                                    address_type:
                                      type: string
                                      enum:
                                        - evm
                                        - svm
                                    address:
                                      type: string
                                      minLength: 1
                                      maxLength: 256
                                  required:
                                    - provider
                                    - address_type
                                    - address
                              missing:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    venue:
                                      type: string
                                      enum:
                                        - hyperliquid
                                    provider:
                                      type: string
                                      enum:
                                        - relay
                                    address_type:
                                      type: string
                                      enum:
                                        - evm
                                        - svm
                                  required:
                                    - venue
                                    - provider
                                    - address_type
                              message:
                                type: string
                                nullable: true
                                minLength: 1
                              livemode:
                                type: boolean
                            required:
                              - venue
                              - addresses
                              - missing
                              - message
                              - livemode
                          - type: object
                            properties:
                              venue:
                                type: string
                                enum:
                                  - polymarket
                              addresses:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    provider:
                                      type: string
                                      enum:
                                        - polymarket_wallet
                                        - polymarket_bridge
                                    address_type:
                                      type: string
                                      enum:
                                        - evm
                                        - svm
                                    address:
                                      type: string
                                      minLength: 1
                                      maxLength: 256
                                  required:
                                    - provider
                                    - address_type
                                    - address
                              missing:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    venue:
                                      type: string
                                      enum:
                                        - polymarket
                                    provider:
                                      type: string
                                      enum:
                                        - polymarket_wallet
                                        - polymarket_bridge
                                    address_type:
                                      type: string
                                      enum:
                                        - evm
                                        - svm
                                  required:
                                    - venue
                                    - provider
                                    - address_type
                              message:
                                type: string
                                nullable: true
                                minLength: 1
                              livemode:
                                type: boolean
                            required:
                              - venue
                              - addresses
                              - missing
                              - message
                              - livemode
                      meta:
                        type: object
                        properties:
                          timestampMs:
                            type: integer
                            minimum: 0
                          requestId:
                            type: string
                            minLength: 1
                          traceId:
                            type: string
                            minLength: 1
                          cachedAtMs:
                            type: integer
                            minimum: 0
                          source:
                            type: string
                            enum:
                              - cache
                              - database
                              - clickhouse
                              - upstream
                              - fallback
                              - internal
                        required:
                          - timestampMs
                          - requestId
                    required:
                      - success
                      - data
                      - meta
                  - $ref: '#/components/schemas/ApiError'
              example:
                success: true
                data:
                  venue: hyperliquid
                  addresses:
                    - provider: relay
                      address_type: evm
                      address: lean_test_not_a_deposit_address
                    - provider: relay
                      address_type: svm
                      address: lean_test_not_a_deposit_address
                  missing: []
                  message: null
                  livemode: false
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '400':
          description: Invalid venue, or the trading account is not set up on it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: VALIDATION_ERROR
                  message: Invalid venue, or the trading account is not set up on it
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '401':
          description: Missing, invalid, expired or revoked API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid, expired or revoked API key
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '403':
          description: The key lacks the scope this route needs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: This API key lacks the scope this route needs
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '429':
          description: API error
          headers:
            Retry-After:
              description: Seconds remaining in the upstream read cooldown, when available
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: RATE_LIMITED
                  message: Too many requests for this API key
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '500':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: INTERNAL_ERROR
                  message: An internal error occurred.
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '503':
          description: >-
            The deposit provider is unavailable or returned no usable address;
            nothing was created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: UPSTREAM_ERROR
                  message: >-
                    The deposit provider is unavailable or returned no usable
                    address
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
components:
  schemas:
    ApiError:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - VALIDATION_ERROR
                - NOT_FOUND
                - UNAUTHORIZED
                - FORBIDDEN
                - CONFLICT
                - UPSTREAM_ERROR
                - RATE_LIMITED
                - INTERNAL_ERROR
                - FEATURE_DISABLED
                - CONDITIONAL_SELL_REJECTED
                - CONDITIONAL_SELL_ACTIVE
            message:
              type: string
              minLength: 1
            details:
              nullable: true
          required:
            - code
            - message
        meta:
          type: object
          properties:
            timestampMs:
              type: integer
              minimum: 0
            requestId:
              type: string
              minLength: 1
            traceId:
              type: string
              minLength: 1
            cachedAtMs:
              type: integer
              minimum: 0
            source:
              type: string
              enum:
                - cache
                - database
                - clickhouse
                - upstream
                - fallback
                - internal
          required:
            - timestampMs
            - requestId
      required:
        - success
        - error
        - meta
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A Lean API key, sent as `Authorization: Bearer <key>`. A test key
        (`lean_sk_test_...`) simulates orders and fills with no money; a live
        key (`lean_sk_live_...`) trades for real within the key's limits. Every
        successful response says which mode answered in `data.livemode`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.