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

# Get USD Amount

> Convert an amount from MXN or other currency to USD

<RequestExample url="https://api.chipipay.com/v1/exchanges/usd-amount" method="GET">
  ```bash cURL theme={null}
  curl -X GET "https://api.chipipay.com/v1/exchanges/usd-amount?currencyAmount=250&currency=MXN" \
    -H "Authorization: Bearer sk_prod_xxxx" \
    -H "x-api-key: pk_xxxx"
  ```

  ```typescript TypeScript theme={null}
  const params = new URLSearchParams({
    currencyAmount: "250",
    currency: "MXN"
  });

  const response = await fetch(
    `https://api.chipipay.com/v1/exchanges/usd-amount?${params}`,
    {
      headers: {
        "Authorization": "Bearer sk_prod_xxxx",
        "x-api-key": "pk_xxxx",
      }
    }
  );

  const usdAmount = await response.json(); // e.g., 13.42
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.chipipay.com/v1/exchanges/usd-amount",
      params={"currencyAmount": 250, "currency": "MXN"},
      headers={
          "Authorization": "Bearer sk_prod_xxxx",
          "x-api-key": "pk_xxxx",
      }
  )

  usd_amount = response.json()  # e.g., 13.42
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Response theme={null}
  13.42
  ```
</ResponseExample>

## Notes

* The response is a plain number, not wrapped in an object.
* Exchange rates are fetched in real-time. The rate may change between calls.
* Supported currencies: `MXN` (Mexican Peso), `USD` (US Dollar).


## OpenAPI

````yaml GET /exchanges/usd-amount
openapi: 3.1.0
info:
  title: Chipi Pay API
  description: >-
    REST API for creating self-custodial wallets, executing gasless
    transactions, and purchasing services on Starknet.
  version: 14.0.0
  license:
    name: MIT
servers:
  - url: https://api.chipipay.com/v1
security:
  - bearerAuth: []
    apiKeyAuth: []
tags:
  - name: Wallets
    description: Create and manage self-custodial Starknet wallets
  - name: Transactions
    description: Record and query blockchain transactions
  - name: SKUs
    description: Browse available services for purchase
  - name: SKU Purchases
    description: Purchase services using blockchain payments
  - name: Exchanges
    description: Currency conversion rates
paths:
  /exchanges/usd-amount:
    get:
      tags:
        - Exchanges
      summary: Get USD Amount
      description: >-
        Convert an amount from a supported currency (e.g., MXN) to USD using the
        current exchange rate.
      operationId: getUsdAmount
      parameters:
        - name: currencyAmount
          in: query
          required: true
          description: The amount in the source currency
          schema:
            type: number
        - name: currency
          in: query
          required: true
          description: The source currency code
          schema:
            $ref: '#/components/schemas/Currency'
      responses:
        '200':
          description: The equivalent USD amount
          content:
            application/json:
              schema:
                type: number
                description: The converted USD amount
                example: 13.42
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Currency:
      type: string
      enum:
        - MXN
        - USD
      description: Fiat currency code
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code
        message:
          type: string
          description: Human-readable error message
      required:
        - error
        - message
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized — invalid or missing API key / bearer token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit exceeded (100 requests/minute per API key)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token — use your secret key (sk_prod_xxx) for server-side calls,
        or the user's JWT for client-side calls
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Chipi public API key (pk_xxx)

````