@b3os/cli 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -8
- package/assets/b3os-run.py +137 -0
- package/assets/skill/b3os/SKILL.md +111 -0
- package/dist/commands/_agents.d.ts +14 -0
- package/dist/commands/_agents.js +33 -0
- package/dist/commands/_agents.js.map +1 -0
- package/dist/commands/_common.js +6 -2
- package/dist/commands/_common.js.map +1 -1
- package/dist/commands/_context.d.ts +49 -0
- package/dist/commands/_context.js +260 -0
- package/dist/commands/_context.js.map +1 -0
- package/dist/commands/_next.d.ts +39 -0
- package/dist/commands/_next.js +77 -0
- package/dist/commands/_next.js.map +1 -0
- package/dist/commands/agent.d.ts +42 -0
- package/dist/commands/agent.js +218 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/app.d.ts +2 -5
- package/dist/commands/app.js +229 -69
- package/dist/commands/app.js.map +1 -1
- package/dist/commands/auth.d.ts +70 -2
- package/dist/commands/auth.js +308 -33
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/docs.d.ts +54 -0
- package/dist/commands/docs.js +202 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/doctor.d.ts +23 -0
- package/dist/commands/doctor.js +313 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +38 -1
- package/dist/commands/init.js +259 -60
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/listen.d.ts +30 -0
- package/dist/commands/listen.js +194 -0
- package/dist/commands/listen.js.map +1 -0
- package/dist/commands/manifest.d.ts +13 -1
- package/dist/commands/manifest.js +59 -7
- package/dist/commands/manifest.js.map +1 -1
- package/dist/commands/mcp.d.ts +25 -2
- package/dist/commands/mcp.js +120 -11
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/sandbox.d.ts +35 -6
- package/dist/commands/sandbox.js +208 -9
- package/dist/commands/sandbox.js.map +1 -1
- package/dist/commands/setup.d.ts +39 -0
- package/dist/commands/setup.js +203 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/tool.d.ts +109 -1
- package/dist/commands/tool.js +635 -47
- package/dist/commands/tool.js.map +1 -1
- package/dist/config.d.ts +30 -6
- package/dist/config.js +39 -8
- package/dist/config.js.map +1 -1
- package/dist/ctx.d.ts +5 -45
- package/dist/ctx.js +25 -160
- package/dist/ctx.js.map +1 -1
- package/dist/docs/index.json +1 -0
- package/dist/docs/pages/actions/call.md +300 -0
- package/dist/docs/pages/actions/catalog/airtable.md +737 -0
- package/dist/docs/pages/actions/catalog/arxiv.md +166 -0
- package/dist/docs/pages/actions/catalog/chainalysis-sanctions.md +125 -0
- package/dist/docs/pages/actions/catalog/coingecko.md +1558 -0
- package/dist/docs/pages/actions/catalog/deps-dev.md +465 -0
- package/dist/docs/pages/actions/catalog/dexscreener.md +568 -0
- package/dist/docs/pages/actions/catalog/discord.md +784 -0
- package/dist/docs/pages/actions/catalog/finnhub.md +776 -0
- package/dist/docs/pages/actions/catalog/frankfurter.md +438 -0
- package/dist/docs/pages/actions/catalog/github.md +1853 -0
- package/dist/docs/pages/actions/catalog/gmail.md +575 -0
- package/dist/docs/pages/actions/catalog/google-calendar.md +654 -0
- package/dist/docs/pages/actions/catalog/google-drive.md +502 -0
- package/dist/docs/pages/actions/catalog/google-sheets.md +700 -0
- package/dist/docs/pages/actions/catalog/hacker-news.md +542 -0
- package/dist/docs/pages/actions/catalog/http.md +824 -0
- package/dist/docs/pages/actions/catalog/hyperliquid.md +942 -0
- package/dist/docs/pages/actions/catalog/jira.md +920 -0
- package/dist/docs/pages/actions/catalog/kalshi.md +917 -0
- package/dist/docs/pages/actions/catalog/linear.md +1030 -0
- package/dist/docs/pages/actions/catalog/markets.md +21 -0
- package/dist/docs/pages/actions/catalog/morpho.md +247 -0
- package/dist/docs/pages/actions/catalog/notion.md +1077 -0
- package/dist/docs/pages/actions/catalog/nws.md +485 -0
- package/dist/docs/pages/actions/catalog/open-meteo.md +559 -0
- package/dist/docs/pages/actions/catalog/polymarket.md +1523 -0
- package/dist/docs/pages/actions/catalog/pushbullet.md +220 -0
- package/dist/docs/pages/actions/catalog/resend.md +307 -0
- package/dist/docs/pages/actions/catalog/s3.md +513 -0
- package/dist/docs/pages/actions/catalog/sec-edgar.md +487 -0
- package/dist/docs/pages/actions/catalog/slack.md +2629 -0
- package/dist/docs/pages/actions/catalog/stripe.md +1405 -0
- package/dist/docs/pages/actions/catalog/wikipedia.md +379 -0
- package/dist/docs/pages/actions/catalog.md +46 -0
- package/dist/docs/pages/actions/limits.md +50 -0
- package/dist/docs/pages/actions/model-tools.md +225 -0
- package/dist/docs/pages/actions/packs.md +148 -0
- package/dist/docs/pages/actions/settings.md +69 -0
- package/dist/docs/pages/actions/tools.md +244 -0
- package/dist/docs/pages/actions/triggers.md +149 -0
- package/dist/docs/pages/actions.md +88 -0
- package/dist/docs/pages/compat/anthropic.md +168 -0
- package/dist/docs/pages/compat/e2b.md +194 -0
- package/dist/docs/pages/compat/firecrawl.md +138 -0
- package/dist/docs/pages/compat/openai.md +168 -0
- package/dist/docs/pages/concepts/auth.md +151 -0
- package/dist/docs/pages/concepts/beta.md +55 -0
- package/dist/docs/pages/concepts/glossary.md +71 -0
- package/dist/docs/pages/concepts/ids.md +98 -0
- package/dist/docs/pages/concepts/jobs.md +229 -0
- package/dist/docs/pages/concepts/latency.md +138 -0
- package/dist/docs/pages/concepts/limits.md +191 -0
- package/dist/docs/pages/concepts/stack.md +59 -0
- package/dist/docs/pages/concepts/timing.md +86 -0
- package/dist/docs/pages/concepts/usage.md +110 -0
- package/dist/docs/pages/design/b3os-yaml.md +370 -0
- package/dist/docs/pages/design/deploy-from-github.md +122 -0
- package/dist/docs/pages/design/observability.md +134 -0
- package/dist/docs/pages/errors.md +1824 -0
- package/dist/docs/pages/infer/chat.md +570 -0
- package/dist/docs/pages/infer/limits.md +55 -0
- package/dist/docs/pages/infer/messages.md +185 -0
- package/dist/docs/pages/infer/responses.md +173 -0
- package/dist/docs/pages/infer/settings.md +154 -0
- package/dist/docs/pages/infer/speech.md +323 -0
- package/dist/docs/pages/infer.md +154 -0
- package/dist/docs/pages/introduction.md +162 -0
- package/dist/docs/pages/platform/addresses.md +174 -0
- package/dist/docs/pages/platform/call-log.md +99 -0
- package/dist/docs/pages/platform/custom-domains.md +104 -0
- package/dist/docs/pages/platform/keys.md +79 -0
- package/dist/docs/pages/platform/limits.md +57 -0
- package/dist/docs/pages/platform/members.md +101 -0
- package/dist/docs/pages/platform/requests.md +116 -0
- package/dist/docs/pages/platform/settings.md +129 -0
- package/dist/docs/pages/platform/webhooks.md +68 -0
- package/dist/docs/pages/platform.md +67 -0
- package/dist/docs/pages/quickstart/mcp.md +94 -0
- package/dist/docs/pages/quickstart/sandbox-agent.md +205 -0
- package/dist/docs/pages/quickstart/scrape.md +134 -0
- package/dist/docs/pages/quickstart.md +45 -0
- package/dist/docs/pages/render/inspections.md +162 -0
- package/dist/docs/pages/render/limits.md +72 -0
- package/dist/docs/pages/render/screenshots.md +179 -0
- package/dist/docs/pages/render/settings.md +431 -0
- package/dist/docs/pages/render/styles.md +342 -0
- package/dist/docs/pages/render/videos.md +272 -0
- package/dist/docs/pages/render.md +118 -0
- package/dist/docs/pages/routines/callables.md +174 -0
- package/dist/docs/pages/routines/definitions.md +361 -0
- package/dist/docs/pages/routines/limits.md +117 -0
- package/dist/docs/pages/routines/runs.md +328 -0
- package/dist/docs/pages/routines/settings.md +104 -0
- package/dist/docs/pages/routines/triggers.md +339 -0
- package/dist/docs/pages/routines.md +216 -0
- package/dist/docs/pages/sandboxes/agents.md +217 -0
- package/dist/docs/pages/sandboxes/commands.md +272 -0
- package/dist/docs/pages/sandboxes/images.md +166 -0
- package/dist/docs/pages/sandboxes/limits.md +143 -0
- package/dist/docs/pages/sandboxes/ports.md +260 -0
- package/dist/docs/pages/sandboxes/settings.md +358 -0
- package/dist/docs/pages/sandboxes/snapshots.md +423 -0
- package/dist/docs/pages/sandboxes/swarms.md +146 -0
- package/dist/docs/pages/sandboxes/volumes.md +131 -0
- package/dist/docs/pages/sandboxes.md +231 -0
- package/dist/docs/pages/sdks/cli.md +121 -0
- package/dist/docs/pages/sdks/mcp.md +169 -0
- package/dist/docs/pages/sdks/python.md +146 -0
- package/dist/docs/pages/sdks/typescript.md +202 -0
- package/dist/docs/pages/sdks.md +282 -0
- package/dist/docs/pages/settings.md +33 -0
- package/dist/docs/pages/vault/limits.md +46 -0
- package/dist/docs/pages/vault.md +133 -0
- package/dist/docs/pages/vision/agent-browser.md +115 -0
- package/dist/docs/pages/vision/crawl.md +333 -0
- package/dist/docs/pages/vision/extract.md +152 -0
- package/dist/docs/pages/vision/fetcher.md +15 -0
- package/dist/docs/pages/vision/limits.md +79 -0
- package/dist/docs/pages/vision/profiles.md +111 -0
- package/dist/docs/pages/vision/proxy.md +131 -0
- package/dist/docs/pages/vision/scrape.md +356 -0
- package/dist/docs/pages/vision/sessions.md +311 -0
- package/dist/docs/pages/vision/settings.md +656 -0
- package/dist/docs/pages/vision.md +175 -0
- package/dist/errors.d.ts +129 -0
- package/dist/errors.js +326 -0
- package/dist/errors.js.map +1 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +26 -13
- package/dist/main.js.map +1 -1
- package/dist/manifest/domains.d.ts +50 -0
- package/dist/manifest/domains.js +159 -0
- package/dist/manifest/domains.js.map +1 -0
- package/dist/manifest/link.d.ts +20 -0
- package/dist/manifest/link.js +24 -0
- package/dist/manifest/link.js.map +1 -0
- package/dist/manifest/record.d.ts +1 -1
- package/dist/tool/archive.d.ts +33 -0
- package/dist/tool/archive.js +174 -0
- package/dist/tool/archive.js.map +1 -0
- package/dist/tool/calls.d.ts +46 -0
- package/dist/tool/calls.js +274 -0
- package/dist/tool/calls.js.map +1 -0
- package/dist/tool/checks.d.ts +21 -0
- package/dist/tool/checks.js +145 -0
- package/dist/tool/checks.js.map +1 -0
- package/dist/tool/elf.d.ts +19 -0
- package/dist/tool/elf.js +107 -0
- package/dist/tool/elf.js.map +1 -0
- package/dist/tool/predict.d.ts +8 -0
- package/dist/tool/predict.js +38 -0
- package/dist/tool/predict.js.map +1 -0
- package/dist/tool/ustar.d.ts +5 -0
- package/dist/tool/ustar.js +220 -0
- package/dist/tool/ustar.js.map +1 -0
- package/package.json +6 -5
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# The stack
|
|
2
|
+
|
|
3
|
+
> How B3OS sits on B3IQ, which hosts serve what, and the paths a request takes from your agent to the node and back.
|
|
4
|
+
|
|
5
|
+
Source: https://docs.beta.b3os.org/concepts/stack.md
|
|
6
|
+
|
|
7
|
+
B3OS is the runtime and automation half of a four-layer stack. B3IQ runs the bottom two layers: the GPU machines and the models on them. B3OS runs the top two inside one daemon, `b3osd`, on each B3IQ node, so the tools and the model share a machine.
|
|
8
|
+
|
|
9
|
+
| Layer | Owner | Products |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| L4 Automation | B3OS | [Routines](https://docs.beta.b3os.org/routines), [actions and triggers](https://docs.beta.b3os.org/actions) |
|
|
12
|
+
| L3 Runtime | B3OS | [Sandboxes](https://docs.beta.b3os.org/sandboxes), [vision](https://docs.beta.b3os.org/vision), [render](https://docs.beta.b3os.org/render) |
|
|
13
|
+
| L2 Inference | B3IQ | Models, reached through [infer](https://docs.beta.b3os.org/infer) |
|
|
14
|
+
| L1 Compute | B3IQ | GPU machines |
|
|
15
|
+
|
|
16
|
+
The beta runs on one node, `n1`, at one site in Eugene, Oregon.
|
|
17
|
+
|
|
18
|
+
## Hosts
|
|
19
|
+
|
|
20
|
+
| Host | What it serves |
|
|
21
|
+
|---|---|
|
|
22
|
+
| `beta.b3os.org` | The site and the dashboard (`/app`). The dashboard calls the same `/v1` paths with a session cookie. |
|
|
23
|
+
| `beta-api.b3os.org` | The API (`/v1/*`), the compatibility paths (`/compat/*`), the MCP server (`/mcp`), `/openapi.json` and the CLI's device login. |
|
|
24
|
+
| `usercontent.b3os.org` | Bytes you control and nothing else: render artifacts behind signed URLs, and sandbox port previews. It never sets or reads cookies. |
|
|
25
|
+
| `docs.beta.b3os.org` | These docs and the canonical `llms.txt`. |
|
|
26
|
+
|
|
27
|
+
`api.b3os.org` and `docs.b3os.org` belong to the production B3OS app, not to this beta.
|
|
28
|
+
|
|
29
|
+
## Three ways in
|
|
30
|
+
|
|
31
|
+
```mermaid
|
|
32
|
+
flowchart LR
|
|
33
|
+
A[Agent anywhere] -- HTTPS + API key --> E[beta-api.b3os.org edge]
|
|
34
|
+
E -- 60-second node token --> N[b3osd on node n1]
|
|
35
|
+
S[Agent in a sandbox] -- vsock, no key --> N
|
|
36
|
+
N --> M[Model on the same node]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Through the edge.** Your request reaches `beta-api.b3os.org`, a Cloudflare Worker that checks your key, scopes and limits. It mints a single-use node token that lives 60 seconds and forwards the request to the node over B3OS's own tunnel. The node never sees your API key. Operations about your account (keys, usage, limits, organizations, projects, sign-in and the pack registry) are answered by the edge itself.
|
|
40
|
+
|
|
41
|
+
**From inside a sandbox.** Code in a sandbox calls `http://127.0.0.1:7700`. A proxy in the microVM carries the call over vsock straight to `b3osd`, with no network in between. Whatever credentials the code sends are discarded: the call runs as the sandbox's own principal, with only the scopes its [grant](https://docs.beta.b3os.org/sandboxes/agents) names. Account operations are not on the node, so they answer [`421 edge_only`](https://docs.beta.b3os.org/errors#edge_only) there; call `beta-api.b3os.org` for those.
|
|
42
|
+
|
|
43
|
+
**On the node itself.** B3OS's own tools on the host use a Unix socket. Customers do not reach the host directly.
|
|
44
|
+
|
|
45
|
+
## Inside the node
|
|
46
|
+
|
|
47
|
+
`b3osd` hosts every product in one process and dispatches between them in memory, so a routine step that calls vision or a sandbox does not go back out to the network. Browsers, the video recorder and the speech model run as separate services the daemon talks to over local sockets.
|
|
48
|
+
|
|
49
|
+
Some properties every product shares:
|
|
50
|
+
|
|
51
|
+
- **Warm pools.** Requests claim things that already exist: pre-started browsers and browser contexts, restored microVM slots, compiled plans. Nothing heavy starts on the request path.
|
|
52
|
+
- **One egress guard.** Every outbound request you can steer (scrapes, browser navigation, routine HTTP steps, action calls, webhook deliveries, sandbox traffic) resolves the address once, connects to that address, and refuses loopback, private networks, the node's own addresses and cloud metadata. Redirects are checked at every hop.
|
|
53
|
+
- **Fenced from B3IQ.** B3OS runs on its own set of CPU cores with its own memory, disk and network budgets, so tool work and model serving do not compete for the same cores.
|
|
54
|
+
- **Every request recorded.** The node logs each request with its phase timings, whichever way it arrived. [`GET /v1/requests/{request_id}`](https://docs.beta.b3os.org/platform/requests) returns the record.
|
|
55
|
+
|
|
56
|
+
## Next
|
|
57
|
+
|
|
58
|
+
- [Same-host latency](https://docs.beta.b3os.org/concepts/latency) for what this layout saves.
|
|
59
|
+
- [Keys, scopes and principals](https://docs.beta.b3os.org/concepts/auth) for who may call what.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Timing and measurement
|
|
2
|
+
|
|
3
|
+
> How every B3OS response reports where its time went, how to read the request log, and the rules B3OS follows before it publishes a number.
|
|
4
|
+
|
|
5
|
+
Source: https://docs.beta.b3os.org/concepts/timing.md
|
|
6
|
+
|
|
7
|
+
Every response tells you how long the server spent and on what. You do not need a benchmark to see it.
|
|
8
|
+
|
|
9
|
+
## The Server-Timing header
|
|
10
|
+
|
|
11
|
+
Each response carries a W3C `Server-Timing` header with phase durations in milliseconds:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
server-timing: edge_auth;dur=0.4, edge_upstream;dur=40.2, claim;dur=1.1, navigate;dur=31.0, extract;dur=4.2, total;dur=38.9
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
These values are the [API reference](https://docs.beta.b3os.org/api/overview)'s example for the header, not a measured request; your responses carry their own. Read it from left to right:
|
|
18
|
+
|
|
19
|
+
- `edge_auth` and `edge_upstream` are added by the edge at `beta-api.b3os.org`: checking your key, then the round trip to the node. Requests from inside a sandbox have no edge phases.
|
|
20
|
+
- The `desc` of `edge_auth` says which steps it waited on, as `<step>=<source>:<ms>`, for example `desc="key=primary:<ms> limits=d1:<ms> permit=limiter:<ms>"`. `key` is your key, from this server's memory (`isolate`), the location's cache (`colo`) or the database (`primary`). `limits` is your organization's limits, read together with your key (`key`), from memory (`cache`) or the database (`d1`). `permit` is a rate-limit permit, from a batch the edge already holds (`lease`) or the rate limiter (`limiter`), or `optimistic` when the call went ahead and was counted right after ([limits](https://docs.beta.b3os.org/concepts/limits#when-you-hit-a-limit)). These steps are time inside `edge_auth`, not added to it, and a step is listed only when the call needed it.
|
|
21
|
+
- `edge_colo` names the Cloudflare location and ray ID that took your request. It has no duration.
|
|
22
|
+
- The phases after the edge's entries are the operation's own, such as `claim`, `navigate` and `extract` for a scrape that used a browser. Each operation in the [API reference](https://docs.beta.b3os.org/api/overview) shows its phases in its examples.
|
|
23
|
+
- `total` is the node's time from reading the request head to writing the response head.
|
|
24
|
+
|
|
25
|
+
`Timing-Allow-Origin: *` is always set, so a browser exposes the header to scripts on any origin. Streaming responses (event streams, WebSockets, chunked bodies) have no `total` in the header, because the work is not done when the headers go out; their final phases arrive in the terminal event or on the finished job.
|
|
26
|
+
|
|
27
|
+
Bodies of operations that do work also carry the same phases as JSON, keyed `<phase>_ms`, with `total_ms` always present:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
"timing": { "claim_ms": 1.1, "navigate_ms": 31.0, "extract_ms": 4.2, "total_ms": 36.6 }
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## The request log
|
|
34
|
+
|
|
35
|
+
The node keeps a record of every request it serves for 7 days, whichever way the request arrived: through the edge, from inside a sandbox, or from a host tool on the node. Look one up by the `x-request-id` header (or a problem's `instance`):
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
curl -s "https://beta-api.b3os.org/v1/requests/$REQUEST_ID" -H "Authorization: Bearer $B3OS_API_KEY"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"id": "req_01m5t4yg394wegr3j4y01qb363",
|
|
44
|
+
"object": "request",
|
|
45
|
+
"method": "POST",
|
|
46
|
+
"path": "/v1/vision/scrape",
|
|
47
|
+
"operation_id": "visionScrape",
|
|
48
|
+
"status_code": 200,
|
|
49
|
+
"connection": "edge",
|
|
50
|
+
"duration_ms": 48.9,
|
|
51
|
+
"phases": [
|
|
52
|
+
{ "name": "edge_auth", "source": "edge", "duration_ms": 0.4 },
|
|
53
|
+
{ "name": "edge_upstream", "source": "edge", "duration_ms": 47.8 },
|
|
54
|
+
{ "name": "fetch", "source": "node", "duration_ms": 41.2 },
|
|
55
|
+
{ "name": "extract", "source": "node", "duration_ms": 3.9 },
|
|
56
|
+
{ "name": "total", "source": "node", "duration_ms": 45.8 }
|
|
57
|
+
],
|
|
58
|
+
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This is the API reference's example record for `GET /v1/requests/{request_id}`, abridged, not a measured request. `duration_ms` runs from the first request byte to the last response byte, measured on the node; for streams, until the stream ended. `connection` is `edge`, `sandbox`, `uds` or `tcp`. `GET /v1/requests` lists recent requests and filters by product, operation, status class, key, connection and sandbox. Requests the edge answered itself, such as key management, are not in the list; fetch them by ID. See [the request log](https://docs.beta.b3os.org/platform/requests).
|
|
63
|
+
|
|
64
|
+
Send a W3C `traceparent` header and B3OS carries it into the work it does for you, routine steps included. The record shows its `trace_id`.
|
|
65
|
+
|
|
66
|
+
## How B3OS measures before it publishes
|
|
67
|
+
|
|
68
|
+
The numbers on this site follow fixed rules, taken from the B3OS build contract. You can hold any published figure to them.
|
|
69
|
+
|
|
70
|
+
**Labels.** Every figure states its provenance (`measured` by B3OS with raw data, or `vendor`, `independent`, `competitor-run`, `affiliated`), its vantage (`same-host`, `same-region`, or `cross-region from` a named place), whether it was taken on the server or the client side, the date, the sample size, and a link to the raw data. A figure B3OS cannot reproduce from raw data does not appear.
|
|
71
|
+
|
|
72
|
+
**Server and client side.** Server-side headline figures use first request byte to last response byte, as the request log records them. Client-side figures are labeled client side.
|
|
73
|
+
|
|
74
|
+
**Load.** Load generators are open loop: requests go out at a constant arrival rate, timed from when each was meant to be sent, so a slow response cannot hide the queue behind it. Every target states its arrival rate or concurrency, payload size and pool depth. Load generators run on CPU cores apart from the system under test.
|
|
75
|
+
|
|
76
|
+
**Three regimes.** Each target is measured back to back, after idle gaps of 100 ms and 3 seconds, and under mixed load: the other products at their budgeted load while B3IQ serves inference on the same machine. Same-node and cross-NUMA results are reported separately.
|
|
77
|
+
|
|
78
|
+
**Runs.** A published run holds the benchmark lock on the node and records the active services, load, versions and commit, plus a record of the CPU time other processes used on the cores under test. Runs without the lock are labeled `dev` and never published. Each figure takes at least five runs and publishes the best run and the median of the run medians, with the sample size.
|
|
79
|
+
|
|
80
|
+
**Pools.** Everything B3OS claims from a pool (sandbox slots, scrape-pool contexts, session browsers) is published with the pool's miss rate and the p50 and p99 of the misses, beside the numbers for hits, so a fast hit path cannot hide a slow miss path. A sandbox at a size its template keeps no pool for counts as a miss.
|
|
81
|
+
|
|
82
|
+
Published results link their raw data at `https://beta.b3os.org/raw/`. The first of them, the node daemon's transport floor on [benchmarks](https://docs.beta.b3os.org/benchmarks#published-results), fall short in two ways that page states: they predate the request log, so their server figure is the `Server-Timing` total, and they have no mixed-load row. One exception to these rules is made on purpose: the dev baselines on [same-host latency](https://docs.beta.b3os.org/concepts/latency) and [benchmarks](https://docs.beta.b3os.org/benchmarks). They are dev runs, measured on the bare node before any product existed, and appear only to explain design choices, labeled as dev baselines and never as results. Their raw data sits in the B3OS beta repository and does not have a public link yet.
|
|
83
|
+
|
|
84
|
+
**Comparisons.** B3OS compares itself with another product only in that product's own measurement shape, and never puts a same-host figure in a row beside a client-measured competitor figure.
|
|
85
|
+
|
|
86
|
+
[Benchmarks](https://docs.beta.b3os.org/benchmarks) lists the targets, the results published so far and the state of each measurement.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Usage, metering and pricing
|
|
2
|
+
|
|
3
|
+
> What B3OS meters, which unit each operation bills, why failed work is free, and how to read your usage. The beta is free within its limits.
|
|
4
|
+
|
|
5
|
+
Source: https://docs.beta.b3os.org/concepts/usage.md
|
|
6
|
+
|
|
7
|
+
The node that does the work records the usage, one record per billable unit of work, and reports it to the edge within seconds. Each operation bills one unit you can see, whatever happened inside it: a scrape bills one `vision.page` whether the cache, a plain fetch or a browser served it.
|
|
8
|
+
|
|
9
|
+
## Pricing
|
|
10
|
+
|
|
11
|
+
The beta is free: every unit below has a price of zero, except a hosted tool's publisher price (`actions.publisher_microusd`), which counts against spend caps at one micro-USD a unit. What bounds your organization is its limits:
|
|
12
|
+
|
|
13
|
+
- tokens and requests per minute for each model (`GET /v1/infer/models` lists them);
|
|
14
|
+
- the per-organization limits in [Limits](https://docs.beta.b3os.org/concepts/limits#beta-defaults): sandboxes and browser sessions at once, scrapes per minute, routine steps per day, action calls per minute;
|
|
15
|
+
- a monthly allowance of pages for vision, starting at 100,000 pages per organization (`vision.pages.monthly`), reported by `GET /v1/limits` and the Firecrawl credit fields. Once it is used up, scrapes answer `429 quota_exceeded` until the next UTC month.
|
|
16
|
+
|
|
17
|
+
`GET /v1/limits` shows each limit with your current use. Usage is still recorded and shown below, so you can see what your agents do and what it would weigh once prices exist.
|
|
18
|
+
|
|
19
|
+
## Units
|
|
20
|
+
|
|
21
|
+
| Unit | Product | Counts | What it measures |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| `vision.page` | vision | pages | One page fetched and converted, whichever tier served it (cache, fetch, browser). |
|
|
24
|
+
| `vision.browser_ms` | vision | milliseconds | Wall time of a browser session, from claim to close. |
|
|
25
|
+
| `render.screenshot` | render | screenshots | One captured screenshot; extra variants of the same capture count once each. |
|
|
26
|
+
| `render.video_s` | render | seconds | Seconds of output video, rounded up per video. |
|
|
27
|
+
| `render.inspection_s` | render | seconds | Seconds of an inspection's window, rounded up per inspection. |
|
|
28
|
+
| `infer.input_tokens` | infer | tokens | Prompt tokens. |
|
|
29
|
+
| `infer.output_tokens` | infer | tokens | Generated tokens. |
|
|
30
|
+
| `infer.audio_chars` | infer | characters | Characters of text synthesized to speech. |
|
|
31
|
+
| `infer.embed_tokens` | infer | tokens | Tokens of text embedded, query prompts included. Planned: not served on the beta node yet. |
|
|
32
|
+
| `infer.rerank_tokens` | infer | tokens | Tokens of the query and document pairs reranked. Planned: not served on the beta node yet. |
|
|
33
|
+
| `sandboxes.vcpu_ms` | sandboxes | vCPU milliseconds | CPU time used, sampled from the sandbox cgroup cpu.stat. |
|
|
34
|
+
| `sandboxes.gib_ms` | sandboxes | GiB milliseconds | Allocated memory times wall time while running. |
|
|
35
|
+
| `sandboxes.volume_gib_h` | sandboxes | GiB hours | A volume's provisioned size times the hours it exists, mounted or not, from its create to its delete (not during the grace). Priced at 0 in the beta. |
|
|
36
|
+
| `images.import_vcpu_ms` | images | vCPU milliseconds | CPU time an image import used: the unpacking microVM and the first boot with its warm-up, each read once from its cgroup cpu.stat at its end. Rebuilds after a node release are not counted. |
|
|
37
|
+
| `routines.effect_step` | routines | steps | A core/http@1, wait or sleep_ms routine step that ended (a skipped one bills nothing). Product steps bill their product's unit, pack steps actions.call, other steps nothing. |
|
|
38
|
+
| `actions.call` | actions | calls | One action execution. A hosted tool call records actions.tool_call instead. |
|
|
39
|
+
| `actions.tool_call` | actions | calls | One hosted tool call whose command ran: the per-call floor. Its meta carries the pack, version, action, publisher, the phase times, the call's cost in micro-USD, price_basis {model, usd, run_ms or in_bytes, free_left} and tool_code (a code the tool declares in tool.errors, else undeclared; only on a tool_error). |
|
|
40
|
+
| `actions.vcpu_ms` | actions | vCPU milliseconds | CPU time a hosted tool's VM used for one call, from its slot cgroup, as the VM's delete answered it. |
|
|
41
|
+
| `actions.gib_ms` | actions | GiB milliseconds | Memory a hosted tool's VM had allocated times the time it ran, for one call. |
|
|
42
|
+
| `actions.publisher_microusd` | actions | micro-USD | A hosted tool's publisher price for one call that answered validly, in millionths of a US dollar. Priced at 0.000001 USD a unit, always. |
|
|
43
|
+
| `egress.bytes` | platform | bytes | Bytes of customer-steered egress, recorded by the egress guard for every operation. |
|
|
44
|
+
| `platform.content_bytes` | platform | bytes | Bytes of prompts and answers the model call log wrote for a project (with platform.capture_content on), one record per project per writer batch with meta.purpose call_log. Priced at 0 in the beta. |
|
|
45
|
+
|
|
46
|
+
`agents.idle_gib_ms` is counted and never billed. Host memory a paused agent instance holds (its resident memory, sampled from its slot cgroup, not its size) times the time it is paused. Counted and shown, not billed, in the beta. `agents.storage_gib_h` is counted and never billed. Disk an agent instance holds on the node while it sleeps past memory (its memory snapshot and its own disk) times hours. Counted and shown, not billed, in the beta. `listeners.event` is counted and never billed. An event a listener's filter kept and its sink accepted. Duplicates, filtered events and events the sink refused count nothing. Counted, not billed, during the beta. `listeners.active_s` is counted and never billed. Seconds a listener held its source (a connection or a poll schedule), recorded about once a minute per listener, for capacity reporting. `vision.proxy_bytes` is counted and never billed. Bytes of pages vision read from a residential address (a proxy auto retry or proxy residential), both directions, counted against the monthly safety limit vision.proxy.bytes.monthly. The page itself bills as vision.page.
|
|
47
|
+
|
|
48
|
+
A few rules follow from "one unit per operation":
|
|
49
|
+
|
|
50
|
+
- `vision.browser_ms` applies to browser sessions only. Scrapes that used a browser bill `vision.page` and nothing else.
|
|
51
|
+
- A routine step bills its product's unit: a `vision/scrape@1` step bills `vision.page`. Only `core/http@1`, `wait` and `sleep_ms` steps bill `routines.effect_step`; other steps bill only what their product bills.
|
|
52
|
+
- A paused sandbox bills no CPU time. Whether it bills memory while paused is still being settled for the beta; the sandbox's `usage` shows what it was charged.
|
|
53
|
+
- A map bills one `vision.page` per request, however many URLs it returns. An extraction bills its pages plus the model's tokens.
|
|
54
|
+
|
|
55
|
+
## Failed work is free
|
|
56
|
+
|
|
57
|
+
A scrape that does not return a page bills nothing: an upstream error, a timeout, a destination the egress guard refused or an extraction that failed records no `vision.page`. Batches and crawls bill only the pages that succeeded. A page vision judges a wall (`page_state` `blocked` or `captcha`) is free and comes back without its content (`content_withheld: true`), unless the request sets `walls: "bill"`. Render follows the same rule: a screenshot or a video that produces no artifact records no `render.screenshot` and no `render.video_s`, and a video you cancel bills nothing.
|
|
58
|
+
|
|
59
|
+
Work that produced output before a cancel stays billed: the pages a batch or crawl already scraped, the tokens a model already generated.
|
|
60
|
+
|
|
61
|
+
## Totals
|
|
62
|
+
|
|
63
|
+
`GET /v1/usage` adds up usage between `start` and `end` (default: this calendar month so far), grouped by any of `product`, `unit`, `key`, `project` and `day`:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
curl -s "https://beta-api.b3os.org/v1/usage?group_by=product,unit" \
|
|
67
|
+
-H "Authorization: Bearer $B3OS_API_KEY"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"object": "usage_summary",
|
|
73
|
+
"start": "2026-10-01T00:00:00.000Z",
|
|
74
|
+
"end": "2026-10-25T22:00:00.000Z",
|
|
75
|
+
"group_by": ["product", "unit"],
|
|
76
|
+
"rows": [
|
|
77
|
+
{ "product": "vision", "unit": "vision.page", "qty": 18204 },
|
|
78
|
+
{ "product": "sandboxes", "unit": "sandboxes.vcpu_ms", "qty": 9120330 },
|
|
79
|
+
{ "product": "infer", "unit": "infer.output_tokens", "qty": 4410920 }
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
These values are the API reference's example for `GET /v1/usage`, not a real organization's usage. The last minute of usage may still change as nodes report.
|
|
85
|
+
|
|
86
|
+
## Records
|
|
87
|
+
|
|
88
|
+
`GET /v1/usage/records` lists the individual records, newest first, and filters by product, unit, key, sandbox and request. Every record names the request that produced it, so you can tie a charge to a call:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"id": "use_01m5t5tmscqev5tf32q87tr1v5",
|
|
93
|
+
"object": "usage_record",
|
|
94
|
+
"ts": "2026-10-25T21:30:00.120Z",
|
|
95
|
+
"key_id": "key_01m5t5csy2wt4e3er052chyf1x",
|
|
96
|
+
"sandbox_id": null,
|
|
97
|
+
"node": "n1",
|
|
98
|
+
"product": "vision",
|
|
99
|
+
"unit": "vision.page",
|
|
100
|
+
"qty": 1,
|
|
101
|
+
"request_id": "req_01m5t4yg394wegr3j4y01qb363",
|
|
102
|
+
"meta": { "tier": "fetch" }
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
This example is abridged. Calls made from inside a sandbox carry its `sandbox_id`, and they bill the key that created the sandbox. `sandbox_id=` lists one sandbox's records, for a sandbox in the calling project only. An application's canvas reads its pack nodes' call counts this way: each `actions.call` record names its pack in `meta.pack`.
|
|
107
|
+
|
|
108
|
+
## Caps
|
|
109
|
+
|
|
110
|
+
A key can carry a spend cap in USD (`spend_cap_usd`). When the key reaches it, its metered requests fail with [`spend_cap_exceeded`](https://docs.beta.b3os.org/errors#spend_cap_exceeded) until you raise the cap. A cap is reached when the spend is at or above it, so a cap of `0` refuses every metered call even while prices are zero; leave the cap `null` for no cap. A sandbox's `api.spend_cap_usd` caps the calls made from inside that sandbox the same way. When the organization runs out of credits, requests fail with [`credits_exhausted`](https://docs.beta.b3os.org/errors#credits_exhausted); in the free beta organizations have no credit balance, so this does not happen. The node enforces caps with its own counters, so calls that never pass through the edge are capped too.
|