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

# OpenRouter

> Connect OpenRouter with a management key so OPTIMAZE can import spend and token usage by model.

Connect OpenRouter to OPTIMAZE with a management API key. OPTIMAZE imports spend and token usage by model, alongside your other AI providers.

> [!NOTE]
>
> OpenRouter is in beta. The tile on the **Integrations** page is marked **Beta**.

## Prerequisites

* Permission to create management keys in OpenRouter.

## Set up the OpenRouter integration

**1. Create a management key in OpenRouter**

1. In OpenRouter, open **Settings**, then **Management Keys**.
2. Create a management key. A regular API key cannot read activity.

**2. Enter the details in OPTIMAZE**

Under **Data**, select **Integrations**. On the **OpenRouter** tile, select **Connect**, then fill in the form.

| Field | What to enter |
| :- | :- |
| **Management API key** | The OpenRouter management key |
| **Display name (optional)** | A name to tell this connection apart from others |

**3. Connect**

Select **Connect**.

## What happens next

When you select **Connect**, OPTIMAZE runs a connection check before it starts importing. Each part of the check shows as passed, failed or not checked, and a later part is not checked when an earlier one fails.

| Check | What it confirms |
| :- | :- |
| **Authentication** | The credentials were accepted |
| **Access** | The credentials can read billing and usage data |
| **Required objects** | Anything you had to create in your own account exists. Not checked for providers that need nothing beyond credentials |
| **Data available** | There is cost data to import |

Once the check passes, the integration appears under **Connected** on the **Integrations** page. OPTIMAZE imports the previous six months of history on the first sync, and each later sync re-reads the last three days to pick up late changes.

OpenRouter keeps only 30 days of activity, so the first sync imports at most the last 30 days rather than six months. Older history cannot be imported.

## Troubleshooting

* **Access** fails: the key is a regular API key. Create a management key instead.
* **Older months are missing**: openRouter keeps 30 days of activity. Spend before that cannot be imported.
* **Data available** fails: OpenRouter has no cost data for the period yet. Wait for OpenRouter to report usage, then connect again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.