Skip to content
Merged
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
74 changes: 58 additions & 16 deletions api-reference/error-codes.mdx

Large diffs are not rendered by default.

22 changes: 15 additions & 7 deletions api-reference/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@ title: API introduction
description: Base URL, authentication, errors, and common response formats.
type: explanation
audience: user
verified: 2026-11-15
product_version: 0.77.0
verified: 2026-11-25
product_version: 0.90.0
executable: false
---

## What it is

The `agentsfleet` API lets your software create, inspect, and control fleets. Send requests to `https://api.agentsfleet.net`.

The linked OpenAPI file describes every path, request body, response, and status code.
The OpenAPI file lists the available routes, inputs, responses, and status codes.

## Why it exists

Use the API when a script or service needs direct access. Use the command-line client for interactive terminal work.

## How it behaves

### Authenticate

Most paths accept a bearer token in the `Authorization` header. Tenant API keys start with `agt_t` and are shown once when created.

The dashboard's **Security** page combines account API keys and active sessions.
Your account avatar shows the current image when available, with your email on hover.
Manage keys and active sessions on the dashboard's **Security** page.

Key lists show a recorded four-character suffix for recognition; older keys can have no recorded suffix.
The suffix cannot authenticate a request, and the original key cannot be recovered from it.
Expand All @@ -41,6 +42,8 @@ After that ceiling, session verification returns HTTP `503` with `UZ-AUTH-004` u

Webhook and connector paths use provider signatures instead of bearer tokens. The OpenAPI security section on each operation states the required method.

### List fleets

