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

# Upgrading to Pro: switch your base URL to api-pro.dexpaprika.com

> Paid DexPaprika plans are served on api-pro.dexpaprika.com and need your API key in the Authorization header. One base URL change, everything else stays the same. Includes the exact errors you see if either half is missing.

Paid plans are served on a different host from the free tier. If you have just
subscribed to Pro and your existing code is failing, this is why, and there are
only two things to change.

<Steps>
  <Step title="Change the base URL">
    `https://api.dexpaprika.com` becomes `https://api-pro.dexpaprika.com`
  </Step>

  <Step title="Send your API key on every request">
    `Authorization: api_your_personal_api_key`, with the key as the entire header
    value. Copy it from [console.dexpaprika.com](https://console.dexpaprika.com).
  </Step>
</Steps>

Nothing else moves. Paths, query parameters, response shapes and your key itself
are identical to the free API, so a find and replace on the hostname plus a header
is the whole migration.

<Warning>
  Both halves are required together, and a half-finished switch does not fail
  cleanly. Sending your key without changing the base URL can return `200` on the
  paths you call most and `403` on the rest, because the free host caches
  responses by URL. Sending it to the right host without the header gets you a
  block page from the edge rather than our JSON. Both are in
  [what each error means](#what-each-error-means) below.
</Warning>

## Before and after

<CodeGroup>
  ```bash cURL theme={null}
  # Free tier
  curl "https://api.dexpaprika.com/networks/ethereum/pools/search?query=WETH"

  # Pro
  curl "https://api-pro.dexpaprika.com/networks/ethereum/pools/search?query=WETH" \
      -H "Authorization: api_your_personal_api_key"
  ```

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

  BASE = "https://api-pro.dexpaprika.com"          # was https://api.dexpaprika.com
  HEADERS = {"Authorization": "api_your_personal_api_key"}   # new on Pro

  response = requests.get(
      f"{BASE}/networks/ethereum/pools/search",
      params={"query": "WETH"},
      headers=HEADERS,
  )
  response.raise_for_status()
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const BASE = 'https://api-pro.dexpaprika.com';          // was https://api.dexpaprika.com
  const HEADERS = { Authorization: 'api_your_personal_api_key' };  // new on Pro

  const res = await fetch(`${BASE}/networks/ethereum/pools/search?query=WETH`, {
    headers: HEADERS,
  });
  if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
  console.log(await res.json());
  ```

  ```go Go theme={null}
  const base = "https://api-pro.dexpaprika.com" // was https://api.dexpaprika.com

  req, _ := http.NewRequest("GET", base+"/networks/ethereum/pools/search?query=WETH", nil)
  req.Header.Set("Authorization", "api_your_personal_api_key") // new on Pro

  resp, err := http.DefaultClient.Do(req)
  ```
</CodeGroup>

<Note>
  Send the key as the entire `Authorization` header value, nothing before it and
  nothing after it. If your HTTP client only offers a token field that prepends a
  scheme word for you, do not use it; set a raw header instead.
</Note>

## If you use our SDKs or the streaming API

<AccordionGroup>
  <Accordion title="SDKs and the CLI" icon="cube">
    Every official SDK takes the base URL and the key as configuration, so you do
    not have to touch call sites. Set the Pro host and your key once where the
    client is constructed. The [SDK pages](/get-started/sdk-ts) show the option
    name for each language.
  </Accordion>

  <Accordion title="Streaming" icon="signal-stream">
    Streaming has the same split. `streaming.dexpaprika.com` serves the free tier
    and `streaming-pro.dexpaprika.com` serves paid plans, with the same
    `Authorization` header. Moving your REST calls does not move your streams: an
    event source left pointing at the free host stays on free-tier terms, which
    limit a keyless caller to the showcase assets. Details on the
    [streaming introduction](/streaming/introduction).
  </Accordion>

  <Accordion title="MCP servers and AI agents" icon="robot">
    Anything configured with a DexPaprika base URL needs the same change, including
    MCP server configs and agent tool definitions. See
    [AI integration](/ai-integration/index).
  </Accordion>
</AccordionGroup>

## What each error means

The two hosts fail in different ways, and telling them apart tells you which half
of the change is missing.

| What you see                                                     | What it means                                                                                                                                                                                                               | What to do                                                                                                                                                       |
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `403` and an HTML page headed **"Sorry, you have been blocked"** | Your request reached the Pro host with no `Authorization` header at all. It was stopped at the edge before our API saw it, which is why the body is a Cloudflare page and not our JSON. This is not an IP ban.              | Add the `Authorization` header.                                                                                                                                  |
| `401` with `{"message":"api key verification has failed"}`       | The header arrived, but the value is not a key we recognise.                                                                                                                                                                | Copy the key again from [the console](https://console.dexpaprika.com). It has no overlap window, so if you regenerated it, every integration needs the new one.  |
| `401` with `{"message":"missing or invalid api key"}`            | The same missing or unrecognised key, returned from the host root rather than an endpoint.                                                                                                                                  | As above.                                                                                                                                                        |
| `403` with `"error": "wrong_host"`                               | The key and the host disagree about your plan. It fires in both directions: a free key sent to `api-pro.`, and a paid key sent to `api.` The body names the host to use and links the console, the docs and pricing.        | Match the host to your plan. Free and keyless traffic on `api.` and `streaming.`, paid keys on `api-pro.` and `streaming-pro.`                                   |
| `200` on `api.dexpaprika.com` while holding a paid key           | Not an error, and that is the problem. Responses on the free host are cached by URL, so a path another caller has already requested can answer before the host check runs. You get free-tier data, up to 15 seconds behind. | Run the one-line check below.                                                                                                                                    |
| `402`                                                            | Your monthly credit allowance is spent. Retrying does not help.                                                                                                                                                             | Buy a credit pack or enable overage in the [console](https://console.dexpaprika.com). See [error handling](/knowledge-base/error-handling#402-payment-required). |
| `429`                                                            | You are over the per-minute ceiling for your plan.                                                                                                                                                                          | Back off for the interval in the `Retry-After` header, then raise your throttle to the Pro ceiling on the [rate limits page](/knowledge-base/rate-limits).       |

## One check that tells you which host you are on

`GET /usage` is never served from cache, so it always reflects the host and plan you are
really talking to. Run it against the free host with your key:

```bash theme={null}
curl -s -H "Authorization: api_your_personal_api_key" \
  https://api.dexpaprika.com/usage
```

On a paid plan this answers `403` with `"error": "wrong_host"` and names the host to use. On
a free plan it answers `200` with your plan and remaining credits. The same call against
`https://api-pro.dexpaprika.com/usage` is the mirror: `200` with your paid plan when you are
in the right place.

<Tip>
  If you are paying and a call to the free host still returns `200` with data, the cache
  answered before the host check did. `/usage` is the reliable probe, because it is the one
  path that is never cached. Do not confuse it with `GET /health`, which every host answers
  without a key: that one reports whether the service is up and tells you nothing about your
  key, your plan or your host.
</Tip>

## Retune your client

<Steps>
  <Step title="Raise your rate limiter">
    Pro's per-minute ceiling is far above the free tier's, so a throttle tuned for
    free-tier traffic now leaves most of your allowance unused. Keep the throttle
    and the `429` backoff, and raise the threshold to the figure for your plan on
    the [rate limits page](/knowledge-base/rate-limits).
  </Step>

  <Step title="Drop the polling you added to work around the delay">
    The free tier serves data with a delay; Pro is real time. Anything you built to
    re-poll for fresher numbers is now spending credits for nothing.
  </Step>

  <Step title="Watch your credits">
    Track spend in the [console](https://console.dexpaprika.com), or call
    `GET /usage` from your own code. One request costs one credit, batch endpoints
    cost one credit per item, and every streaming update delivered costs one
    credit.
  </Step>

  <Step title="Check both environments">
    Each account has exactly one API key, so staging and production share a quota.
    A test loop spends the same allowance your production traffic depends on.
  </Step>
</Steps>

## Checklist

<AccordionGroup>
  <Accordion title="Before you deploy" icon="list-check">
    * Every `api.dexpaprika.com` in your codebase, config and environment files is now `api-pro.dexpaprika.com`
    * The `Authorization` header is set on every request, not only the first one
    * The key comes from an environment variable or a secret store, never from source
    * Streaming clients point at `streaming-pro.dexpaprika.com`
    * Your rate limiter is set to your plan's ceiling
    * You have handled `402` separately from `429`, because retrying a `402` never succeeds
  </Accordion>
</AccordionGroup>

## Where to go next

<CardGroup cols={2}>
  <Card title="Pro API introduction" icon="book" href="/api-pro/introduction">
    What the Pro API includes, endpoint by endpoint
  </Card>

  <Card title="Rate limits and credits" icon="gauge-high" href="/knowledge-base/rate-limits">
    Current ceilings and allowances for every plan
  </Card>

  <Card title="Error handling" icon="triangle-exclamation" href="/knowledge-base/error-handling">
    Every status code the API returns and how to handle it
  </Card>

  <Card title="Console" icon="key" href="https://console.dexpaprika.com">
    Your key, your usage and your billing
  </Card>
</CardGroup>

Still stuck after the switch? Email [support@coinpaprika.com](mailto:support@coinpaprika.com)
or ask in [Discord](https://discord.gg/DhJge5TUGM). Plans and prices are on the
[pricing page](https://dexpaprika.com/api/pricing).
