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

# 取得預估交易費用

> 取得預估的鏈上費用（lamports）。快取 60 秒。



## OpenAPI

````yaml /zh-Hant/api-reference/openapi/api-v3.yaml get /main/auto-fee
openapi: 3.0.3
info:
  title: Raydium API v3
  version: 3.0.0
  description: >-
    Raydium API v3 提供 REST 端點，用於查詢 Solana 區塊鏈上的流動性池、mint 資訊、Farm 詳情、IDO
    池及鏈上元資料。適用於錢包、聚合器與交易者取得價格資訊、池資料及路由資訊。
servers:
  - url: https://api-v3.raydium.io
    description: 正式環境（Mainnet）
  - url: https://api-v3-devnet.raydium.io
    description: 開發環境（Devnet）
security: []
tags:
  - name: Main
    description: 鏈上資訊、TVL 及設定的核心 API 端點
  - name: Mint
    description: Token mint 資訊與定價
  - name: Pools
    description: 流動性池資訊、金鑰及歷史資料
  - name: Farms
    description: Farm 池資訊與金鑰
  - name: IDO
    description: IDO 池資訊與金鑰
paths:
  /main/auto-fee:
    get:
      tags:
        - Main
      summary: 取得預估交易費用
      description: 取得預估的鏈上費用（lamports）。快取 60 秒。
      operationId: getMainAutoFee
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
components:
  schemas:
    ApiResponse:
      type: object
      description: 通用回應封裝。`data` 欄位由各端點的回應 schema 透過 `allOf` 提供，因此不在基礎封裝中宣告。
      required:
        - id
        - success
      properties:
        id:
          type: string
          description: 請求 ID（UUID）
        success:
          type: boolean
          description: 請求是否成功
        msg:
          type: string
          description: 失敗時的錯誤訊息

````