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

# Get On-Ramp Quote

> Get a fiat-to-crypto conversion quote

Returns a price quote for purchasing crypto with fiat currency, including exchange rate, fees, and estimated crypto amount.

<ParamField body="fiatCurrency" type="string" required>
  The fiat currency code (e.g., `USD`, `EUR`, `GBP`).
</ParamField>

<ParamField body="cryptoAsset" type="string" required>
  The crypto asset symbol (e.g., `ETH`, `USDC`, `BTC`).
</ParamField>

<ParamField body="chainId" type="number" required>
  The chain ID to receive crypto on (e.g., `1` for Ethereum).
</ParamField>

<ParamField body="fiatAmount" type="number" required>
  The fiat amount to spend.
</ParamField>

<ParamField body="paymentMethod" type="string" required>
  Payment method: `credit_card`, `debit_card`, or `bank_transfer`.
</ParamField>

<ParamField body="walletAddress" type="string" required>
  The wallet address to receive crypto.
</ParamField>

<ResponseExample>
  ```json 200 theme={"system"}
  {
    "data": {
      "fiatCurrency": "USD",
      "fiatAmount": 100,
      "cryptoAsset": "ETH",
      "chainId": 1,
      "cryptoAmount": "0.029615",
      "exchangeRate": 3376.65,
      "fees": {
        "networkFee": 2.50,
        "processingFee": 3.49,
        "partnerFee": 0.30,
        "totalFee": 6.29
      },
      "totalFiatAmount": 106.29,
      "paymentMethod": "credit_card",
      "expiresAt": 1711234877
    },
    "error": null,
    "meta": {
      "requestId": "q7f8a9b0-c1d2-3456-0123-567890123456",
      "timestamp": 1711234577,
      "rateLimit": {
        "limit": 2000,
        "remaining": 1983,
        "reset": 1711234627
      }
    }
  }
  ```
</ResponseExample>

<CodeGroup>
  ```typescript TypeScript theme={"system"}
  const quote = await client.getOnrampQuote({
    fiatCurrency: "USD",
    cryptoAsset: "ETH",
    chainId: 1,
    fiatAmount: 100,
    paymentMethod: "credit_card",
    walletAddress: "0xYourAddress",
  });

  console.log(`$100 USD = ${quote.data.cryptoAmount} ETH`);
  console.log(`Total charge: $${quote.data.totalFiatAmount}`);
  console.log(`Fees: $${quote.data.fees.totalFee}`);
  ```

  ```bash cURL theme={"system"}
  curl -X POST "https://api.hypermid.io/v1/onramp/quote" \
    -H "Content-Type: application/json" \
    -H "X-API-Key: your-api-key" \
    -d '{
      "fiatCurrency": "USD",
      "cryptoAsset": "ETH",
      "chainId": 1,
      "fiatAmount": 100,
      "paymentMethod": "credit_card",
      "walletAddress": "0xYourAddress"
    }'
  ```

  ```go Go theme={"system"}
  body := `{
    "fiatCurrency": "USD",
    "cryptoAsset": "ETH",
    "chainId": 1,
    "fiatAmount": 100,
    "paymentMethod": "credit_card",
    "walletAddress": "0xYourAddress"
  }`

  req, _ := http.NewRequest("POST",
      "https://api.hypermid.io/v1/onramp/quote",
      strings.NewReader(body))
  req.Header.Set("Content-Type", "application/json")
  req.Header.Set("X-API-Key", "your-api-key")
  resp, _ := http.DefaultClient.Do(req)
  ```
</CodeGroup>


## OpenAPI

````yaml POST /v1/onramp/quote
openapi: 3.0.3
info:
  title: Hypermid Partner API
  version: 1.0.0
  description: >-
    Cross-chain swap aggregator API. Supports 30+ EVM chains, Solana, Bitcoin,
    Sui, and Near Intents chains (NEAR, TON, Tron, XRP, etc.).


    ## Authentication

    Pass your API key via the `X-API-Key` header. Public endpoints work without
    a key (anonymous tier). Partner endpoints (`/v1/partner/*`) require a valid
    key.


    ## Rate Limits

    - **Anonymous**: 30 requests/minute (per IP)

    - **Partner (authenticated)**: 100 requests/minute (per API key)


    These limits are designed for human-driven widget usage and mirror our
    upstream aggregator (LiFi) limits to prevent any single user from exhausting
    shared quota.


    Rate limit info is returned in `meta.rateLimit` on every response.


    ## Response Envelope

    All responses follow the shape:

    ```json

    { "data": <T | null>, "error": <{ code, message, details? } | null>, "meta":
    { "requestId", "timestamp", "rateLimit?" } }

    ```
  contact:
    name: Hypermid
    url: https://hypermid.io
servers:
  - url: https://api.hypermid.io
    description: Production
security:
  - ApiKeyAuth: []
  - {}
tags:
  - name: Swap
    description: Cross-chain swap quoting, routing, status, and reference data
  - name: Execute
    description: Transaction execution and deposit management for Near Intents swaps
  - name: On-Ramp
    description: Fiat-to-crypto on-ramp via RampNow
  - name: Partner
    description: Partner account, analytics, and webhook management (requires X-API-Key)
  - name: Tracking
    description: Swap event tracking for partner attribution
  - name: System
    description: Health check and API metadata
paths:
  /v1/onramp/quote:
    post:
      tags:
        - On-Ramp
      summary: Get a fiat-to-crypto quote
      description: Returns a price quote for buying crypto with fiat currency.
      operationId: getOnrampQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OnrampQuoteRequest'
      responses:
        '200':
          description: Quote returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '502':
          $ref: '#/components/responses/UpstreamError'
components:
  schemas:
    OnrampQuoteRequest:
      type: object
      properties:
        fiatAmount:
          type: number
          example: 100
        fiatCurrency:
          type: string
          example: USD
        cryptoToken:
          type: string
          example: ETH
        cryptoChain:
          type: string
          example: ethereum
        walletAddress:
          type: string
        paymentMode:
          type: string
          example: card
        userCountry:
          type: string
          example: US
      required:
        - fiatAmount
        - fiatCurrency
        - cryptoToken
        - cryptoChain
    ApiResponse:
      type: object
      properties:
        data:
          description: Response payload (null on error)
        error:
          nullable: true
          type: object
          properties:
            code:
              type: string
              example: INVALID_PARAMS
            message:
              type: string
              example: 'Missing required parameters: fromChain'
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - data
        - error
        - meta
    Meta:
      type: object
      properties:
        requestId:
          type: string
          format: uuid
        timestamp:
          type: integer
          description: Unix epoch seconds
        rateLimit:
          type: object
          properties:
            limit:
              type: integer
            remaining:
              type: integer
            reset:
              type: integer
              description: Unix epoch seconds when the window resets
      required:
        - requestId
        - timestamp
  responses:
    BadRequest:
      description: Invalid or missing parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResponse'
    UpstreamError:
      description: Upstream provider error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Partner API key. Optional for public endpoints, required for
        /v1/partner/*.

````