Pact Swap

API Authentication

Optional API key authentication for higher rate limits


Overview

The Pact Swap REST API supports an optional API key. Authentication is not required — all endpoints remain accessible without a key. When you provide a key, the API allows a higher number of requests per second.

This applies to the main Pact Swap API (https://api.pactswap.io/): swap quotes, transaction composition, order queries, ECDSA balance endpoints, and related routes.

How it works

ItemValue
Headerx-api-key
RequiredNo
EffectIncreases allowed requests per second

Send the key on every request where you need the higher rate limit:

curl -sS "https://api.pactswap.io/pactswap_cm/getSwapQuotesByAmountFrom" \
  -H "x-api-key: YOUR_API_KEY" \
  --get \
  --data-urlencode "from=..." \
  --data-urlencode "to=..." \
  --data-urlencode "fromType=eth" \
  --data-urlencode "toType=bnb" \
  --data-urlencode "amountFrom=1000000000000000000"

Keep your API key secret. Do not commit it to source control or expose it in client-side code. Use environment variables or a secrets manager in production.

Getting an API key

API keys are issued manually. To request one, contact us on Discord and describe your integration (expected traffic, use case, environment).

- Pact Swap Discord

Request an API key in Discord

Without an API key

You can call the API without x-api-key for development, testing, and low-volume integrations. For production workloads with higher polling or quote frequency, request a key to avoid rate limiting.

Was this documentation helpful? Any suggestions?