To list fleets, copy `<WORKSPACE_ID>` from `agentsfleet workspace list`.
Replace `<API_KEY>` with a key that has `fleet:read` access to that workspace.
Create keys under **Settings → Security → Create API key** in the dashboard.
Expand All @@ -53,11 +56,14 @@ curl "https://api.agentsfleet.net/v1/workspaces/<WORKSPACE_ID>/fleets" -H "Autho
<varies>
```

A successful response contains `items`, `total`, and `next_cursor`.
These values depend on your workspace. A fake or expired key returns an authentication error.
Read fleets from `items`. When `next_cursor` has a value, use it to fetch the next page.

### Read an error

Errors use the HTTP problem details format. Each product error includes an `error_code`, a `request_id`, and a documentation URL.

### Identifiers and timestamps

Identifiers use version 7 Universally Unique Identifiers (UUIDs).

Timestamps are Request for Comments (RFC) 3339 strings in Coordinated Universal Time (UTC), such as `2026-10-17T18:06:49.123Z`. A whole second has no fraction, as in `2026-10-17T18:06:49Z`. Compare timestamps after parsing them, because text order is not time order.
Expand All @@ -67,6 +73,8 @@ A timestamp you send may use any RFC 3339 offset. It may carry at most milliseco
The dashboard displays timestamps in your browser's timezone.
Schedule expressions retain their declared timezone.

### Money amounts

Money amounts are whole nanodollars, written as decimal strings. One United States (US) dollar is `"1000000000"`. Every field whose name contains `_nanos` uses this form, including balances, charges, event costs, and model rates.

Except for the balance below, a nanodollar string holds digits only, with no sign, no leading zero, and no decimal point.
Expand Down
17 changes: 6 additions & 11 deletions api-reference/scopes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title: API scopes
description: Permissions that an agentsfleet access token can carry.
type: reference
audience: user
verified: 2026-11-15
product_version: 0.77.0
verified: 2026-11-25
product_version: 0.90.0
executable: false
---

Expand Down Expand Up @@ -36,8 +36,8 @@ A valid key without `fleet:read` returns this scope error. The fake token above

| Scope | Effect | Included by |
|---|---|---|
| `fleet:read` | Reads fleets, events, and memory. | `fleet:write`, `fleet:admin` |
| `fleet:write` | Creates, updates, and messages fleets. Also reads and writes your own private drafts. | `fleet:admin` |
| `fleet:read` | Reads fleets, turns, memory, and triggers. | `fleet:write`, `fleet:admin` |
| `fleet:write` | Creates and updates fleets, sends messages, and removes fleet triggers. | `fleet:admin` |
| `fleet:admin` | Deletes fleets. | None |
| `secret:read` | Lists secret names and metadata. | `secret:write` |
| `secret:write` | Creates, rotates, and deletes secrets. Deleting a secret named for a connector also needs `connector:write`. | None |
Expand All @@ -50,23 +50,18 @@ A valid key without `fleet:read` returns this scope error. The fake token above
| `connector:write` | Starts a connector setup flow and disconnects a connector, including by deleting its secret. | None |
| `billing:read` | Reads the tenant balance and charges. | None |
| `workspace:admin` | Creates and lists workspaces. | None |
| `plugin:write` | Publishes a reviewed draft as an account-owned Plugin or revision, and removes a Plugin your account owns. | None |
| `approval:read` | Reads pending approvals. | `approval:resolve` |
| `approval:resolve` | Approves or denies a request. | None |

`agentsfleet fleet approvals` uses these scopes. Listing needs `approval:read`; approving or denying needs `approval:resolve`.
List pending requests with `approval:read`. Approving or denying also needs a person's signed-in session and `approval:resolve`.

Operator tokens may carry `runner:*`, `platform-key:*`, `model:*`, or `workspace:any`. Tenant integrations do not need these scopes.

`plugin:write` replaces `library:write`. Platform library publication and its scopes are removed, with no compatibility aliases.

## Errors

### UZ-AUTH-022: Insufficient scope

The token lacks the scope named in `detail`. Create a new key with that scope, then retry the request.

Do not add unrelated scopes. A narrower key limits the effect of a leaked key.
Read the missing scope in `detail`. Use a credential that has that scope and only the other permissions your task needs.

## Related pages

Expand Down
144 changes: 29 additions & 115 deletions billing/budgets.mdx
Original file line number Diff line number Diff line change
@@ -1,151 +1,65 @@
---
title: Fleet budgets
description: Daily and monthly spending limits for one fleet.
title: Credits and usage
description: Understand how fleet runs spend your account balance and read usage.
type: explanation
audience: user
verified: 2026-11-15
product_version: 0.77.0
verified: 2026-11-25
product_version: 0.90.0
executable: false
---

## What it is

A fleet budget limits how much one fleet can spend. The fleet author sets the budget in `budget` under `config["x-agentsfleet"]` in the fleet's Definition.

```json
{
"budget": {
"daily_nanos": "5000000000",
"monthly_nanos": "29000000000"
}
}
```

Each limit is a decimal string of whole nanodollars. One dollar is `"1000000000"`, so the example allows 5 dollars a day and 29 dollars a month.

`daily_nanos` is required. `monthly_nanos` is optional; leave it out for no monthly limit.
An account has one credit balance shared by its workspaces. Each fleet run records model usage and time. The account that owns the fleet's workspace pays these charges.

## Why it exists

Every workspace in one account shares the same credit balance. A fleet budget stops one fleet from draining that shared balance.

Open the account menu to see your available balance and choose **Usage** for recorded charges.
The expanded desktop sidebar also shows a **Credits** link to Usage.

The fleet owns its budget. Applying a reviewed setup change replaces the limits, and deleting the fleet removes them.
The balance lets you track and limit total account spending. Open **Usage** from the account menu or use the **Credits** link in the desktop sidebar.

## How it behaves

The daily limit covers a rolling 24-hour window. The monthly limit covers one Coordinated Universal Time (UTC) calendar month.

`agentsfleet` checks the limits before a run and while the run continues. A reached limit blocks new work and stops an active run at its next billing check.

A blocked event does not retry. Raise the limit in an improvement chat, apply the change, and send a new event.
### How a run is charged

The fleet, memory, and activity stream survive a budget stop. A stopped run has no final result.
The server checks the account balance before assigning a run and checks it again during the run. It records model requests and runtime as separate charge lines.

### What a budget counts
When you use the platform model, agentsfleet charges for model usage and runtime. When you use your own provider key, the provider bills its tokens and agentsfleet charges for runtime.

A budget counts only the fleet's own runs. The setup chat that wrote or changed the fleet is charged to the workspace owner's balance, not to the fleet's budget.

While billing is available, a limit is checked before each run and at each renewal while it runs. A run already in progress can pass its limit by up to one renewal of usage before it stops.

If billing cannot answer, work continues and can exceed that bound. The full charge is settled later.
Stopping a run ends its remaining work. Usage it already recorded is still charged.

### Review your spending

Open **Usage** in the account menu to see confirmed charges across your account's workspaces.
These are called **settled charges**.

Choose a named month, such as **November 2026**, or **Last 7 days**, then filter by fleet.
**All Fleets** includes setup usage and saved-fleet usage; individual fleets follow it in the dropdown.

The dashboard displays report ranges in your browser's timezone.

The totals cover all matching usage in the selected period.
**By fleet** groups settled charges by fleet and shows its recorded models.

**Daily spend** shows complete daily totals from the report, including days with no settled charges.
The server supplies complete UTC calendar buckets; the browser formats the displayed range bounds.

Setup usage never exposes private draft titles or messages.

Input tokens are pieces of text the model reads; output tokens are pieces it writes.
The report retains recorded model identities and exact charges.
When a model name is unavailable, Usage shows its recorded identifier.
Choose a period and fleet in **Usage**. **By fleet** groups costs across your workspaces, and **Daily spend** shows daily totals. Charges retain the fleet name recorded at the time.

Each report includes charges confirmed by the time it was opened.
Pending usage stays outside its totals; newer reports can include charges confirmed later.
Missing usage information does not mean that usage was free.
Read the current balance and usage from the terminal.

Changing a filter starts a new report.

If loading fails, use **Retry report**.
A loading error is shown as an error, rather than as zero spending.
```bash
agentsfleet usage show
```

Usage has no Add credit action while its design is being prepared.
```text
<varies>
```

### Read charges through the API

<Note>
The reporting API changes below are coming soon.
Upgrade the dashboard and server together before using the updated response.
The API reference still describes the current server.
</Note>

`GET /v1/tenants/me/billing/reports/current` returns the report.
The report accepts `period`, `fleet_id`, `activity_type` and `through_at`.

`period` defaults to `month`; `today` and `week` select today or seven calendar days.
Reporting periods use UTC, and `through_at` is an inclusive cutoff that defaults to now.
The report covers every whole UTC day through that cutoff.

A current-month request omits `through_at`.
To read a past month, set `through_at` to that month's last UTC millisecond.

Omit fleet and activity filters to include fleet work and setup usage.
`fleet_id` selects one fleet's runtime usage; `activity_type=setup` selects setup usage.
Use `activity_type=runtime` for fleet work only.

Read settled daily amounts from `daily` and fleet/model groups from `spending`.
Period and fleet totals include `activity_count`; daily and model totals omit it.
Each activity counts one settled fleet run or setup attempt.
| Request | Result |
|---|---|
| `GET /v1/tenants/me/billing` | The account balance |
| `GET /v1/tenants/me/billing/reports/current` | Totals, groups by fleet, and daily amounts |
| `GET /v1/tenants/me/billing/charges` | Individual recorded charges, newest first |

`agentsfleet` records each provider request and each billed stretch of runtime separately.
`GET /v1/tenants/me/billing/charges` returns those individual records.
Both billing reads require `billing:read` and use your signed-in account.
These requests need `billing:read`. The report accepts `period`, `fleet_id`, `activity_type`, and `through_at`. Use `runtime` if you set `activity_type`.

Use the response's `next_cursor` as `cursor` for later charge pages.
`limit` defaults to 50 records and accepts 1 through 200.

Some older charges combine model use and run time in one amount.
The API keeps that recorded amount because separate historical prices are unavailable.

Each request is priced at the rate in effect when it was made, and at the tier its whole prompt falls in. Cached reads, cache writes, and output each use their own rate.

Each token category on a line is rounded up to a whole nanodollar on its own. A line can cost at most one nanodollar more per category than the exact amount, and never less.

Under a self-managed provider key, your provider bills the tokens and `agentsfleet` charges run time only.

Charges recorded during a billing outage settle once billing answers again.

Settlement charges the full amount and can take your balance below zero. New credit repays that debt before any remainder becomes spendable.
Periods use Coordinated Universal Time (UTC). `through_at` is an inclusive cutoff. Amounts are integer nanodollar strings, with 1,000,000,000 nanodollars per dollar.

## Limits

| Field | Default | Unit | Valid range |
|---|---|---|---|
| `daily_nanos` | None; required | Nanodollars per rolling 24 hours | `"1"` through `"1000000000000"`, which is `$1,000` |
| `monthly_nanos` | None | Nanodollars per UTC month | `"1"` through `"10000000000000"`, which is `$10,000` |

Zero, signs, decimal points, exponents, and numbers outside the range are refused. A JSON number in place of the string is refused too.

An invalid budget blocks review and Save with `UZ-REQ-001`. A stored budget that cannot be read blocks the next run.
One balance covers all fleets in the account. Parallel runs can spend more before the next balance check, and a charge can take the account below zero.

`UZ-RUN-015` marks a budget stop during a run.
The event's recorded failure class is `budget_breach`.
New work is refused when the balance falls below the required floor. Credit added later first repays outstanding charges.

## Related pages

- [Author a fleet](/fleets/authoring)
- [Model providers](/fleets/model-providers)
- [Fleet overview](/fleets/overview)
- [Error codes](/api-reference/error-codes)
18 changes: 18 additions & 0 deletions changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ description: "Product changes and upgrade notes."
agentsfleet is in **stealth-mode testing** and pre-production. APIs and agent behavior may change between releases without long deprecation windows. Email [agentsfleet@agentmail.to](mailto:agentsfleet@agentmail.to) if you want a hand calibrating an agent or to join as a design partner.
</Tip>

<Update label="Nov 25, 2026" tags={["Bug fixes", "CLI"]}>
## New fleet model and Orbit controls

When a default model is available, New fleet names it before you send the first message.

## API reference

- **Fleet creation** — Send the first message in `POST /v1/workspaces/{workspace_id}/fleets` to start a fleet.

## Bug fixes

- **Model selection** — The composer uses the workspace owner's selection. If the owner has no selected model, it uses the shared platform default.

## CLI

- **Orbit** — Collect stars, build a rally, and toggle arcade sounds with **S**. See the [game controls](/cli/agentsfleet#terminal-pet).
</Update>

<Update label="Nov 24, 2026" tags={["Upgrading", "Breaking"]}>
## One clock for runners

Expand Down
Loading
Loading