# XE — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access live mid-market exchange rates, convert between any currency pair, and retrieve historical rate data and currency metadata from xe.com.

**Category:** Finance & Markets | **Website:** [xe.com/](https://xe.com/) | **Docs:** [parse.bot/marketplace/c71f6436-401a-4072-b3bf-4e5f4b428dad/xe-com-api](https://parse.bot/marketplace/c71f6436-401a-4072-b3bf-4e5f4b428dad/xe-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/xe/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Convert currency

Convert a specific amount from source to target currency. Returns the same structure as get_live_exchange_rate with the specified amount applied to the mid-market rate.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `amount` | number | Yes | Amount to convert |
| `from` | string | Yes | Source currency code (e.g. EUR, GBP). Supports all codes returned by get_currency_symbols. |
| `to` | string | Yes | Target currency code (e.g. USD, JPY). Supports all codes returned by get_currency_symbols. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/xe/convert-currency \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"amount":"<number>","from":"<string>","to":"<string>"}'
```

### Get all rates

Get all mid-market exchange rates relative to USD. Returns a timestamp and a rates object mapping every supported currency code to its USD-relative rate. The rate sheet refreshes every few minutes.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/xe/get-all-rates \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get currency details

Get the ISO 2-letter country code associated with a specific currency. Useful for mapping currencies to their issuing country.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `currency` | string | Yes | Currency code (e.g. USD, EUR, GBP). Supports all codes returned by get_currency_symbols. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/xe/get-currency-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"currency":"<string>"}'
```

### Get currency symbols

Get metadata and classification for all supported currencies. Each currency includes flags for obsolete status, crypto classification, and whether it is sellable or buyable on the XE platform.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/xe/get-currency-symbols \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get historical chart data

Retrieve historical exchange rate data points for a currency pair. Returns multiple time-series batches at different intervals (daily, hourly, 15-minute). Each batch contains a start time, interval in milliseconds, and an array of rate values.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `from` | string | Yes | Source currency code (e.g. USD). Supports all codes returned by get_currency_symbols. |
| `to` | string | Yes | Target currency code (e.g. EUR). Supports all codes returned by get_currency_symbols. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/xe/get-historical-chart-data \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"from":"<string>","to":"<string>"}'
```

### Get live exchange rate

Get the live mid-market exchange rate for a specific currency pair. Computes the cross-rate from USD-based rates. When amount is provided, also returns the converted value.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `amount` | number | No | Amount to convert |
| `from` | string | Yes | Source currency code (e.g. USD, EUR, GBP). Supports all codes returned by get_currency_symbols. |
| `to` | string | Yes | Target currency code (e.g. EUR, JPY, INR). Supports all codes returned by get_currency_symbols. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/xe/get-live-exchange-rate \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"amount":"<number>","from":"<string>","to":"<string>"}'
```

### Get popular currency pairings

Get popular currency pairings for a base currency with real-time rates and trend data including rate change, percentage change, and direction. Returns the most commonly tracked pairs from the given base.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `base` | string | No | Base currency code. Supports all codes returned by get_currency_symbols. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/xe/get-popular-currency-pairings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"base":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.