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

# Fly.io

> Inspect Fly.io apps and manage Fly Machines

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: API key.
* **Connection**: The key comes from `FLY_API_TOKEN`.
* **Docs**: [https://fly.io/docs/machines/api/working-with-machines-api/](https://fly.io/docs/machines/api/working-with-machines-api/)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable        | Required | Description                                                                                                                              |
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `FLY_API_TOKEN` | Yes      | Fly.io access token (create with 'fly tokens create org' or in the dashboard under Tokens) [Docs](https://fly.io/docs/security/tokens/). |

## Setup

1. **Sign up for Fly.io**: Go to [https://fly.io](https://fly.io) and create an account (the pay-as-you-go plan with a small test app is sufficient; new accounts include trial credit).
2. **Create an access token**: Run 'fly tokens create org -o \<org-slug>' with flyctl, or create a token in the dashboard under Account > Access Tokens ([https://fly.io/dashboard/personal/tokens](https://fly.io/dashboard/personal/tokens)). Org tokens are preferred over personal auth tokens.
3. **Set the environment variable**: Add the token to your .env as FLY\_API\_TOKEN=...
4. **Verify access**: Run List Apps with your org slug (use 'personal' for the default personal organization), then List Machines on one of the apps.

* The public Machines API endpoint is [https://api.machines.dev](https://api.machines.dev); tokens are sent as 'Authorization: Bearer \<token>'
* org\_slug is required when listing apps
* Tokens created with 'fly tokens create' may include a 'FlyV1 ' prefix in CLI output - store only the token value; the API accepts it after Bearer either way

Provider API reference: [https://fly.io/docs/machines/api/](https://fly.io/docs/machines/api/)

## Tools

| Tool          | Access | Description                                                     |
| ------------- | ------ | --------------------------------------------------------------- |
| List Apps     | Read   | List apps in a Fly.io organization                              |
| Get App       | Read   | Get details about an app, including its organization and status |
| List Machines | Read   | List Machines of an app with their states                       |
| Get Machine   | Read   | Get a Machine by ID, including its config and state             |
| Start Machine | Write  | Start a stopped Machine                                         |
| Stop Machine  | Write  | Stop a running Machine                                          |

## Example prompts

* List the Machines of my Fly.io app grouped by state and region.
* Find the started Machines of my Fly.io app and stop the one I specify.
