Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
"sprite-maintenance"
]
},
{
"group": "Sprites 2 (beta)",
"pages": [
"sprites-2/overview",
"sprites-2/getting-started"
]
},
{
"group": "Concepts",
"pages": [
Expand Down
182 changes: 182 additions & 0 deletions sprites-2/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
---
title: Get started with Sprites 2
sidebarTitle: "Getting started"
description: "Create your first Sprites 2 Sprite, run commands in it, open a shell and put a web app online, using SSH or the HTTP API."
---

<Warning>
Sprites 2 is in public beta. This page applies only to Sprites 2. For Sprites 1, see the [Quickstart](/quickstart).
</Warning>

This guide walks you through creating a Sprite, running a command in it, opening a shell, serving a web page and cleaning up. Every step shows both ways to control Sprites 2: SSH and the HTTP API.

## Before you begin

You need:

- A Fly.io organization with access to Sprites 2. See [Get access](/sprites-2/overview#get-access).
- An SSH client, for the SSH examples.
- An organization token, for the HTTP API examples. Create one in the Fly.io dashboard at `fly.io/dashboard/ORG/sprites`.

{/* TODO(confirm): Jason said the `sprite` CLI works with Sprites 2 if you log in to the Sprites 2 org (19 Nov). Document it for the beta, or keep this page to SSH and the API like the Sprites 2 reference does? */}

The examples use `my-org` as the organization slug. Replace it with your own.

## Two ways to control Sprites

**SSH.** Send commands to your organization's control plane at `my-org@sprites.dev`. There's nothing to install:

```bash
ssh my-org@sprites.dev sprite list
```

The first time you connect with a new SSH key, you're asked to approve it. An approved key can act for your whole organization.

{/* TODO(confirm): Jason, 23 Nov: "the ssh key is just setup for them". The ssh docs@sprites.dev reference mentions first-time approval for an unapproved key. Reword the sentence above once we know what users actually see. */}

There are two SSH addresses:

| Address | Connects to |
|---------|-------------|
| `my-org@sprites.dev` | The control plane, for commands that manage Sprites |
| `NAME--CLUSTER--my-org@sprites.dev` | The inside of one Sprite, for a shell, SCP, SFTP or Git |

**HTTP API.** For apps and scripts, use the JSON API. Set these variables once, and the examples on this page use them:

```bash
export SPRITES_TOKEN=... # your organization token
API=https://api.sprites.dev/v1
AUTH="Authorization: Bearer $SPRITES_TOKEN"
BETA="Sprites-Api-Beta: 2026-12-01"
JSON="Content-Type: application/json"
```

{/* TODO(confirm): API base URL after the AWS cutover. Change it here and in the overview page only. */}

The full API is described in OpenAPI at `https://api.sprites.dev/v1/openapi.json`.

<Warning>
The Sprites 1 OpenAPI document at `https://api.sprites.dev/openapi.json` describes a different API. Use the `/v1/openapi.json` document for Sprites 2.
</Warning>

## Create and use a Sprite

<Steps>
<Step title="Create a Sprite">
<CodeGroup>
```bash SSH
ssh my-org@sprites.dev sprite create dev
```

```bash HTTP API
curl -sS -X POST "$API/sprites" -H "$AUTH" -H "$BETA" -H "$JSON" \
-d '{"name":"dev"}'
```
</CodeGroup>

The command returns once the Sprite is running. It starts from the Sprites base image: Ubuntu with a `sprite` user, `sudo` and common tools.
</Step>

<Step title="Run a command">
<CodeGroup>
```bash SSH
ssh my-org@sprites.dev sprite exec dev 'uname -a && pwd'
```

```bash HTTP API
curl -sS -X POST "$API/sprites/dev/exec" -H "$AUTH" -H "$BETA" -H "$JSON" \
-d '{"argv":["/bin/sh","-lc","uname -a && pwd"]}'
```
</CodeGroup>
</Step>

<Step title="Open a shell">
Connect straight to the Sprite. `default` is the name of the cluster the Sprite was created in.

```bash
ssh dev--default--my-org@sprites.dev
```

SCP and SFTP work at the same address:

```bash
scp ./app.tar dev--default--my-org@sprites.dev:/tmp/app.tar
```
</Step>

<Step title="Put a web page online">
In the Sprite's shell, register a service on port 8080. A service named `http` is the Sprite's main web server:

```bash
sprite-env service register http --port 8080 --protocol http -- python3 -m http.server 8080
```

The Sprite's URL is `https://dev-ORGCODE.sprites.app/`. Run `sprite get dev` to see the exact URL. The URL is private, so only your organization can open it: a browser signed in to Fly.io, or a request with your token.

To make it public:

```bash
ssh my-org@sprites.dev sprite update dev --public
```

Every other service you register gets its own URL in the form `https://SERVICE--SPRITE--CLUSTER--ORG.sprites.app/`, and you make each one public separately.
</Step>

<Step title="Check its status">
<CodeGroup>
```bash SSH
ssh my-org@sprites.dev sprite get dev
```

```bash HTTP API
curl -sS "$API/sprites/dev" -H "$AUTH" -H "$BETA"
```
</CodeGroup>

The response shows the Sprite's status, URL and configuration. When nothing has used it for a while, the Sprite goes to sleep, and the next request or command wakes it.

| State | SSH | HTTP API |
|-------|-----|----------|
| Running | `running` | `running` |
| Stopped, quick to wake | `warm_stopped` | `warm` |
| Stopped, disk only | `stopped` | `cold` |
</Step>

<Step title="Delete it">
<CodeGroup>
```bash SSH
ssh my-org@sprites.dev sprite delete dev
```

```bash HTTP API
curl -sS -X DELETE "$API/sprites/dev" -H "$AUTH" -H "$BETA"
```
</CodeGroup>

<Warning>
Deleting a Sprite is permanent. Take a checkpoint before anything risky.
</Warning>
</Step>
</Steps>

## Check responses for errors

Commands that change a Sprite, such as create, start, stop, exec, checkpoint and fork, stream their results as one JSON object per line. They return HTTP 200 even when they fail, so an error can arrive inside the stream:

```json
{"type":"error","error":{"code":"exec_timeout","message":"Command timed out.","request_id":"GN4c..."}}
```

Read to the last line and check for `"type":"error"`. When an error includes a `request_id`, include it when you report a problem.

Errors that happen before the stream starts use normal HTTP status codes, such as `401` for a bad or expired token, `404` for an unknown Sprite and `429` when you're rate limited.

<Tip>
When you pipe SSH control plane output into `jq`, use `ssh -T`. Forcing a terminal with `ssh -t` can garble the output.
</Tip>

## Next steps

- Read the [Sprites 2 overview](/sprites-2/overview) for limits and what's not in the beta yet.
- Try the [Sprites 2 feature guides](https://sprites2-docs.fly.dev/) for forking, private networking, egress policies, scoped tokens and more.
- Run `ssh docs@sprites.dev` for the complete Sprites 2 reference. You don't need an account.
124 changes: 124 additions & 0 deletions sprites-2/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
title: Sprites 2 beta
sidebarTitle: "Overview"
description: "Sprites 2 is the next version of Sprites, in public beta. Learn what's new, how it differs from Sprites 1, how to get access, and the limits that apply during the beta."
---

<Warning>
Sprites 2 is in public beta. Features and limits can change before general availability. The pages in this section apply only to Sprites 2. The rest of these docs describe Sprites 1.
</Warning>

Sprites 2 is a new version of Sprites, rebuilt on new infrastructure. A Sprite is still a persistent Linux environment that sleeps when nothing is using it and wakes when work arrives. Sprites 2 adds per-service URLs, a private network between Sprites, forking from checkpoints, custom container images and finer control over tokens and outbound traffic.

## What's new in Sprites 2

- **Per-service URLs.** Each named service in a Sprite can get its own public or private URL. Sprites handles the port mapping, so you don't need a reverse proxy.
- **Internal network.** Sprites can reach each other over HTTP and TCP, but only through grants you set up for each service.
- **Forking.** Checkpoint a Sprite once, then fork that checkpoint into many independent Sprites. A fork copies the disk, not memory or running processes.
- **Your own container image.** Create a Sprite from any public or private image URL, including images that run systemd, such as NixOS.
- **Durable and ephemeral disks.** Keep state on a durable disk that checkpoints and forks, or use an ephemeral disk that resets on every cold start.
- **Always-on Sprites.** Turn off auto-sleep so a Sprite keeps running until you stop it.
- **Scheduled wake-ups.** Run a command on a schedule. A sleeping Sprite wakes for the run and goes back to sleep afterward.
- **SSH control plane.** Manage Sprites with plain SSH, with no CLI to install, and open shells or use SCP, SFTP, rsync and Git with your existing SSH tools.
- **Scoped tokens.** Mint narrower, shorter-lived tokens from an organization token for each agent or customer, and revoke each one on its own.
- **Strict egress policies.** Allow or deny outbound connections for each Sprite, up to blocking all outbound traffic.

## How Sprites 2 differs from Sprites 1

If you already use Sprites 1, check these before you move work over:

- **The API is different.** Sprites 2 has its own OpenAPI description at `https://api.sprites.dev/v1/openapi.json`. Some Sprites 1 endpoints don't exist in Sprites 2, including `fs/read` and `fs/list`.
{/* TODO(confirm): API hostname after the AWS cutover. Keep the base URL in this one place if it changes. */}
- **No `/proxy` endpoint.** Use per-service URLs, or forward a local port with `ssh -L` for things like login flows that expect `localhost`.
- **Memory is billed differently.** See [Pricing](#pricing).
- **One root disk.** Each Sprite has one durable root disk. OS updates, installed software and your data all live on it. There's no separate data disk yet.
{/* TODO(confirm): a separate /data disk is on the boundary doc's in list, but Jason said on 9 Nov it isn't built. Does it ship for the beta? */}
- **One region.** Sprites 2 runs in North America only, in Virginia (`iad`). You can't choose a region yet.
- **No migration tool.** There's no automatic way to move a Sprite from Sprites 1 to Sprites 2. Create a new Sprite and copy over what you need.

## Get access

Sprites 2 is opt-in during the beta.

To use Sprites 2 through the API, send the `Sprites-Api-Beta: 2026-12-01` header with every request:

{/* TODO(confirm): Jason, 23 Nov: the header requirement "probably could be relaxed before GA". Org opt-in and SSH/CLI: "no good answer yet". */}

```bash
curl -sS "https://api.sprites.dev/v1/sprites" \
-H "Authorization: Bearer $SPRITES_TOKEN" \
-H "Sprites-Api-Beta: 2026-12-01"
```

## Limits during the beta

| Limit | Value |
|-------|-------|
| Default size | 8 CPUs, 4 GB RAM, 100 GB disk |
| Maximum size | 16 vCPUs, 32 GB RAM |
| Durable root disk | Up to 1 TB |
| Ephemeral disk | Up to 100 GB |
| Checkpoints kept | The last 100 for each Sprite |
| Checkpoint, restore and fork operations | 30 per minute |
| Fork depth | 8 ancestors |
| Live forks from one checkpoint | 10,000 |
| Concurrent exec sessions | 32 for each Sprite |
| Suspend (saving memory) | Sprites with 16 GB of memory or less |
| Token lifetime | 365 days at most |
| Connector request body | 32 MB |
| Region | Virginia (`iad`) only |

Forks stay within the organization that owns the checkpoint.

A Sprite with more than 16 GB of memory can stop, but it can't suspend and resume its memory.

## Pricing

Usage is billed per second, with no minimum. CPU, memory and hot storage bill while a Sprite is awake, so a sleeping Sprite costs only its stored data.

| Resource | Rate |
|----------|------|
| CPU time | $0.0385 per CPU-hour |
| Memory | $0.021875 per GB-hour |
| Hot storage, while the Sprite is awake | $0.000683 per GB-hour ($0.50 per GB-month) |
| Cold storage, for as long as you keep it | $0.000027 per GB-hour ($0.02 per GB-month) |

{/* TODO(confirm with Gary before launch): rates copied from fly.io/pricing (Sprites section) on 23 Nov. Matt and Jason confirmed S2 uses them "for the time being"; rates are set in Metronome and Gary is firming them up for launch, so they might change. */}

How memory is billed depends on how much a Sprite has:

- **Up to 16 GB:** billed on the memory the Sprite's VM uses, including its kernel.
- **More than 16 GB, up to 32 GB:** billed on the memory you request, for every second the Sprite runs, whether or not it's in use.

{/* Matt asked for "on request" wording, not "reservation", so it isn't confused with Machines reservations. Jason confirmed 23 Nov that Sprites over 16 GB can be created, up to 32 GB. */}
{/* TODO(confirm with Jason): his 23 Nov pricing notes say a Sprite is also billed at its full size "on a host without dynamic memory". Can that happen to beta users? If so, say so here. */}

Cold storage covers everything a Sprite keeps on disk, including its checkpoints and any saved suspend image. Ephemeral disks don't count toward storage.

To see the current list prices for your organization, run:

```bash
ssh my-org@sprites.dev pricing
```

## Not in the beta

These aren't part of Sprites 2 yet:

- EU region and choosing a region
- Custom domains
- A static outbound IP for each Sprite
- Sharing checkpoints across organizations
- A guaranteed time a Sprite stays awake
- A setting for the maximum time a Sprite stays awake
- Moving a Sprite from Sprites 1 to Sprites 2 automatically
- Private connections to Fly Machines and Managed Postgres
- Header-based routing to Sprites
- Bring your own cloud (BYOC)

## Learn more

- [Sprites 2 feature guides](https://sprites2-docs.fly.dev/) walk through each feature with examples.
- Run `ssh docs@sprites.dev` for the full Sprites 2 reference, written for people and agents. You don't need an account.
- [Get started with Sprites 2](/sprites-2/getting-started) walks you through your first Sprite.
{/* TODO: add where to report beta problems. Asked 23 Nov, no answer yet. */}
Loading