> ## 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.

# スワップ・クオート計算（基本出力）

> 目的の出力額を達成するのに必要な入力額を計算します。
目標出力額がわかっているスワップに便利です。




## OpenAPI

````yaml /ja/api-reference/openapi/route-api-v2.yaml get /compute/swap-base-out
openapi: 3.0.3
info:
  title: Raydium トランザクション API (Route V2)
  version: 1.0.0
  description: >
    Solana のサーバーサイド・スワップ・トランザクション・ビルダー。このAPI は、クライアントが RPC コネクションまたはフル Raydium
    SDK を実行することなく、シリアライズされたスワップ・トランザクションを生成します。


    レスポンスは標準的なエンベロープ形式に従います：

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

    - **エラー**: `{ 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: スワップ・クオート計算用の読み取り専用エンドポイント（トランザクション・ビルディングなし）。
  - name: Transaction
    description: 署名・ブロードキャスト可能なシリアライズされたスワップ・トランザクションを生成します。
paths:
  /compute/swap-base-out:
    get:
      tags:
        - Compute
      summary: スワップ・クオート計算（基本出力）
      description: |
        目的の出力額を達成するのに必要な入力額を計算します。
        目標出力額がわかっているスワップに便利です。
      operationId: computeSwapBaseOut
      parameters:
        - name: inputMint
          in: query
          required: true
          schema:
            type: string
          description: 入力トークンのミント・アドレス。
          example: EPjFWdd5Au5WrWSNY8jk5oHE3TkM3TvhEhBNj9xtJzwQ
        - name: outputMint
          in: query
          required: true
          schema:
            type: string
          description: 出力トークンのミント・アドレス。
          example: So11111111111111111111111111111111111111112
        - name: amount
          in: query
          required: true
          schema:
            type: string
          description: 目的の出力額（最小単位、ラムポート）。
          example: '5000000'
        - name: slippageBps
          in: query
          required: true
          schema:
            type: string
          description: 最大スリッページ・トレランス（ベーシス・ポイント、0～10000）。
          example: '50'
        - name: txVersion
          in: query
          required: true
          schema:
            type: string
            enum:
              - V0
              - LEGACY
          description: Solana トランザクション・バージョン。
          example: V0
      responses:
        '200':
          description: スワップ・クオートが正常に計算されました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComputeSwapResponse'
        '400':
          description: 無効な入力パラメータです。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ComputeSwapResponse:
      type: object
      properties:
        id:
          type: string
          description: 一意のリクエスト識別子（UUID）。
          example: 550e8400-e29b-41d4-a716-446655440000
        success:
          type: boolean
          description: compute が成功したかどうか。
          example: true
        version:
          type: string
          description: API レスポンス・バージョン。
          example: V1
        data:
          type: object
          description: スワップ計算結果。
          properties:
            inputAmount:
              type: string
              description: 入力額（最小単位）。
            outputAmount:
              type: string
              description: 予想出力額（スリッページを考慮）。
            priceImpact:
              type: string
              description: 価格インパクト・パーセンテージ（例：0.5 は 0.5%）。
            routes:
              type: array
              description: 使用されたスワップ・ルートとプールの配列。
              items:
                type: object
    ErrorResponse:
      type: object
      properties:
        id:
          type: string
          description: 一意のリクエスト識別子です。
        success:
          type: boolean
          example: false
        version:
          type: string
          example: V1
        msg:
          type: string
          description: エラーメッセージコード（例：REQ_SLIPPAGE_BPS_ERROR、REQ_WALLET_ERROR）です。

````