# API Reference



import { Callout } from 'fumadocs-ui/components/callout';
import { Tabs, Tab } from 'fumadocs-ui/components/tabs';

The Across API moves money across chains through four calls: discover what is
possible, price it, execute it, track it. The execute call is needed only when
the quote asks for it with a `submit_execution` action.

Base URL [#base-url]

Every Across API endpoint is served from one host, under `/v1`:

```bash
# production
https://api.across.to

# staging
https://api.staging.across.to
```

The older, deprecated APIs are documented separately on
[legacy.docs.across.to](https://legacy.docs.across.to/api-reference). Do not
use them for new integrations.

Authentication [#authentication]

To get a production API key, [request access](/introduction#get-your-api-key).
For a staging key, contact Across. Send the key as a Bearer token with every
request.

```
Authorization: Bearer YOUR_API_KEY
```

Your first call [#your-first-call]

`GET /v1/capabilities` is the simplest authenticated call, so it is the fastest
way to check your key works.

<Tabs items={["cURL", "JavaScript", "Python", "Go"]}>
  <Tab value="cURL">
    ```bash
    curl -H "Authorization: Bearer YOUR_API_KEY" \
      "https://api.across.to/v1/capabilities?originChainId=42161&destinationChainId=8453&include=tokens"
    ```
  </Tab>

  <Tab value="JavaScript">
    ```ts
    const BASE = "https://api.across.to";

    const res = await fetch(
      `${BASE}/v1/capabilities?originChainId=42161&destinationChainId=8453&include=tokens`,
      { headers: { Authorization: `Bearer ${process.env.ACROSS_API_KEY}` } },
    );
    const capabilities = await res.json();
    ```
  </Tab>

  <Tab value="Python">
    ```python
    import os, requests

    BASE = "https://api.across.to"

    response = requests.get(
        f"{BASE}/v1/capabilities",
        params={
            "originChainId": "42161",
            "destinationChainId": "8453",
            "include": "tokens",
        },
        headers={"Authorization": f"Bearer {os.environ['ACROSS_API_KEY']}"},
    )
    ```
  </Tab>

  <Tab value="Go">
    ```go
    const base = "https://api.across.to"

    req, _ := http.NewRequest("GET",
        base+"/v1/capabilities?originChainId=42161&destinationChainId=8453&include=tokens",
        nil)
    req.Header.Set("Authorization", "Bearer "+os.Getenv("ACROSS_API_KEY"))
    resp, _ := http.DefaultClient.Do(req)
    ```
  </Tab>
</Tabs>

The four calls [#the-four-calls]

|       | Call                                   | Purpose                                                                                 |
| ----- | -------------------------------------- | --------------------------------------------------------------------------------------- |
| **1** | `GET /v1/capabilities`                 | What can move between two chains right now, and why anything unavailable is unavailable |
| **2** | `POST /v1/quotes`                      | Price one exact transfer. Returns the ordered actions required to execute it            |
| **3** | `POST /v1/quotes/{orderId}/executions` | Submit the results of the returned actions, only when they end with `submit_execution`  |
| **4** | `GET /v1/transfers/{orderId}`          | Follow the order to a settled outcome                                                   |

Walk the whole flow in the [Quickstart](/introduction/quickstart).

<APICards />
