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

# Let an agent sign you up for Fly.io

> Let an AI agent create your Fly.io account, or connect to the one you have, and get its own 24-hour credentials. You confirm with one link and one code.

**An AI agent can sign you up for Fly.io, or connect to your existing account, and get its own credentials to deploy for you. Your part is to open one link and enter one code. This page explains what happens, what the agent can do, and how to disconnect it.**

Fly.io follows the [auth.md](https://github.com/workos/auth.md) spec for agent registration. The steps for agents are at [https://fly.io/auth.md](https://fly.io/auth.md).

## How it works

1. You ask your agent to set up Fly.io for you. It asks which email address to use.
2. The agent registers with that address and shows you a link and a 6-digit code.
3. You open the link and confirm your email address with GitHub, Google or an emailed link. If you don't have an account yet, you name it and create it on the same page.
4. You enter the code.
5. The agent collects its credentials and can start working.

The agent has 10 minutes after you enter the code to collect its credentials. If it doesn't, you can start again.

## Try it

Give your agent a prompt like this one:

> Read [https://fly.io/auth.md](https://fly.io/auth.md) and create an account for me.

Then follow the agent's prompts.

## What the agent can do

The agent gets access to your personal Fly.io organization and your Sprites:

* **Fly.io:** your apps, Machines, volumes, secrets and deploys. It can use [flyctl](https://docs.fly.io/flyctl) and the [Machines API](https://docs.fly.io/machines/api).
* **Sprites:** create and manage your Sprites.

It can't:

* Invite or remove organization members.
* Change billing.
* Change how people sign in to your account.

The agent's credentials last 24 hours, and the agent renews them as it works.

## New accounts and the Free plan

If the agent creates a new account, it starts on the [Free plan](https://docs.fly.io/about/free-plan.md), with \$1 of credit and no credit card needed. Confirming your email address on the claim page makes the credit available. To get \$5 of usage every month, add a card.

## Disconnect an agent

To disconnect an agent, revoke any of its tokens. In the dashboard, open your organization's **Tokens** page or your personal tokens page. The agent appears as **Agent (auth.md)**.

* Fly.io access stops right away.
* Sprites access stops within 24 hours.

An agent that's claimed but hasn't collected its credentials yet is listed too, with a **Disconnect** button.

You can also revoke a token with [`fly tokens revoke`](https://docs.fly.io/flyctl/cmd/fly_tokens_revoke).

## For agent developers

The full steps are in [https://fly.io/auth.md](https://fly.io/auth.md), under **Agentic registration**. In short:

| Step | Request |
| - | - |
| Discover | `GET /.well-known/oauth-authorization-server`. Look for the `agent_auth` block. Without it, agent registration is off |
| Register | `POST /agent/identity` with `{"type": "service_auth", "login_hint": "<email>"}` |
| Claim | Show the user the `verification_uri` and `user_code`, then poll `POST /oauth2/token` with the claim grant |
| Refresh | `POST /oauth2/token` with the JWT bearer grant and your `identity_assertion` |
| Revoke | `POST /oauth2/revoke` with `token=<access_token>` |

Fly.io supports the `service_auth` method only.

The credentials include:

* `access_token`: a `FlyV1 fm2_...` token. Use it as `FLY_API_TOKEN` for flyctl, or as `Authorization: Bearer <access_token>` with the Machines API.
* `sprites_token` and `sprites_api`: for the [Sprites API](https://docs.sprites.dev).
* `identity_assertion`: to refresh both.

Store them in a file only your agent can read, outside any repository, and never print or log them.

## Related reading

* [Sign up and sign in to Fly.io](https://docs.fly.io/getting-started/sign-up-sign-in.md)
* [Fly agent setup](https://docs.fly.io/model-context-protocol/setup-agent.md), if you already have an account
* [Access tokens](https://docs.fly.io/security/tokens.md)
* [Fly.io Free Plan](https://docs.fly.io/about/free-plan.md)
