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

# Execute swap

> This endpoint allows you to swap an asset to another.



## OpenAPI

````yaml openapi.json post /swap
openapi: 3.0.3
info:
  title: Bread API
  description: >-
    The Bread provides comprehensive cryptocurrency wallet management
    capabilities including wallet creation, balance monitoring, and asset
    transfers.
  version: 2.0.0
servers:
  - url: https://processor-prod.up.railway.app
    description: Production server
security: []
paths:
  /swap:
    post:
      tags:
        - Swap
      summary: Execute swap
      description: This endpoint allows you to swap an asset to another.
      operationId: swapAsset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SwapExecuteRequest'
      responses:
        '200':
          description: Swap executed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwapExecuteResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    SwapExecuteRequest:
      type: object
      required:
        - wallet_id
        - receiver
        - from_asset
        - to_asset
      properties:
        wallet_id:
          type: string
          description: The wallet ID to swap from
          example: 68bb7d8399900e253084e6f9
        from_amount:
          type: number
          description: |-
            Amount to swap. Use **-1** to swap all available balance.

            Use this for **EXACT INPUT** swaps.
          example: -1
        to_amount:
          type: number
          description: |-
            Amount of the `to_asset` you want to receive.

            Use this for **EXACT OUTPUT** swaps.
          example: 100
        receiver:
          type: string
          description: The recipient address for the swapped assets
          example: '0x4ad21FA456Bb297f505B2718ba87ad63D8a95E6B'
        from_asset:
          type: string
          enum:
            - ethereum:usdc
            - base:usdc
            - arbitrum:usdc
            - solana:usdc
            - bsc:usdc
            - polygon:usdc
            - optimism:usdc
            - avalanche:usdc
            - ethereum:usdt
            - arbitrum:usdt
            - solana:usdt
            - polygon:usdt
            - bsc:usdt
            - optimism:usdt
            - avalanche:usdt
            - base:cngn
            - bsc:cngn
          description: The asset to swap from
          example: solana:usdc
        to_asset:
          type: string
          enum:
            - ethereum:usdc
            - base:usdc
            - arbitrum:usdc
            - solana:usdc
            - bsc:usdc
            - polygon:usdc
            - optimism:usdc
            - avalanche:usdc
            - ethereum:usdt
            - arbitrum:usdt
            - solana:usdt
            - polygon:usdt
            - bsc:usdt
            - optimism:usdt
            - avalanche:usdt
            - base:cngn
            - bsc:cngn
          description: The asset to swap to
          example: base:usdc
    SwapExecuteResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        status:
          type: integer
          example: 200
        message:
          type: string
          example: Swap executed successfully
        timestamp:
          type: string
          format: date-time
          example: '2025-09-09T20:42:10.316Z'
        data:
          type: object
          properties:
            hash:
              type: string
              description: Transaction hash on the blockchain
              example: >-
                0x8e935237667da1a673ea84cdaf1750ef9dddb125e075d20657f38b5223674da8
            link:
              type: string
              description: Link to view the transaction on a blockchain explorer
              example: >-
                https://blockscan.com/tx/0x8e935237667da1a673ea84cdaf1750ef9dddb125e075d20657f38b5223674da8
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-service-key

````