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

# Compute swap quote (base input)

> Calculate the expected output amount when swapping a fixed input amount.
Useful for displaying a preview before transaction building.




## OpenAPI

````yaml /api-reference/openapi/route-api-v2.yaml get /compute/swap-base-in
openapi: 3.0.3
info:
  title: Raydium Transaction API (Route V2)
  version: 1.0.0
  description: >
    Server-side swap transaction builder for Solana. This API generates
    serialized swap transactions without requiring clients to run an RPC
    connection or the full Raydium SDK.


    Responses follow a standard envelope format:

    - **Success**: `{ id: string, success: true, data: {...} }`

    - **Error**: `{ id: string, success: false, msg: string }`
  contact:
    name: Raydium
    url: https://raydium.io
servers:
  - url: https://transaction-v1.raydium.io
    description: Mainnet
  - url: https://transaction-v1-devnet.raydium.io
    description: Devnet
security: []
tags:
  - name: Compute
    description: Read-only endpoints for swap quote computation (no transaction building).
  - name: Transaction
    description: Build serialized swap transactions ready to sign and broadcast.
paths:
  /compute/swap-base-in:
    get:
      tags:
        - Compute
      summary: Compute swap quote (base input)
      description: |
        Calculate the expected output amount when swapping a fixed input amount.
        Useful for displaying a preview before transaction building.
      operationId: computeSwapBaseIn
      parameters:
        - name: inputMint
          in: query
          required: true
          schema:
            type: string
          description: Mint address of the input token (base58-encoded public key).
          example: EPjFWdd5Au5WrWSNY8jk5oHE3TkM3TvhEhBNj9xtJzwQ
        - name: outputMint
          in: query
          required: true
          schema:
            type: string
          description: Mint address of the output token (base58-encoded public key).
          example: So11111111111111111111111111111111111111112
        - name: amount
          in: query
          required: true
          schema:
            type: string
          description: >-
            Input amount in lamports (smallest unit of SPL tokens). Must be a
            non-negative integer string.
          example: '1000000'
        - name: slippageBps
          in: query
          required: true
          schema:
            type: string
          description: Maximum slippage tolerance in basis points (0–10000). 1 bps = 0.01%.
          example: '50'
        - name: referrerBps
          in: query
          required: false
          schema:
            type: string
          description: >-
            Optional referrer fee in basis points (0–10000). Only used if you
            have a referrer authority.
          example: '100'
        - name: txVersion
          in: query
          required: true
          schema:
            type: string
            enum:
              - V0
              - LEGACY
          description: >-
            Solana transaction version. V0 uses address lookup tables; LEGACY is
            the traditional format.
          example: V0
      responses:
        '200':
          description: Swap quote computed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComputeSwapResponse'
        '400':
          description: Invalid input parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ComputeSwapResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique request identifier (UUID).
          example: 550e8400-e29b-41d4-a716-446655440000
        success:
          type: boolean
          description: Whether the compute succeeded.
          example: true
        version:
          type: string
          description: API response version.
          example: V1
        data:
          type: object
          description: Swap computation result.
          properties:
            inputAmount:
              type: string
              description: Input amount in the smallest unit.
            outputAmount:
              type: string
              description: Expected output amount (considering slippage).
            priceImpact:
              type: string
              description: Price impact percentage (e.g., "0.5" for 0.5%).
            routes:
              type: array
              description: Array of swap routes and pools used.
              items:
                type: object
    ErrorResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique request identifier.
        success:
          type: boolean
          example: false
        version:
          type: string
          example: V1
        msg:
          type: string
          description: Error message code (e.g., REQ_SLIPPAGE_BPS_ERROR, REQ_WALLET_ERROR).

````