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

# Get rates

> Retrieve exchange rates for all supported currencies.



## OpenAPI

````yaml /openapi.json get /rates
openapi: 3.0.3
info:
  title: Receive stablecoin. Get fiat in seconds.
  description: Stablecoin collection and settlement layer.
  version: 1.0.0
  contact:
    name: Switch Labs
    email: contact@onswitch.xyz
  license:
    name: Proprietary
  x-tagGroups:
    - name: Institution
      tags:
        - Institution
    - name: Miscellaneous
      tags:
        - Miscellaneous
    - name: History
      tags:
        - History
    - name: Payment
      tags:
        - Payment
    - name: Webhook
      tags:
        - Webhook
    - name: Offramp
      tags:
        - Offramp
    - name: Onramp
      tags:
        - Onramp
    - name: Swap
      tags:
        - Swap
    - name: Developer
      tags:
        - Developer
    - name: Wallet
      tags:
        - Wallet
    - name: Compliance
      tags:
        - Compliance
servers:
  - url: https://api.onswitch.xyz
    description: Production server
security: []
tags:
  - name: Institution
    description: Institution discovery and bank or payment-rail lookup
  - name: Miscellaneous
    description: Requirements, coverage, assets, confirmation, and transaction status
  - name: History
    description: Payment history and summaries for the partner's account
  - name: Payment
    description: Saved payment beneficiaries, payment confirmation, and status
  - name: Webhook
    description: Webhook delivery history and callback resend
  - name: Offramp
    description: Offramp transaction endpoints for converting stablecoins to local currency
  - name: Onramp
    description: Onramp transaction endpoints for converting local currency to stablecoins
  - name: Swap
    description: Swap endpoints for exchanging between different stablecoin assets
  - name: Developer
    description: Developer fee balance and withdrawal
  - name: Wallet
    description: >-
      Wallet endpoints for creating and managing chain abstracted stablecoin
      wallets
  - name: Compliance
    description: AML compliance screening for PEP, sanctions, and other regulatory reasons
paths:
  /rates:
    get:
      tags:
        - Miscellaneous
      summary: Get rates
      description: Retrieve exchange rates for all supported currencies.
      operationId: getRates
      parameters:
        - name: direction
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/Direction'
          example: OFFRAMP
      responses:
        '200':
          description: Successfully retrieved rates
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - timestamp
                  - data
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  timestamp:
                    type: string
                    format: date-time
                  data:
                    type: array
                    description: Effective rate per currency
                    items:
                      type: object
                      required:
                        - currency
                        - rate
                      properties:
                        currency:
                          $ref: '#/components/schemas/CurrencyCode'
                        rate:
                          type: number
                          description: Effective exchange rate amount
              example:
                success: true
                message: Rates fetched successfully
                timestamp: '2026-04-18T14:22:08.631Z'
                data:
                  - currency: NGN
                    rate: 1582.441
                  - currency: GHS
                    rate: 16.08
                  - currency: KES
                    rate: 142.35
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - ServiceKey: []
components:
  schemas:
    Direction:
      type: string
      enum:
        - OFFRAMP
        - ONRAMP
    CurrencyCode:
      type: string
      enum:
        - CDF
        - ETB
        - GHS
        - GMD
        - GNF
        - KES
        - LRD
        - MWK
        - NGN
        - RWF
        - SLE
        - TZS
        - UGX
        - USD
        - XAF
        - XOF
        - ZAR
        - ZMW
  responses:
    BadRequest:
      description: Bad request - Invalid input parameters or validation error
      content:
        application/json:
          schema:
            type: object
            required:
              - success
              - message
              - timestamp
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
                description: Error message describing what went wrong
              timestamp:
                type: string
                format: date-time
              data:
                description: Additional error details
                nullable: true
          example:
            success: false
            message: amount must be greater than 0 for the selected corridor
            timestamp: '2026-04-18T14:22:08.631Z'
            data: null
  securitySchemes:
    ServiceKey:
      type: apiKey
      in: header
      name: x-service-key
      description: Service key for API authentication

````