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

# Get exchange rate

> Returns the current exchange rate between two currencies. Rates update approximately every 30 seconds and are indicative — the actual rate is determined at the time the transfer is processed.



## OpenAPI

````yaml /openapi.json get /v1/rates
openapi: 3.1.0
info:
  title: Ledger API
  version: 1.0.0
  description: >-
    The Ledger API lets you issue virtual accounts and crypto wallets to your
    users and businesses. Build fintech products on top of Ledger's
    infrastructure.


    All endpoints return a consistent envelope: `{ ok: true, data: ... }` on
    success and `{ ok: false, error: { code, message } }` on failure.


    ## Base URL


    ```

    https://api.ledger.so

    ```


    ## Authentication


    Pass your API key via `Authorization: Bearer <key>` or the `X-API-Key`
    header. Keys follow the format `ld_<env>_<prefix>_<secret>` where `<env>` is
    `test` or `live`.


    ## Pagination


    List endpoints accept `limit` (default 50, max 200) and `cursor` query
    parameters. Responses include `nextCursor` when more pages are available.


    ## Idempotency


    POST endpoints accept an `Idempotency-Key` header. Reusing a key for a
    different route or method returns `409 Conflict`.
  contact:
    name: Ledger Support
    url: https://ledger.so
    email: support@ledger.so
  license:
    name: Proprietary
servers:
  - url: https://api.ledger.so
    description: Production
security:
  - BearerAuth: []
  - ApiKeyAuth: []
tags:
  - name: Health
    description: API health check
  - name: Customers
    description: Manage customers (individuals or businesses) on your platform
  - name: Crypto Wallets
    description: Create and manage custodial crypto wallets
  - name: Virtual Accounts
    description: Create and manage fiat virtual accounts with deposit instructions
  - name: Counterparties
    description: Manage customer-owned external accounts for receiving payouts
  - name: Transactions
    description: View transaction history across wallets and accounts
  - name: Rates
    description: Get current exchange rates
  - name: Transfers
    description: Move funds between currencies and payment rails
  - name: Webhooks
    description: Configure webhook endpoints to receive real-time event notifications
  - name: Reference
    description: Lookup tables for occupation and industry codes
paths:
  /v1/rates:
    get:
      tags:
        - Rates
      summary: Get exchange rate
      description: >-
        Returns the current exchange rate between two currencies. Rates update
        approximately every 30 seconds and are indicative — the actual rate is
        determined at the time the transfer is processed.
      operationId: getExchangeRate
      parameters:
        - in: query
          name: from
          required: true
          schema:
            type: string
            enum:
              - usd
              - gbp
              - eur
              - usdt
          description: Source currency code
        - in: query
          name: to
          required: true
          schema:
            type: string
            enum:
              - usd
              - gbp
              - eur
              - usdt
          description: Destination currency code
      responses:
        '200':
          description: Exchange rate
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      from:
                        type: string
                        description: Source currency
                      to:
                        type: string
                        description: Destination currency
                      buyRate:
                        type: string
                        description: Rate when buying the destination currency
                      sellRate:
                        type: string
                        description: Rate when selling the destination currency
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    InvalidRequest:
      description: Request validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            ok: false
            error:
              code: INVALID_REQUEST
              message: Validation failed
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            ok: false
            error:
              code: UNAUTHORIZED
              message: Invalid API key
  schemas:
    Error:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          type: boolean
          enum:
            - false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
                - INVALID_REQUEST
                - NOT_FOUND
                - CONFLICT
                - RATE_LIMITED
                - INTERNAL_ERROR
            message:
              type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Pass your API key as a Bearer token: `Authorization: Bearer ld_live_...`'
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Pass your API key via the `X-API-Key` header

````