<!-- tempo-docs-context -->
> Source: [/docs/routes/api-setup](https://tempo.com/developers/docs/routes/api-setup.md)
> Section: [Routes](https://tempo.com/developers/docs/routes.md). Move stablecoins between Tempo and other networks: try a route, set up API access, choose a supported route, quote it, accept deposits or make a transfer, and track delivery. Routes is in beta; see the introduction for access.
> [Documentation index](https://tempo.com/developers/llms.txt) · [Docs skill](https://tempo.com/developers/SKILL.md)

> Tempo MCP: Use `search`, `find_pages`, `read_page`, and `code` at `https://mcp.tempo.xyz` for Tempo and related documentation.
> If an indexed page is missing or reflects an older site, read this site’s [documentation index](https://tempo.com/developers/llms.txt) and Markdown pages directly.

<span id="routes-api-setup" />

# Set up Routes

Bring stablecoins from other networks onto Tempo with a quote and one create call.

:::warning
Routes is in beta. [Contact Tempo](https://tempo.com/contact) to discuss access and the routes your application needs.
:::

[Try a route in your browser](https://tempo.com/developers/docs/routes/test): Quote, create, fund, and track a live route while the demo logs each Routes API call.

## Set up the Routes API

::::steps
<span id="routes-api-key-scopes" />

### Create a Routes API key

Create a key in [Tempo Console](https://tempo.com/console?to=/\:org/api-keys) with the scopes your flow needs. Keep it on your backend; it authenticates your application and doesn't sign transactions.

| Scope | Allows |
| --- | --- |
| `routes:read` | Quotes, and transfer and deposit status reads |
| `routes:write` | Creating transfers and deposit addresses, and registering source transactions |
| `data:read` | Reading the [route directory](https://tempo.com/developers/docs/routes/networks) with your key, which applies your organization's access policy |

<span id="configure-the-client" />

### Configure the client

Set `TEMPO_API_KEY` in your environment. TypeScript uses Node.js with built-in `fetch`. Python uses `requests`. cURL examples require `curl` and `jq`.

:::code-group
```ts [TypeScript (fetch)]
const api = 'https://api.tempo.xyz/v1'
const headers = {
  'tempo-api-key': process.env.TEMPO_API_KEY!,
  'Content-Type': 'application/json',
}
```

```python [Python (requests)]
import os
import requests

api = "https://api.tempo.xyz/v1"
headers = {
    "tempo-api-key": os.environ["TEMPO_API_KEY"],
    "Content-Type": "application/json",
}
```

```bash [cURL (API)]
# Set TEMPO_API_KEY in your terminal's environment before running requests.
curl --fail-with-body 'https://api.tempo.xyz/v1/routes' \
  --header "tempo-api-key: $TEMPO_API_KEY"
```
:::

### Get a quote

Quote a transfer from your backend. Pick a pair from [supported routes](https://tempo.com/developers/docs/routes/networks). [Quotes and fees](https://tempo.com/developers/docs/routes/quotes) explains the amounts and fees in the response.

`GET /v1/routes/transfers/quote`

Quote transfer

[API reference](https://tempo.com/developers/docs/api/routes/transfers#quoteroutestransfer) — request parameters, authentication, and response schema. The examples below use editable sample values.

Requires a [Tempo API key](https://tempo.com/developers/docs/api/console/api-keys). Replace `YOUR_API_KEY` before running this request.

**cURL**

```bash
curl 'https://api.tempo.xyz/v1/routes/transfers/quote?amount=1000000&destinationChain=base&destinationToken=usdc&mode=exactSource&recipient=0x1111111111111111111111111111111111111111&sender=0x2222222222222222222222222222222222222222&sourceChain=tempo&sourceToken=usdce' \
  --header 'tempo-api-key: YOUR_API_KEY'
```

**TypeScript**

```ts
fetch('https://api.tempo.xyz/v1/routes/transfers/quote?amount=1000000&destinationChain=base&destinationToken=usdc&mode=exactSource&recipient=0x1111111111111111111111111111111111111111&sender=0x2222222222222222222222222222222222222222&sourceChain=tempo&sourceToken=usdce', {
  headers: {
    'tempo-api-key': 'YOUR_API_KEY'
  }
})
```

<span id="prepare-a-transfer-request" />

<span id="prepare-a-deposit-address-request" />

<span id="set-idempotency-keys" />

### Create a transfer or a deposit address

Create a [transfer](https://tempo.com/developers/docs/routes/transfers) when your user's wallet signs the source calls. Create a [deposit address](https://tempo.com/developers/docs/routes/deposits) when the sender pays from any wallet or exchange.

Create requests require an `idempotency-key` header. Assign one key per operation, such as one payment or one customer's deposit address, and store it with that record before sending the request:

:::code-group
```ts [TypeScript (fetch)]
const requestKey = crypto.randomUUID() // Persist with your payment record.
```

```python [Python (requests)]
import uuid

requestKey = str(uuid.uuid4())  # Persist with your payment record.
```

```bash [cURL (API)]
# Choose and retain one key per operation, including across retries.
ROUTE_REQUEST_KEY="my-payment-001"
```
:::

Reuse the key when you retry the same request with unchanged inputs. Matching requests replay the successful response for 24 hours. A request with changed inputs conflicts.
::::

## Related

[Make a transfer](https://tempo.com/developers/docs/routes/transfers): Use for sending from a wallet your application controls or connects.

[Accept deposits](https://tempo.com/developers/docs/routes/deposits): Use for letting senders pay from any wallet or exchange.

[Supported routes](https://tempo.com/developers/docs/routes/networks): Covers available networks, tokens, and funding methods.
