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

# Cross-chain API overview

> Authentication, base URL, and the intent lifecycle for the cross-chain payments API.

The cross-chain payments API is separate from the OMS Payments API. It has its own authentication, its own base URL, and its own SDK package. Do not use OMS Payments API credentials or base URLs with these endpoints.

## Authentication

All requests require an `X-Access-Key` header with your API key.

```http theme={null}
X-Access-Key: YOUR_ACCESS_KEY
```

Retrieve your API key from the [Trails Dashboard](https://dashboard.trails.build).

## Base URL

```
https://trails-api.sequence.app/rpc/Trails/
```

All endpoints are appended to this base URL. For example, the `QuoteIntent` endpoint is:

```
POST https://trails-api.sequence.app/rpc/Trails/QuoteIntent
```

## All endpoints are POST requests

This API uses POST for all endpoints, including read operations. Request bodies are JSON.

## SDK installation

```bash theme={null}
pnpm install @0xtrails/api
```

Initialize the client once and reuse it across your application:

```typescript theme={null}
import { TrailsApi } from "@0xtrails/api";

const trails = new TrailsApi({
  baseUrl: "https://trails-api.sequence.app/rpc/Trails/",
  accessKey: process.env.TRAILS_ACCESS_KEY,
});
```

## Intent lifecycle

A payment is called an **intent**. Every intent moves through a defined set of states from quote to settlement.

| State       | Description                                                                        | API call        |
| ----------- | ---------------------------------------------------------------------------------- | --------------- |
| `QUOTED`    | A route and fee have been calculated. Valid for 5 minutes.                         | `QuoteIntent`   |
| `COMMITTED` | The quote is locked in. Valid for 10 minutes; must be executed within this window. | `CommitIntent`  |
| `EXECUTING` | Funds are in transit; routing and conversion are in progress.                      | `ExecuteIntent` |
| `SUCCEEDED` | Funds have arrived at the destination. Terminal state.                             | (automatic)     |
| `FAILED`    | The intent could not be completed. Terminal state.                                 | (automatic)     |

### Expiry and failure

* A `QUOTED` intent expires after 5 minutes. After expiry, request a new quote.
* A `COMMITTED` intent expires after 10 minutes if `ExecuteIntent` is not called. After expiry, the intent moves to `FAILED`.
* `FAILED` is a terminal state. Create a new intent to retry.

## Next steps

<CardGroup cols={2}>
  <Card title="Quotes and execution" href="/cross-chain/api-reference/quotes">
    QuoteIntent, CommitIntent, ExecuteIntent, and AbortIntent.
  </Card>

  <Card title="Status and monitoring" href="/cross-chain/api-reference/monitoring">
    Track an intent through to settlement.
  </Card>

  <Card title="Routes and discovery" href="/cross-chain/api-reference/discovery">
    Supported networks, tokens, routes, and prices.
  </Card>

  <Card title="Accept funds" href="/cross-chain/fund">
    Integration guide for the widget, SDK, and direct API.
  </Card>
</CardGroup>
