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

# Plan a multi-swap

> Requires quote scope. Split each input among up to four outputs. Weights must total 10000. Returns inputs for sequential builder swaps; completed trades remain completed if a later trade stops. Robinhood Chain is selected automatically.

<Info>Multi-swap planning is available. Zaps are not enabled yet; check capabilities before showing a deposit action.</Info>

[In-app integration](/cookbook/in-app-integration)


## OpenAPI

````yaml openapi.json POST /api/v2/builders/integration
openapi: 3.1.0
info:
  title: route
  version: 2.15.0
  description: >-
    Route compares swap paths offchain and executes swaps on Robinhood Chain.
    The API returns quotes and unsigned transactions. It does not sign or submit
    for you. V2 deducts a disclosed pair-dependent output fee up to 0.50%; pool
    fees, provider charges and gas may still apply. Contracts are experimental
    and unaudited. Public routing and data endpoints require no API key. Use the
    documented /api/v2 endpoints for integrations. Builder endpoints require a
    scoped x-api-key from build.route.fun. Public quote, swap and data endpoints
    remain keyless.
servers:
  - url: https://api.route.fun
security: []
paths:
  /api/v2/builders/integration:
    post:
      tags:
        - Builder API
      summary: Plan a multi-swap
      description: >-
        Requires quote scope. Split each input among up to four outputs. Weights
        must total 10000. Returns inputs for sequential builder swaps; completed
        trades remain completed if a later trade stops. Robinhood Chain is
        selected automatically.
      operationId: builderIntegration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                action:
                  type: string
                  enum:
                    - multi-plan
                input:
                  type: object
                  additionalProperties: false
                  properties:
                    execution:
                      type: string
                      enum:
                        - sequential
                    payer:
                      type: string
                      pattern: ^0x[0-9a-fA-F]{40}$
                    recipient:
                      type: string
                      pattern: ^0x[0-9a-fA-F]{40}$
                    inputs:
                      type: array
                      minItems: 1
                      maxItems: 4
                      items:
                        type: object
                        additionalProperties: false
                        properties:
                          token:
                            type: string
                            pattern: ^0x[0-9a-fA-F]{40}$
                          amount:
                            type: string
                            pattern: ^[0-9]+$
                        required:
                          - token
                          - amount
                    outputs:
                      type: array
                      minItems: 1
                      maxItems: 4
                      items:
                        type: object
                        additionalProperties: false
                        properties:
                          token:
                            type: string
                            pattern: ^0x[0-9a-fA-F]{40}$
                          weightBps:
                            type: integer
                            minimum: 1
                            maximum: 10000
                        required:
                          - token
                          - weightBps
                    slippageBps:
                      type: integer
                      minimum: 1
                      maximum: 500
                    builderCode:
                      type: string
                      pattern: ^[A-Za-z0-9_-]{3,32}$
                    builderFeeBps:
                      type: integer
                      minimum: 0
                      maximum: 50
                  required:
                    - execution
                    - payer
                    - inputs
                    - outputs
              required:
                - action
                - input
              title: Plan multi-swap
              description: Plan multi-swap
            examples:
              multiSwap:
                summary: Split an input between two outputs
                value:
                  action: multi-plan
                  input:
                    execution: sequential
                    payer: '0x1111111111111111111111111111111111111111'
                    inputs:
                      - token: '0x0000000000000000000000000000000000000000'
                        amount: '10000000000000000'
                    outputs:
                      - token: '0x2222222222222222222222222222222222222222'
                        weightBps: 5000
                      - token: '0x3333333333333333333333333333333333333333'
                        weightBps: 5000
      responses:
        '200':
          description: Result for the selected action.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  chainId:
                    type: integer
                    enum:
                      - 4663
                  execution:
                    type: string
                    enum:
                      - sequential
                  atomic:
                    type: boolean
                    enum:
                      - false
                  payer:
                    type: string
                    pattern: ^0x[0-9a-fA-F]{40}$
                  recipient:
                    type: string
                    pattern: ^0x[0-9a-fA-F]{40}$
                  legs:
                    type: array
                    minItems: 1
                    maxItems: 16
                    items:
                      type: object
                      properties:
                        chainId:
                          type: integer
                          enum:
                            - 4663
                        payer:
                          type: string
                          pattern: ^0x[0-9a-fA-F]{40}$
                        recipient:
                          type: string
                          pattern: ^0x[0-9a-fA-F]{40}$
                        tokenIn:
                          type: string
                          pattern: ^0x[0-9a-fA-F]{40}$
                        tokenOut:
                          type: string
                          pattern: ^0x[0-9a-fA-F]{40}$
                        amountIn:
                          type: string
                          pattern: ^[0-9]+$
                        builderCode:
                          type: string
                        builderFeeBps:
                          type: integer
                        slippageBps:
                          type: integer
                  swapCount:
                    type: integer
                  allocation:
                    type: string
                  partialCompletion:
                    type: string
                required:
                  - chainId
                  - execution
                  - atomic
                  - payer
                  - recipient
                  - legs
                  - swapCount
                  - allocation
                  - partialCompletion
                title: Multi-swap plan
        '400':
          description: Invalid terms or unsupported action.
        '401':
          description: Missing, expired or revoked API key.
        '402':
          description: Hourly workspace allowance reached.
        '403':
          description: Missing API key scope.
        '404':
          description: Plan not found for this API key.
        '409':
          description: Idempotency conflict, expired plan or plan not ready.
        '429':
          description: Workspace or service capacity reached. Honor Retry-After.
        '503':
          description: >-
            Zaps disabled, upstream unavailable, or preparation failed. Check
            saved status before a new request.
      security:
        - BuilderKey: []
components:
  securitySchemes:
    BuilderKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Server-side key created in an authenticated developer workspace. Builder
        codes are public attribution, not credentials.

````