> ## 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.

# Fastly

> Connect Fastly with an API token so OPTIMAZE can import invoiced and month-to-date costs.

Connect Fastly to OPTIMAZE with an API token. OPTIMAZE imports invoiced costs and the current month's costs to date, and stores a cost only when Fastly returns a dollar amount.

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

## Prerequisites

* A Fastly user with the Billing or Superuser role.

## Set up the Fastly integration

**1. Create an API token in Fastly**

1. Sign in to Fastly as a user with the Billing or Superuser role.
2. Open **Account**, then **API tokens**.
3. Create a token with the `global:read` scope.

**2. Enter the details in OPTIMAZE**

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

| Field | What to enter |
| :- | :- |
| **API token** | The Fastly token with the `global:read` scope |
| **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.

The current month is imported as a month-to-date figure and changes until Fastly issues the invoice.

## Troubleshooting

* **Authentication** fails: the token is wrong, revoked or expired.
* **Access** fails: the token is missing `global:read`, or was created by a user without the Billing or Superuser role.
* **Data available** fails: Fastly has no cost data for the period yet. Wait for Fastly to report usage, then connect again.


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