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

# Swap Token Amount

> Execute a swap transaction for the specified token pair and amount



## OpenAPI

````yaml /openapi/jupiter.json post /api/v0/swap/{tokenPair}/{amount}
openapi: 3.1.0
info:
  title: Jupiter Blinks API
  version: 0.0.1
servers:
  - url: https://jupiter.dial.to
security: []
paths:
  /api/v0/swap/{tokenPair}/{amount}:
    post:
      tags:
        - Swap
      summary: Swap Token Amount
      description: Execute a swap transaction for the specified token pair and amount
      operationId: postApiV0SwapByTokenPairByAmount
      parameters:
        - in: path
          name: tokenPair
          schema:
            example: SOL-Bonk
            default: SOL-Bonk
            description: >-
              Token pair in format input-output. Input and output are token
              symbols or addresses.
            type: string
          required: true
        - in: path
          name: amount
          schema:
            example: 0.01
            default: 0.01
            description: >-
              Amount of the input token to swap. If the input token is SOL, this
              is in SOL, otherwise, this is in USD equivalent of input.
            type: number
            minimum: 0
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                account:
                  description: The public key of the account that executes the transaction
                  example: 6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176
                  default: 6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176
                  type: string
              required:
                - account
              additionalProperties: false
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    const: transaction
                  transaction:
                    description: Base64 encoded serialized transaction
                    type: string
                required:
                  - type
                  - transaction
                additionalProperties: false
          description: Successful swap transaction
        '422':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
                additionalProperties: false
          description: Token metadata not found or validation error

````