> For the complete documentation index, see [llms.txt](https://docs.metric.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metric.xyz/reference/api.md).

# API

**Base URL:** `https://api.metric.xyz`

## Where the API runs

The API backend runs on AWS in Tokyo (`ap-northeast-1`), across three availability zones. Requests reach it through Cloudflare, so they enter at the Cloudflare edge nearest to you. For the lowest latency, run your client in or near `ap-northeast-1`.

## Authentication

The maker quote endpoint requires a Bearer token:

{% code overflow="wrap" %}

```
Authorization: Bearer <your_trading_api_key>
```

{% endcode %}

{% hint style="info" %}
Trading API keys are issued by the Metric team: [contact us](mailto:contact@metric.xyz) to request one.
{% endhint %}

Public endpoints (chains, metadata, routing, single-pool and batch bid/ask) require no authentication. On routing and bid/ask, a key is optional: it raises your rate limit.

{% hint style="warning" %}
If you send an `Authorization` header to a public endpoint, the key must be valid. An unknown or placeholder key returns `401 {"error": "Invalid API key"}` even where no key is needed. Leave the header out if you don't have a key.
{% endhint %}

***

## Supported chains

Retrieve the list of supported chains and their numeric EVM chain IDs:

{% code overflow="wrap" %}

```
GET /public/v1/chains
```

{% endcode %}

Use the returned `chainId` values as the `{chain_id}` path parameter in all chain-specific endpoints.
