@b3os/cli 0.2.0 → 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.
Files changed (217) hide show
  1. package/README.md +87 -7
  2. package/assets/b3os-run.py +137 -0
  3. package/assets/skill/b3os/SKILL.md +111 -0
  4. package/dist/commands/_agents.d.ts +14 -0
  5. package/dist/commands/_agents.js +33 -0
  6. package/dist/commands/_agents.js.map +1 -0
  7. package/dist/commands/_common.js +6 -2
  8. package/dist/commands/_common.js.map +1 -1
  9. package/dist/commands/_context.d.ts +49 -0
  10. package/dist/commands/_context.js +260 -0
  11. package/dist/commands/_context.js.map +1 -0
  12. package/dist/commands/_next.d.ts +39 -0
  13. package/dist/commands/_next.js +77 -0
  14. package/dist/commands/_next.js.map +1 -0
  15. package/dist/commands/agent.d.ts +42 -0
  16. package/dist/commands/agent.js +218 -0
  17. package/dist/commands/agent.js.map +1 -0
  18. package/dist/commands/app.d.ts +2 -0
  19. package/dist/commands/app.js +559 -54
  20. package/dist/commands/app.js.map +1 -1
  21. package/dist/commands/auth.d.ts +88 -2
  22. package/dist/commands/auth.js +354 -44
  23. package/dist/commands/auth.js.map +1 -1
  24. package/dist/commands/docs.d.ts +54 -0
  25. package/dist/commands/docs.js +202 -0
  26. package/dist/commands/docs.js.map +1 -0
  27. package/dist/commands/doctor.d.ts +23 -0
  28. package/dist/commands/doctor.js +313 -0
  29. package/dist/commands/doctor.js.map +1 -0
  30. package/dist/commands/init.d.ts +38 -1
  31. package/dist/commands/init.js +259 -60
  32. package/dist/commands/init.js.map +1 -1
  33. package/dist/commands/listen.d.ts +30 -0
  34. package/dist/commands/listen.js +194 -0
  35. package/dist/commands/listen.js.map +1 -0
  36. package/dist/commands/manifest.d.ts +13 -1
  37. package/dist/commands/manifest.js +81 -18
  38. package/dist/commands/manifest.js.map +1 -1
  39. package/dist/commands/mcp.d.ts +25 -2
  40. package/dist/commands/mcp.js +120 -11
  41. package/dist/commands/mcp.js.map +1 -1
  42. package/dist/commands/sandbox.d.ts +35 -6
  43. package/dist/commands/sandbox.js +208 -9
  44. package/dist/commands/sandbox.js.map +1 -1
  45. package/dist/commands/setup.d.ts +39 -0
  46. package/dist/commands/setup.js +203 -0
  47. package/dist/commands/setup.js.map +1 -0
  48. package/dist/commands/tool.d.ts +154 -0
  49. package/dist/commands/tool.js +785 -0
  50. package/dist/commands/tool.js.map +1 -0
  51. package/dist/config.d.ts +30 -6
  52. package/dist/config.js +39 -8
  53. package/dist/config.js.map +1 -1
  54. package/dist/ctx.d.ts +5 -45
  55. package/dist/ctx.js +25 -160
  56. package/dist/ctx.js.map +1 -1
  57. package/dist/docs/index.json +1 -0
  58. package/dist/docs/pages/actions/call.md +300 -0
  59. package/dist/docs/pages/actions/catalog/airtable.md +737 -0
  60. package/dist/docs/pages/actions/catalog/arxiv.md +166 -0
  61. package/dist/docs/pages/actions/catalog/chainalysis-sanctions.md +125 -0
  62. package/dist/docs/pages/actions/catalog/coingecko.md +1558 -0
  63. package/dist/docs/pages/actions/catalog/deps-dev.md +465 -0
  64. package/dist/docs/pages/actions/catalog/dexscreener.md +568 -0
  65. package/dist/docs/pages/actions/catalog/discord.md +784 -0
  66. package/dist/docs/pages/actions/catalog/finnhub.md +776 -0
  67. package/dist/docs/pages/actions/catalog/frankfurter.md +438 -0
  68. package/dist/docs/pages/actions/catalog/github.md +1853 -0
  69. package/dist/docs/pages/actions/catalog/gmail.md +575 -0
  70. package/dist/docs/pages/actions/catalog/google-calendar.md +654 -0
  71. package/dist/docs/pages/actions/catalog/google-drive.md +502 -0
  72. package/dist/docs/pages/actions/catalog/google-sheets.md +700 -0
  73. package/dist/docs/pages/actions/catalog/hacker-news.md +542 -0
  74. package/dist/docs/pages/actions/catalog/http.md +824 -0
  75. package/dist/docs/pages/actions/catalog/hyperliquid.md +942 -0
  76. package/dist/docs/pages/actions/catalog/jira.md +920 -0
  77. package/dist/docs/pages/actions/catalog/kalshi.md +917 -0
  78. package/dist/docs/pages/actions/catalog/linear.md +1030 -0
  79. package/dist/docs/pages/actions/catalog/markets.md +21 -0
  80. package/dist/docs/pages/actions/catalog/morpho.md +247 -0
  81. package/dist/docs/pages/actions/catalog/notion.md +1077 -0
  82. package/dist/docs/pages/actions/catalog/nws.md +485 -0
  83. package/dist/docs/pages/actions/catalog/open-meteo.md +559 -0
  84. package/dist/docs/pages/actions/catalog/polymarket.md +1523 -0
  85. package/dist/docs/pages/actions/catalog/pushbullet.md +220 -0
  86. package/dist/docs/pages/actions/catalog/resend.md +307 -0
  87. package/dist/docs/pages/actions/catalog/s3.md +513 -0
  88. package/dist/docs/pages/actions/catalog/sec-edgar.md +487 -0
  89. package/dist/docs/pages/actions/catalog/slack.md +2629 -0
  90. package/dist/docs/pages/actions/catalog/stripe.md +1405 -0
  91. package/dist/docs/pages/actions/catalog/wikipedia.md +379 -0
  92. package/dist/docs/pages/actions/catalog.md +46 -0
  93. package/dist/docs/pages/actions/limits.md +50 -0
  94. package/dist/docs/pages/actions/model-tools.md +225 -0
  95. package/dist/docs/pages/actions/packs.md +148 -0
  96. package/dist/docs/pages/actions/settings.md +69 -0
  97. package/dist/docs/pages/actions/tools.md +244 -0
  98. package/dist/docs/pages/actions/triggers.md +149 -0
  99. package/dist/docs/pages/actions.md +88 -0
  100. package/dist/docs/pages/compat/anthropic.md +168 -0
  101. package/dist/docs/pages/compat/e2b.md +194 -0
  102. package/dist/docs/pages/compat/firecrawl.md +138 -0
  103. package/dist/docs/pages/compat/openai.md +168 -0
  104. package/dist/docs/pages/concepts/auth.md +151 -0
  105. package/dist/docs/pages/concepts/beta.md +55 -0
  106. package/dist/docs/pages/concepts/glossary.md +71 -0
  107. package/dist/docs/pages/concepts/ids.md +98 -0
  108. package/dist/docs/pages/concepts/jobs.md +229 -0
  109. package/dist/docs/pages/concepts/latency.md +138 -0
  110. package/dist/docs/pages/concepts/limits.md +191 -0
  111. package/dist/docs/pages/concepts/stack.md +59 -0
  112. package/dist/docs/pages/concepts/timing.md +86 -0
  113. package/dist/docs/pages/concepts/usage.md +110 -0
  114. package/dist/docs/pages/design/b3os-yaml.md +370 -0
  115. package/dist/docs/pages/design/deploy-from-github.md +122 -0
  116. package/dist/docs/pages/design/observability.md +134 -0
  117. package/dist/docs/pages/errors.md +1824 -0
  118. package/dist/docs/pages/infer/chat.md +570 -0
  119. package/dist/docs/pages/infer/limits.md +55 -0
  120. package/dist/docs/pages/infer/messages.md +185 -0
  121. package/dist/docs/pages/infer/responses.md +173 -0
  122. package/dist/docs/pages/infer/settings.md +154 -0
  123. package/dist/docs/pages/infer/speech.md +323 -0
  124. package/dist/docs/pages/infer.md +154 -0
  125. package/dist/docs/pages/introduction.md +162 -0
  126. package/dist/docs/pages/platform/addresses.md +174 -0
  127. package/dist/docs/pages/platform/call-log.md +99 -0
  128. package/dist/docs/pages/platform/custom-domains.md +104 -0
  129. package/dist/docs/pages/platform/keys.md +79 -0
  130. package/dist/docs/pages/platform/limits.md +57 -0
  131. package/dist/docs/pages/platform/members.md +101 -0
  132. package/dist/docs/pages/platform/requests.md +116 -0
  133. package/dist/docs/pages/platform/settings.md +129 -0
  134. package/dist/docs/pages/platform/webhooks.md +68 -0
  135. package/dist/docs/pages/platform.md +67 -0
  136. package/dist/docs/pages/quickstart/mcp.md +94 -0
  137. package/dist/docs/pages/quickstart/sandbox-agent.md +205 -0
  138. package/dist/docs/pages/quickstart/scrape.md +134 -0
  139. package/dist/docs/pages/quickstart.md +45 -0
  140. package/dist/docs/pages/render/inspections.md +162 -0
  141. package/dist/docs/pages/render/limits.md +72 -0
  142. package/dist/docs/pages/render/screenshots.md +179 -0
  143. package/dist/docs/pages/render/settings.md +431 -0
  144. package/dist/docs/pages/render/styles.md +342 -0
  145. package/dist/docs/pages/render/videos.md +272 -0
  146. package/dist/docs/pages/render.md +118 -0
  147. package/dist/docs/pages/routines/callables.md +174 -0
  148. package/dist/docs/pages/routines/definitions.md +361 -0
  149. package/dist/docs/pages/routines/limits.md +117 -0
  150. package/dist/docs/pages/routines/runs.md +328 -0
  151. package/dist/docs/pages/routines/settings.md +104 -0
  152. package/dist/docs/pages/routines/triggers.md +339 -0
  153. package/dist/docs/pages/routines.md +216 -0
  154. package/dist/docs/pages/sandboxes/agents.md +217 -0
  155. package/dist/docs/pages/sandboxes/commands.md +272 -0
  156. package/dist/docs/pages/sandboxes/images.md +166 -0
  157. package/dist/docs/pages/sandboxes/limits.md +143 -0
  158. package/dist/docs/pages/sandboxes/ports.md +260 -0
  159. package/dist/docs/pages/sandboxes/settings.md +358 -0
  160. package/dist/docs/pages/sandboxes/snapshots.md +423 -0
  161. package/dist/docs/pages/sandboxes/swarms.md +146 -0
  162. package/dist/docs/pages/sandboxes/volumes.md +131 -0
  163. package/dist/docs/pages/sandboxes.md +231 -0
  164. package/dist/docs/pages/sdks/cli.md +121 -0
  165. package/dist/docs/pages/sdks/mcp.md +169 -0
  166. package/dist/docs/pages/sdks/python.md +146 -0
  167. package/dist/docs/pages/sdks/typescript.md +202 -0
  168. package/dist/docs/pages/sdks.md +282 -0
  169. package/dist/docs/pages/settings.md +33 -0
  170. package/dist/docs/pages/vault/limits.md +46 -0
  171. package/dist/docs/pages/vault.md +133 -0
  172. package/dist/docs/pages/vision/agent-browser.md +115 -0
  173. package/dist/docs/pages/vision/crawl.md +333 -0
  174. package/dist/docs/pages/vision/extract.md +152 -0
  175. package/dist/docs/pages/vision/fetcher.md +15 -0
  176. package/dist/docs/pages/vision/limits.md +79 -0
  177. package/dist/docs/pages/vision/profiles.md +111 -0
  178. package/dist/docs/pages/vision/proxy.md +131 -0
  179. package/dist/docs/pages/vision/scrape.md +356 -0
  180. package/dist/docs/pages/vision/sessions.md +311 -0
  181. package/dist/docs/pages/vision/settings.md +656 -0
  182. package/dist/docs/pages/vision.md +175 -0
  183. package/dist/errors.d.ts +129 -0
  184. package/dist/errors.js +326 -0
  185. package/dist/errors.js.map +1 -0
  186. package/dist/main.d.ts +1 -1
  187. package/dist/main.js +26 -13
  188. package/dist/main.js.map +1 -1
  189. package/dist/manifest/apply.d.ts +4 -0
  190. package/dist/manifest/apply.js +2 -0
  191. package/dist/manifest/apply.js.map +1 -1
  192. package/dist/manifest/domains.d.ts +50 -0
  193. package/dist/manifest/domains.js +159 -0
  194. package/dist/manifest/domains.js.map +1 -0
  195. package/dist/manifest/link.d.ts +20 -0
  196. package/dist/manifest/link.js +24 -0
  197. package/dist/manifest/link.js.map +1 -0
  198. package/dist/manifest/record.d.ts +1 -1
  199. package/dist/tool/archive.d.ts +33 -0
  200. package/dist/tool/archive.js +174 -0
  201. package/dist/tool/archive.js.map +1 -0
  202. package/dist/tool/calls.d.ts +46 -0
  203. package/dist/tool/calls.js +274 -0
  204. package/dist/tool/calls.js.map +1 -0
  205. package/dist/tool/checks.d.ts +21 -0
  206. package/dist/tool/checks.js +145 -0
  207. package/dist/tool/checks.js.map +1 -0
  208. package/dist/tool/elf.d.ts +19 -0
  209. package/dist/tool/elf.js +107 -0
  210. package/dist/tool/elf.js.map +1 -0
  211. package/dist/tool/predict.d.ts +8 -0
  212. package/dist/tool/predict.js +38 -0
  213. package/dist/tool/predict.js.map +1 -0
  214. package/dist/tool/ustar.d.ts +5 -0
  215. package/dist/tool/ustar.js +220 -0
  216. package/dist/tool/ustar.js.map +1 -0
  217. package/package.json +6 -5
@@ -0,0 +1,162 @@
1
+ # Introduction
2
+
3
+ > B3OS beta runs browsers, sandboxes and other agent tools on the node that serves its model. Agents in a sandbox there keep the whole loop on one machine.
4
+
5
+ Source: https://docs.beta.b3os.org/introduction.md
6
+
7
+ Make a first call with curl, or hand the setup to your coding agent. Either way you need a key ([get one](https://docs.beta.b3os.org/quickstart#get-a-key); the beta is invite-only).
8
+
9
+ **curl**
10
+
11
+ With the key in `B3OS_API_KEY`, turn a page into Markdown:
12
+
13
+ ```bash
14
+ curl -s https://beta-api.b3os.org/v1/vision/scrape \
15
+ -H "Authorization: Bearer $B3OS_API_KEY" \
16
+ -H "Content-Type: application/json" \
17
+ -d '{"url": "https://example.com", "formats": ["markdown", "links"]}'
18
+ ```
19
+
20
+ **Your coding agent**
21
+
22
+ Paste this into Claude Code, Cursor or Codex:
23
+
24
+ ```text
25
+ Set up B3OS beta in this project. The beta is invite-only.
26
+
27
+ 1. Run `npx -y @b3os/cli@0.2 init`. It adds the B3OS MCP server to Claude Code, Cursor and Codex and makes a first call, with B3OS_API_KEY from the environment or a stored sign-in. With neither, it prints a sign-in link and a code and waits for my approval: run it in the background and show me both.
28
+ 2. To use an API key instead, ask me for a key made for this agent, with only the scopes it needs and an expiry (I create it at https://beta.b3os.org/app; https://docs.beta.b3os.org/platform/keys explains scopes and expiry). It goes in the environment you start with, as B3OS_API_KEY, never in a file.
29
+ 3. Read https://beta.b3os.org/llms-quickstart.txt: one call per product and how to check it. https://beta.b3os.org/llms.txt indexes the rest.
30
+ 4. Use B3OS vision for web pages, render for screenshots and videos, sandboxes to run code, routines for scheduled work and actions for third-party APIs.
31
+ ```
32
+
33
+ What the call returns, recorded from production:
34
+
35
+ **Response 200**
36
+
37
+ ```json
38
+ {
39
+ "object": "scrape",
40
+ "url": "https://example.com/",
41
+ "final_url": "https://example.com/",
42
+ "status_code": 200,
43
+ "content_type": "text/html",
44
+ "tier": "cache",
45
+ "cache": {
46
+ "state": "hit",
47
+ "age_s": 85369
48
+ },
49
+ "markdown": "This domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes.\n\nهذا النطاق مُخصص للاستخدام في أمثلة التوثيق دون الحاجة إلى إذن. هذه ليست خدمة، يُرجى تجنب الاعتماد عليها لأغراض الاختبار والمراقبة.\n\n该域名仅用于文档示例,无需获得许可。这并非一项服务,请勿将其用于测试和监控目的。\n\nL’usage de ce domaine est réservé à des exemples de documentation, …",
50
+ "links": [
51
+ "https://iana.org/help/example-domains"
52
+ ],
53
+ "metadata": {
54
+ "title": "Example Domain",
55
+ "language": "en"
56
+ },
57
+ "page_state": {
58
+ "state": "ok"
59
+ },
60
+ "warnings": [],
61
+ "timing": {
62
+ "admit_ms": 0.044,
63
+ "cache_ms": 0.002,
64
+ "extract_ms": 0.001,
65
+ "total_ms": 0.117
66
+ }
67
+ }
68
+ ```
69
+
70
+ **Request**
71
+
72
+ ```bash
73
+ curl -s -X POST 'https://beta-api.b3os.org/v1/vision/scrape' \
74
+ -H "Authorization: Bearer $B3OS_API_KEY" \
75
+ -H 'Content-Type: application/json' \
76
+ -d '{"url":"https://example.com","formats":["markdown","links"]}'
77
+ ```
78
+
79
+ **Server-Timing**
80
+
81
+ ```http
82
+ server-timing: edge_auth;dur=0.000, edge_upstream;dur=9.000, admit;dur=0.044, cache;dur=0.002, extract;dur=0.001, total;dur=0.131
83
+ x-request-id: req_01m6y0b9h3mm58b3pzd9sfgvy1
84
+ ```
85
+
86
+ <sub>Captured 2026-11-08 from commit `48c174d9` on the host the node runs on (colo PDX), warm: median of 5 calls after 3 warm-up calls, label `live-recorded` (recorded from production); long values abridged. Case `vision/quickstart-scrape`.</sub>
87
+
88
+ An agent works in a loop: the model decides, a tool acts, and the result goes back to the model. When the tools and the model live in different places, every turn pays for the trip between them. B3OS puts the tools (browsers, sandboxes, screenshots and videos, durable workflows, marketplace actions) on a B3IQ node that serves models, behind one key, one SDK, one CLI and one MCP server.
89
+
90
+ Measured on the B3OS node, from the [benchmark board](https://docs.beta.b3os.org/benchmarks#headline-results). Each figure links its raw data; the board has the conditions.
91
+
92
+ - **Under 3 ms**: Sandbox claimed, first command run (warm sandbox pool, p50 from a client on the same host, 2026-11-02; pool misses 0% of 200 claims). [Raw data](https://beta.b3os.org/raw/bench/bench/results/20261102T092119Z-w4q-mixed/sandboxes-claim-exec-mixed/sandboxes.claim_first_exec.gap-100ms+bg.result.json)
93
+ - **Under 50 ms**: First token from a 1,000-token prompt (b3os/qwen3.5-9b, p50 from a client on the same host, 2026-11-03). [Raw data](https://beta.b3os.org/raw/bench/infer/results/20261103T090624Z-w5-b2b-q/infer.chat_stream.c1.result.json)
94
+ - **Under 200 µs**: Durable workflow step, committed to disk (standard durability, p50 timed by the server, 2026-11-01). [Raw data](https://beta.b3os.org/raw/bench/bench/results/20261101T081324Z-w3q-idle/routines-durable-cross/routines.durable_step.b2b-c1.result.json)
95
+ - **Under 30 ms**: First audio of a streamed speech answer (kokoro-82m, p50 timed by the server, 2026-11-05). [Raw data](https://beta.b3os.org/raw/bench/infer/results/20261105T084352Z-w6-voice-q/infer.speech_ttfa.medium-stream-c1.result.json)
96
+ - **Under 350 ms**: One agent turn: a model call and a tool call (b3os/qwen3.5-9b, p50 from a client on the same host, 2026-11-17). [Raw data](https://beta.b3os.org/raw/bench/loop/results/20261117T083830Z-loop-a-prod-1111-v12/loop-a/loop-a/loop.A.result.json)
97
+
98
+ Next to other providers. Head-to-head rows are timed by B3OS from one client; the others set B3OS beside each provider's published figure, timed the same way. A multiplier is the other provider's figure divided by B3OS's p50, rounded down.
99
+
100
+ - **4x to 4.6x below boxd's published p50**: Sandbox create, timed by the server. B3OS 1.09 to 1.24 ms (p50, 4 configurations, 2026-11-08); boxd publishes 5 ms ([source](https://boxd.sh/blog/moyai/)). [How it was measured](https://beta.b3os.org/benchmarks#compared)
101
+ - **13x to 16x below CubeSandbox's published mean**: Sandbox create to running, from a client on the same host. B3OS 2.81 to 3.61 ms (p50, 4 configurations, 2026-11-08); CubeSandbox publishes 47.8 ms ([source](https://github.com/TencentCloud/CubeSandbox/blob/master/docs/blog/posts/2026-06-01-cubesandbox-perf-benchmark.md)). [How it was measured](https://beta.b3os.org/benchmarks#compared)
102
+ - **2.3x to 3.3x below ElevenLabs (eleven_flash_v2_5), both timed from one client**: Streamed speech, send to the first audible sample, from one client. B3OS 64.9 to 88.9 ms and ElevenLabs (eleven_flash_v2_5) 190 to 215 ms, p50 across the 3 texts, 2026-11-06. Cartesia and Inworld ran in the same run and are not published, because too few of the requests succeeded. [How it was measured](https://beta.b3os.org/benchmarks#compared)
103
+ - **40x to 66x below Temporal Cloud's published p50**: Workflow start through the API, timed by the server. B3OS 0.303 to 0.49 ms (p50, 5 configurations, 2026-11-03); Temporal Cloud publishes 20 ms ([source](https://docs.temporal.io/cloud/slo)). [How it was measured](https://beta.b3os.org/benchmarks#compared)
104
+
105
+ ## What runs where
106
+
107
+ When your agent runs in a sandbox on the node and uses a model served there, the whole loop stays on one machine. Agents elsewhere call the same tools over the network. With a frontier model hosted somewhere else, the tools run on the node and the model call leaves it. [The stack](https://docs.beta.b3os.org/concepts/stack) shows how a request travels through B3IQ's machines and B3OS.
108
+
109
+ The [same-host latency](https://docs.beta.b3os.org/concepts/latency) page shows what that saves per tool call and where the numbers come from.
110
+
111
+ ## Products
112
+
113
+ - [Vision](https://docs.beta.b3os.org/vision)
114
+ Scrape, crawl and map sites, and drive dedicated browser sessions over CDP.
115
+ - [Render](https://docs.beta.b3os.org/render)
116
+ Styled screenshots and scripted product videos with narration and captions.
117
+ - [Sandboxes](https://docs.beta.b3os.org/sandboxes)
118
+ Firecracker microVMs restored from warm snapshots, with exec, files, ports and a terminal.
119
+ - [Routines](https://docs.beta.b3os.org/routines)
120
+ Durable workflows written like GitHub Actions, with cron, webhook and pack triggers.
121
+ - [Actions and triggers](https://docs.beta.b3os.org/actions)
122
+ Marketplace packs your agent can search, describe and call, with credentials kept out of its reach.
123
+ - [Infer](https://docs.beta.b3os.org/infer)
124
+ OpenAI and Anthropic compatible chat and speech from models served on the node.
125
+
126
+ ## Platform
127
+
128
+ Every product shares these.
129
+
130
+ - [Vault](https://docs.beta.b3os.org/vault)
131
+ Connections that hold credentials and inject them at the egress proxy.
132
+ - [Platform](https://docs.beta.b3os.org/platform)
133
+ Keys, usage, limits, webhooks and the per-request log.
134
+
135
+ ## One key, one SDK, one CLI, one MCP server
136
+
137
+ Every product sits behind the same API at `https://beta-api.b3os.org`. Create a key in the [dashboard](https://beta.b3os.org/app), export it as `B3OS_API_KEY`, and use whichever client fits:
138
+
139
+ - plain HTTP, documented in the [API reference](https://docs.beta.b3os.org/api/overview);
140
+ - the [TypeScript SDK](https://docs.beta.b3os.org/sdks/typescript) `@b3os/sdk` and the [Python SDK](https://docs.beta.b3os.org/sdks/python);
141
+ - the [CLI](https://docs.beta.b3os.org/sdks/cli) `b3os`;
142
+ - the [MCP server](https://docs.beta.b3os.org/sdks/mcp), `@b3os/mcp` on your machine or `https://beta-api.b3os.org/mcp`.
143
+
144
+ Code inside a B3OS sandbox calls the same API at `http://127.0.0.1:7700` without a key. The sandbox's grant decides what it may call.
145
+
146
+ ## Numbers on this site
147
+
148
+ B3OS publishes a figure only when raw benchmark data backs it, and each one links that data. Every configuration runs at least five times before it's published. [Benchmarks](https://docs.beta.b3os.org/benchmarks) has every result and says which [measurement rules](https://docs.beta.b3os.org/concepts/timing#how-b3os-measures-before-it-publishes) a result doesn't meet yet.
149
+
150
+ The beta is free. Per-organization limits apply, such as scrapes per minute and sandboxes at once; vision has a monthly page allowance (100,000 pages to start). Failed scrapes and renders cost nothing even once prices exist. See [pricing](https://docs.beta.b3os.org/concepts/usage#pricing).
151
+
152
+ Note:
153
+ B3OS beta is invite-only and runs best effort on one site in Eugene, Oregon. Endpoints and limits can change; breaking changes are announced 14 days ahead. See the [beta contract](https://docs.beta.b3os.org/concepts/beta).
154
+
155
+ ## Start here
156
+
157
+ - [Scrape with curl](https://docs.beta.b3os.org/quickstart/scrape)
158
+ One request, Markdown back.
159
+ - [Install the MCP server](https://docs.beta.b3os.org/quickstart/mcp)
160
+ Give Claude, Cursor or Codex the B3OS tools.
161
+ - [Run an agent in a sandbox](https://docs.beta.b3os.org/quickstart/sandbox-agent)
162
+ Model, tools and agent on one machine.
@@ -0,0 +1,174 @@
1
+ # App addresses
2
+
3
+ > Each addressed port of an application gets one address on b3os.io that never changes, shared by link or public, with cookies of its own.
4
+
5
+ Source: https://docs.beta.b3os.org/platform/addresses.md
6
+
7
+ An application you deploy with `b3os apply` gets one address per addressed port: `https://<label>.b3os.io`. An application whose `b3os.yaml` gives no port an address gets one anyway, on its primary port ([the default address](#the-default-address)): a deploy from GitHub gets it now, and `b3os apply` with CLI 0.2.2 or later (0.2.2 is the **next** release). `address: false` and the link at the end of `b3os apply` need CLI 0.2.2 too. The other commands on this page come with CLI 0.2.1, on npm since 2026-11-15.
8
+
9
+ [Custom domains](https://docs.beta.b3os.org/platform/custom-domains), which serve an address on a name of your own such as `shop.example.com`, are not turned on for customers yet: B3 runs them on its own organization first, yours gets [`404 feature_not_enabled`](https://docs.beta.b3os.org/errors#feature_not_enabled), and there is no date yet.
10
+
11
+ Addresses are on for every organization since 2026-11-16. When B3OS cannot read whether yours has them, the address routes of the API answer [`503 flags_unavailable`](https://docs.beta.b3os.org/errors#flags_unavailable): try again.
12
+
13
+ ## What you get
14
+
15
+ - `b3os apply` ends with the address, such as `https://gpt-researcher.b3os.io`, and on a terminal (not under CI) with a link that opens a link address for you for 1 hour (CLI 0.2.2, the **next** release). It never changes: not on a push, a rollback, a restart after a crash, or with time.
16
+ - Your app is served at `/` on its own origin. No path prefix.
17
+ - A push switches the address to the new generation once that generation passes its readiness probe. If the switch fails, the deploy is undone and the old generation keeps serving. When two deploys race, the newer one gets the address, and its `access` and `cookies` stand: an older deploy still running that would set them again stops as stale (`app_host_route_conflict`, reason `newer_deploy`), and so does every deploy that began before you changed them outside a deploy. Every change to an address that serves (a switch, a rotate, a block, `b3os app down`) reaches its visitors within 6 s; longer while B3OS cannot read its address table.
18
+ - When nothing serves it, the address answers a page of its own: [`503 app_deploying`](https://docs.beta.b3os.org/errors#app_deploying) until the first deploy switches it (the page says `<label> is not live yet` and loads the app by itself when the deploy finishes), [`503 app_not_running`](https://docs.beta.b3os.org/errors#app_not_running) after `b3os app down` (or Take down in the console) or while the service is down, and [`410 app_blocked`](https://docs.beta.b3os.org/errors#app_blocked) if B3 takes it offline; when B3 lifts the block it answers `503 app_not_running` until your next apply. An unknown label is [`404 app_not_found`](https://docs.beta.b3os.org/errors#app_not_found). A request the network in front of B3OS refuses before it reaches your app, such as a path scanners probe (`/.env`, `/.git/config`) or a body its firewall rules flag, answers [`403 app_request_refused`](https://docs.beta.b3os.org/errors#app_request_refused): B3OS does not serve it on app addresses, and sending it again does not help. An address that finds its service down answers `503` for the next 2 s without asking again, so the first good answer after it comes back can wait that long.
19
+
20
+ ## When it stops serving
21
+
22
+ An address stays routed to its generation's sandbox until the next deploy switches it. When that sandbox ends (its key was revoked or expired, it reached a spend cap, it crashed, or it is gone), visitors get [`503 app_not_running`](https://docs.beta.b3os.org/errors#app_not_running), and once a visitor's request finds it gone and the node confirms it, the address says so:
23
+
24
+ - The console shows Down beside the application's name, with since when and why.
25
+ - The API's address object (`GET /v1/apps/<app>/hosts`) has `state: "down"`, `down_since` and `down_reason`: the node's `stop_reason` (`revoked`, which also covers a key that expired, `budget`, `timeout`, `failed`, `deleted`), `stopped` when it gave none, or `not_found`.
26
+ - `b3os app status` prints `down since <time>: <why>` under it, with CLI 0.2.2, the **next** release. CLI 0.2.1 shows it as `claimed`.
27
+
28
+ `b3os apply` (or a keepalive that starts a new generation) switches the address to the new generation and clears it; `b3os app down` stops it. Shown on production on 2026-11-18: an address whose sandbox reached its time read `down` (`down_reason: timeout`) in the same second as the first request that found it gone, and `serving` again after the next `b3os apply`. An address nobody visits can still read `serving` after its sandbox ended: B3OS learns it on the first request. B3 checks its own GPT Researcher addresses on a schedule; [uptime checks for your addresses](https://docs.beta.b3os.org/platform/addresses#not-there-yet) are not there yet.
29
+
30
+ Every answer of an address carries `Server-Timing`, after your app's own entries: `b3os-resolve` (finding the address's route), `b3os-node` (to the first byte from your app's sandbox) and `b3os-total` (all of B3OS's side), in milliseconds.
31
+
32
+ ## Share by link, or make it public
33
+
34
+ An address is shared by link unless you say otherwise.
35
+
36
+ - `b3os app link` prints a link, and the console's Copy link copies one. A link works 7 days; `--ttl` sets another lifetime, up to 90 days. Share it like a password.
37
+ - The first visit with a link sets a cookie, and that browser stays in for 30 days. Neither reaches your app: B3OS takes the link out of the URL (the browser is sent on to the same page without it) and out of the `x-b3os-link` header, and the cookie out of the request, before it goes on.
38
+ - A visit without a valid link gets [`401 app_link_required`](https://docs.beta.b3os.org/errors#app_link_required), the same for a missing and a wrong link.
39
+ - A script or another non-browser client sends the link's token, the part after `b3os_link=`, in an `x-b3os-link` header.
40
+ - A page on another origin that calls a link address from the browser must put `?b3os_link=<token>` in the URL: the browser's preflight (`OPTIONS`) carries no header and no cookie, and without the link in the URL it gets `401`. Calls from the app's own pages never preflight.
41
+ - An image or script of a link address on another site's page arrives without the browser's cookies, so its URL needs `?b3os_link=<token>` too. A public address needs none.
42
+ - A link address never serves a sandbox whose port is also public: that port's preview URL would reach the app without a link. A public address turns link only on a sandbox whose port is private ([`422 app_host_port_public`](https://docs.beta.b3os.org/errors#app_host_port_public)).
43
+ - `b3os app link --rotate`, or Rotate link in the console: every link stops working within 6 s, and so does every browser a link let in; streams already open can run up to an hour.
44
+
45
+ `access: public` opens the address to anyone on the internet. Its B3OS calls spend from your project, so a public address needs `grant.spend_cap_usd` on its service, and the plan stops without one. Every organization may hold up to five public addresses (`apps.hosts.public_max`, 5; [limits](https://docs.beta.b3os.org/concepts/limits#beta-defaults)), and B3 raises it on request.
46
+
47
+ ## In b3os.yaml
48
+
49
+ Five keys on a service's port. A port has an address when it sets `access`, or `public: true`, which means `access: link`, or when it gets [the default address](#the-default-address). A port cannot be 53, 1080, 3128, 7700 or 15001: B3OS's agent in the sandbox uses them. An application deployed before addresses keeps its file: its next apply gives each `public: true` port its address, and the port's preview URL ends with the old generation. When nothing else in the service changed, the plan says why it replaces the generation: `port 8000 now has the address https://gpt-researcher.b3os.io; its preview URL ends with <old sandbox>; people need a link (Copy link in the console, or b3os app link)`. Otherwise it shows the address line below and the service's own changes.
50
+
51
+ | Key | Values | Default |
52
+ |---|---|---|
53
+ | `access` | `link` or `public` | `link` |
54
+ | `host` | the label to ask for, read when the port is first claimed | the application's name ([names](#names)) |
55
+ | `primary` | `true` on the port that gets the application's own label; needed when more than one port has an address and any port sets `access`, `host`, `primary` or `cookies`. With only `public: true` ports, the first in the file gets the label and the plan says which. | `false` |
56
+ | `cookies` | `isolated`, `shared`, or `{ mode, script: [names] }` ([cookies](#cookies)) | `isolated` |
57
+ | `address` | `false`: no address on this port, not even the default one. A `public: true` port with it keeps its preview URL. CLI 0.2.2, the **next** release. | |
58
+
59
+ ```yaml b3os.yaml
60
+ version: 1
61
+ name: shop
62
+ services:
63
+ - name: web
64
+ command: node server.js
65
+ ports:
66
+ - port: 8000
67
+ access: link
68
+ primary: true
69
+ cookies: { script: [theme] }
70
+ - name: api
71
+ command: [python3, api.py]
72
+ grant: { spend_cap_usd: 5 }
73
+ ports:
74
+ - port: 9000
75
+ access: public
76
+ ```
77
+
78
+ `web` gets `https://shop.b3os.io`, shared by link, and `api` gets `https://shop--api.b3os.io`, public. The plan says each address before it is claimed, and once it is yours:
79
+
80
+ ```text
81
+ + address https://shop.b3os.io (free now)
82
+ = address https://shop.b3os.io
83
+ ```
84
+
85
+ and under a public one, `anyone on the internet can use this service; its B3OS calls spend from this project, up to $5`. `b3os apply --dry-run` claims nothing: "free now" means another organization may still claim the label first. The plan stops on these, with these words:
86
+
87
+ | The plan says | Fix |
88
+ |---|---|
89
+ | `port 8000: host, primary and cookies need an address (set access, or public: true)` | give the port `access` |
90
+ | `port 8000: access needs an address, and address: false gives it none` | keep one of the two |
91
+ | `port 9000: shop--staging: --staging is kept for environments: rename the service, or set host on the port` | rename the service, or set `host` |
92
+ | `2 ports have an address and none is primary: mark one with primary: true` | mark one port `primary: true` (not asked of a file whose addressed ports are all plain `public: true`) |
93
+ | `more than one port is primary` | keep one |
94
+ | `port 9000: access public needs grant.spend_cap_usd on this service` | set the service's spend cap |
95
+ | `port 9000: access public is over this organization's 5 public addresses (apps.hosts.public_max): B3 raises it on request, or use access: link` | ask B3 to raise it, or use `access: link` |
96
+ | `port 8000: host api: api is reserved` | ask for another `host` ([names](#names)) |
97
+ | `port 8000: support-bot: has the word support, which no address may hold; set host on the port` | set `host`: the application's name holds a word no address may hold ([names](#names)) |
98
+ | `21 addresses are over your limit of 20 (apps.hosts.max): labels are kept for good (b3os app down frees none), and B3 raises the limit on request` | ask B3 to raise it, or deploy under an application that already has an address |
99
+ | `no address is free for shop: set host on port 8000` | set `host` |
100
+ | `port 8000: shop.b3os.io: B3OS has taken this address offline. Visitors get 410; contact support` | ask B3: while one of an application's addresses is blocked, no apply of it goes through; once B3 lifts the block, the next apply serves it again |
101
+
102
+ ### The default address
103
+
104
+ A deploy from GitHub gives the default address now; `b3os apply` gives it with CLI 0.2.2 or later (0.2.2 is the **next** release) (CLI 0.2.1 gives a port with no `access` no address). When no port of the application sets `access` or `public: true`, its primary port gets an address shared by link: the port marked `primary: true`, else the first port in the file without `address: false`. The plan says so the first time:
105
+
106
+ ```text
107
+ + address https://shop.b3os.io (free now)
108
+ port 8000 is shared by link: only people with a link reach it (Copy link in the console, or b3os app link)
109
+ port 8000 has no access set, so it gets this address by default; address: false opts out
110
+ ```
111
+
112
+ `host`, `primary` and `cookies` work on that port as on any addressed one. When B3OS can give it no label (the application's name holds a word no address may hold, every candidate is taken, or your organization holds `apps.hosts.max` addresses), the port deploys as before and the plan says why: `port 8000 gets no default address, so it deploys as before: ...`. Set `host` on the port to get one. An apply run inside a B3OS sandbox whose egress is not `public` gives no port the default address either, since the node starts no addressed port from there; apply from outside the sandbox to give it one. A port that has the default address keeps it after another port sets `access` or `public: true`: the plan says `port 8080 keeps this address with access link`, and the new port's label is derived from the application's. Before the first apply, a file in which some port sets `access` or `public: true` gives the default to no port. `address: false` on a port that has the default address stops it at the next switch (the label stays the application's).
113
+
114
+ An application that already runs, deployed while its organization had no addresses, keeps running as it is: a keepalive changes nothing. Its next `b3os apply` claims the address and starts a new generation, because the port now goes to the node marked addressed. The plan says that is the only change to its spec, and the address serves once the new generation is ready.
115
+
116
+ A change to `access` or `cookies` takes effect when the next apply switches the address, not before: visitors of the old generation keep the old rules until then. With no new generation it takes effect as that apply finishes. An address turns public only on a generation that has a spend cap. `host` and `primary` are read only when a port is first claimed: a label never moves to another port, and a port never changes its label.
117
+
118
+ ## Cookies
119
+
120
+ Cookies are isolated by default because, until b3os.io is on the Public Suffix List, browsers treat every app on b3os.io as one site. A page on another app could set a cookie for all of b3os.io, and your server would take it for its own. So B3OS stores each cookie your server sets as `__Host-b3c.<name>`, which only your own address can set, and gives your server back only those, under their own names. A cookie without `HttpOnly` is also set under its own name, so your page scripts read it as before.
121
+
122
+ A cookie your page script writes (`document.cookie`) never passed through B3OS, so it is dropped on its way to your server unless you list its name under `cookies.script`. `b3os app status` and the console name each cookie this address did not set and dropped in the last 7 days, with how many requests it was dropped on. A name there may be one another b3os.io app's page set for all of b3os.io, so list a name only if your own page script sets it.
123
+
124
+ What breaks under isolation:
125
+
126
+ - A cookie set with a `Path` other than `/` loses its path: it is sent on every path.
127
+ - Two cookies of one name on different paths become one.
128
+
129
+ A cookie your server sets `SameSite=Strict` is stored as `__Host-b3s.<name>`, and B3OS does not pass it on a request that comes from another app on b3os.io, also when that is a link the visitor follows (a browser would not send a Strict cookie across sites).
130
+
131
+ `cookies: shared` turns isolation off for a port: `Set-Cookie` passes with its `Domain` removed, and your server gets the cookies the browser sends, those other apps' pages set for all of b3os.io included. Under `shared` no cookie is stored under a second name, so a Strict cookie does reach your server from another app's link. In either mode Cloudflare's own cookies never pass, in either direction: `CF_Authorization`, `__cf_bm` and four more, and any name that starts with `cf_`, `__cf` or `_cf`. A cookie listed under `script`, and under `shared` every cookie, your server's own included, reaches your server only with a plain value: one with a space, comma, backslash, quote or control character inside it is dropped. Encode such a value (`encodeURIComponent` does).
132
+
133
+ ## What your app sees
134
+
135
+ - `Host` and `X-Forwarded-Host` are the address (`shop.b3os.io`), `X-Forwarded-Proto` is `https`, and there is no `X-Forwarded-Prefix`.
136
+ - `X-Forwarded-For` is the client's address.
137
+ - `B3OS_APP_URL` in the service's environment is the address of its first addressed port, the primary first: `https://shop.b3os.io` for `web`, `https://shop--api.b3os.io` for `api`. Use it for an allowed-hosts list, a dev server's host check or an OAuth callback.
138
+
139
+ On the way out, a `Clear-Site-Data` header loses `"cookies"` (it would clear every app on b3os.io), and B3OS adds `Strict-Transport-Security` and `Origin-Agent-Cluster: ?1` when your app sends neither. B3OS also adds `Content-Security-Policy: frame-ancestors 'self'` with the application's own addresses to an HTML answer that has neither a `frame-ancestors` policy nor `X-Frame-Options`, so no other site and no other app on b3os.io can frame it. To be embedded, send your own `frame-ancestors` or `X-Frame-Options`: B3OS then leaves framing to you, and another app on b3os.io can frame yours with your visitors' cookies, since browsers count all of b3os.io as one site until it is on the Public Suffix List. A link address also gets `X-Robots-Tag: noindex`.
140
+
141
+ Caching follows your app's own headers: send `Cache-Control` and `ETag` as you would anywhere, and a browser keeps and revalidates what you allow. Nothing between B3OS and your app caches an answer. On a link address no shared cache may keep an answer, since only people with the link may read it: `public` and `s-maxage` leave its `Cache-Control`, which says `private` (also when your app sends none, unless it says `no-store`), and `CDN-Cache-Control` and `Surrogate-Control` are removed. A public address keeps your headers as they are.
142
+
143
+ ## Limits
144
+
145
+ - A request body is at most 64 MiB ([`413 payload_too_large`](https://docs.beta.b3os.org/errors#payload_too_large)).
146
+ - A request or a stream lasts at most an hour.
147
+ - A stream that sends nothing for 100 s is cut: send a heartbeat (an SSE comment, a WebSocket ping).
148
+ - A response must start within the port's `first_byte_s`, 65 s unless it declares more ([slow responses](https://docs.beta.b3os.org/sandboxes/ports#slow-responses)).
149
+ - One client gets at most 600 requests a minute across b3os.io, counted at each Cloudflare location (an IPv6 client counts as its whole /64), then [`429 rate_limited`](https://docs.beta.b3os.org/errors#rate_limited).
150
+ - A sandbox serves at most 256 requests at once through its addresses, 64 of them from one client address (an IPv6 client by its /64). A request that finds no place waits up to 2 s for one, then gets [`429 concurrency_limited`](https://docs.beta.b3os.org/errors#concurrency_limited) with `Retry-After: 1`.
151
+ - No gRPC.
152
+ - When a push switches the address, the old generation stops seconds later: its open WebSocket and SSE connections close, and clients reconnect to the new one.
153
+
154
+ ## Names
155
+
156
+ - A label is 1 to 63 lowercase letters, digits and hyphens, with no hyphen at either end. A longer one is cut and ends in 6 hex digits.
157
+ - The default is the application's name. If that is taken or is a reserved word, `<name>-<org slug>`, then `<name>-<6 hex digits of your organization's ID>`. A name that holds a word no address may hold (below) gets no default address, since every default holds the name: set `host` on the port. One project gets these: the one the application's GitHub repository link names, else the first to deploy it. Its other projects (environments are projects in the beta) get `<name>-<6 hex digits of the project's ID>`.
158
+ - `--` is B3OS's. A further addressed port gets `<label>--<service>` (`<label>--<service>-<port>` when its service has several), which only the label's owner can get. A label of 2 characters gets none (its `--` would stand at characters 3 and 4, which browsers read as an encoded international name), and neither does one of more than 55: set `host` on each further port. `<label>--pr-<n>` and `<label>--<environment>` (`--staging`, `--prod`, `--dev` and more) are kept for pull request previews and environments, so a further port of a service named `staging` or `pr-12` gets none either: rename the service or set `host`. `host` cannot hold `--`, and an application name with `--` gets `-` in its label.
159
+ - First come: the first `b3os apply` to claim a label gets it, and the same letters without hyphens count as the same label (`gptresearcher` beside `gpt-researcher`), as does a digit for the letter it looks like, or `i` for `l` (`acme-sh0p` beside `acme-shop`, `sh1p` beside `ship`).
160
+ - Reserved: any label that starts with digits and `-sbx-`, the form of a sandbox [port's own host](https://docs.beta.b3os.org/sandboxes/ports#a-ports-own-host); words B3OS keeps (`api`, `app`, `www`, `docs`, `status`, `demo`, `test`, `xn`, `origin`, `proxy`, `edge` and more), anything that names B3OS (`b3os`, `b3iq`, or `b3` between hyphens), and a word phishing uses (`login`, `pay`, `support`, `admin`, `wallet` and more), which no address may hold, B3's own included. A hyphen does not get around them, and neither do digits for letters: `ad-min` reads as `admin`, `log-in` and `l0gin` as `login`, `supp0rt` as `support`, `b-3os` and `b30s` as `b3os`. [`app_host_label_reserved`](https://docs.beta.b3os.org/errors#app_host_label_reserved) says which.
161
+ - An organization holds at most 20 addresses, stopped ones included and ones B3 blocked not (`apps.hosts.max`; [limits](https://docs.beta.b3os.org/concepts/limits#beta-defaults)).
162
+ - A label stays yours. `b3os app down`, or Take down in the console, stops it and keeps it, and no other organization ever gets it.
163
+
164
+ ## Not there yet
165
+
166
+ - An uptime check on your own addresses, with an alert when one stops answering. B3 runs one on its own GPT Researcher addresses only.
167
+ - A link address inside another site's iframe: the frame's load carries no link, so it gets `401`.
168
+ - A page on one link address calling a second link address of the same application. Serve both from one port, or make the API `public` with its own auth.
169
+
170
+ ## Shared-domain limits
171
+
172
+ Everything here holds for a sandbox [port's own host](https://docs.beta.b3os.org/sandboxes/ports#a-ports-own-host) (`<port>-sbx-<id>.b3os.io`) too: B3OS draws the same line between it and every app, and the sandbox's other hosts count as its own.
173
+
174
+ B3OS acts as the boundary between apps: a request another app's page sends carries no cookies (a plain page load still does), and the cookie rules above keep each app's server to its own. In Safari before 16.4 an app that sends `Referrer-Policy: no-referrer` gets no cookies on its own requests that are not page loads (images, scripts, fetch GETs), because B3OS cannot tell them from another app's; use `same-origin` or the default policy. The same holds for a client that is no browser but sends a browser's User-Agent with cookies: send the link in `x-b3os-link`, or an `Origin` of the app. Two gaps stay open until b3os.io is on the Public Suffix List and browsers have shipped it. A password manager may offer a password saved on one app on any other app's page. And a page script can set a cookie for all of b3os.io that other apps' page scripts can read; their servers do not get it while they stay `isolated`. Keep secrets out of cookies your scripts can read, and prefer a sign-in provider to a password form of your own.
@@ -0,0 +1,99 @@
1
+ # Prompt logging
2
+
3
+ > Keep each model call's prompt, tools and answer for 7 days with keys removed, read them, and replay a call. Off by default.
4
+
5
+ Source: https://docs.beta.b3os.org/platform/call-log.md
6
+
7
+ Prompt logging keeps what a model call was asked and what it answered: the request as your code sent it (messages, the tools offered, sampling settings) and the answer (text, reasoning, the tool calls the model chose with their arguments). It is **off by default**. Nothing of a prompt or an answer is kept until a project turns it on, and the console says "Prompt logging is off for this project." where a call's prompt would be.
8
+
9
+ ## Turn it on
10
+
11
+ The option is `platform.capture_content`, with the values `off` and `model`. The first level that sets it wins: the request, then the project, then the organization, then the node's default, which is `off`. Turn it on for a project with `settings:write` (its own project) or `platform:write` (any project of the organization):
12
+
13
+ Note:
14
+ The SDK methods on this page (`b3os.projects.setProjectSetting`, `set_project_setting`) come with SDK 0.2.2, the **next** release. Until then, call the HTTP API as the curl examples do.
15
+
16
+ **curl**
17
+
18
+ ```bash
19
+ curl -s -X PUT "https://beta-api.b3os.org/v1/projects/$PROJECT_ID/settings/platform.capture_content" \
20
+ -H "Authorization: Bearer $B3OS_API_KEY" \
21
+ -H "Content-Type: application/json" \
22
+ -d '{"value": "model"}'
23
+ ```
24
+ **TypeScript**
25
+
26
+ ```ts
27
+ await b3os.projects.setProjectSetting(projectId, "platform.capture_content", { value: "model" });
28
+ ```
29
+ **Python**
30
+
31
+ ```python
32
+ b3os.projects.set_project_setting(project_id, "platform.capture_content", {"value": "model"})
33
+ ```
34
+ **CLI**
35
+
36
+ In `b3os.yaml`, `settings: {platform.capture_content: model}`. The plan prints `~ settings platform.capture_content off -> model`, and `b3os apply` writes it. A push to a linked repository cannot turn it on: its plan marks the change `!` until the project holds the value. Or set it once with `b3os api PUT /v1/projects/$PROJECT_ID/settings/platform.capture_content -d '{"value": "model"}'`.
37
+
38
+ In the console, choose **Turn on** on a model call in an application's Traces tab, or set **Prompt logging** in Settings for the project (and, as an owner or admin, for the organization). `GET /v1/settings` says what your project resolves and where it comes from (`project`, `org` or `default`). `errors` and `all` are reserved: setting them answers [`422 option_not_allowed`](https://docs.beta.b3os.org/errors#option_not_allowed), and a value that is not one of the four answers [`422 invalid_option`](https://docs.beta.b3os.org/errors#invalid_option).
39
+
40
+ Turning it on takes effect within about 6 seconds, the time the node takes to read the new setting; a call made in those seconds may not be kept. One request can turn it off with the header `X-B3OS-Capture-Content: off`; no request can turn it on. Every answer says what applied, in `b3os.capture` and in the `X-B3OS-Options` header:
41
+
42
+ ```json
43
+ "b3os": { "capture": { "value": "model", "from": "project", "clamped": false } }
44
+ ```
45
+
46
+ `clamped` is `true` when the node's operator overrides project and organization settings. Turning prompt logging off stops new calls from being kept; what was kept stays until it expires or you delete it. Send a call and look at its `b3os.capture`:
47
+
48
+ ```json
49
+ {
50
+ "model": "b3os/qwen3.5-9b",
51
+ "messages": [{ "role": "user", "content": "Name one river in Oregon." }]
52
+ }
53
+ ```
54
+
55
+ [Try it in the playground](https://beta.b3os.org/app/playground?op=inferCreateChatCompletion&body=eyJtb2RlbCI6ImIzb3MvcXdlbjMuNS05YiIsIm1lc3NhZ2VzIjpbeyJyb2xlIjoidXNlciIsImNvbnRlbnQiOiJOYW1lIG9uZSByaXZlciBpbiBPcmVnb24uIn1dfQ)
56
+
57
+ <sub>Opens the dashboard playground with this request filled in (`POST /v1/infer/chat/completions`). The link carries no key.</sub>
58
+
59
+ ## What is kept, and what is not
60
+
61
+ Kept: chat completions, Responses and Messages calls, streamed or not, that the node admitted and sent to a model, including those that failed afterwards (a runtime error, a stream cut short, a caller that hung up, with the answer so far), with the model, route, tokens, time to first token, total time, status and trace id.
62
+
63
+ Not kept:
64
+
65
+ - speech, embeddings and token counts, which are not conversations;
66
+ - calls the node refused before sending them (a bad request, a limit): the [request log](https://docs.beta.b3os.org/platform/requests) has those;
67
+ - model calls the node makes itself, for a Vision extraction or a routine step: they share the outer request's id and are not kept;
68
+ - images, audio and documents: each is replaced by its type, size and SHA-256, and a remote image keeps only its scheme, host and path.
69
+
70
+ ## Keys are removed before anything is written
71
+
72
+ The node scrubs each call before its first byte reaches disk. When the scrub fails it keeps only the call's metadata; it never keeps an unscrubbed call. A call so dense with key-like assignments that its scrub runs out of its time budget is kept as metadata only too. If the scrubber crashes, the node stops and keeps nothing; calls it was serving end. It replaces with `[redacted:<kind>]`:
73
+
74
+ - known key shapes: B3OS keys and tokens, OpenAI and Anthropic keys, Slack, AWS, Google, GitHub, GitLab, Hugging Face and Stripe keys, JWTs, `Authorization` values, passwords in URLs, private key blocks, and secret-named assignments such as `API_KEY=…` or `"password": "…"`;
75
+ - the value of a credential query parameter in any URL (`sig`, `token`, `key`, `b3os_link`, `X-Amz-Signature` and the like);
76
+ - for a call from a sandbox, the exact values of that sandbox's secrets, in plain, JSON-escaped or percent-encoded form;
77
+ - such keys inside base64 text (either alphabet, with or without a prefix glued to it), and a key split across two neighbouring messages, content parts or tool arguments.
78
+
79
+ What it cannot see: a secret with no known shape sent from outside a sandbox, a sandbox secret shorter than 8 bytes, a key split into pieces that each look like ordinary text or into three or more pieces, and base64 longer than 4,096 characters. Those are kept as sent. Do not turn prompt logging on for a project that puts customer data in its prompts unless keeping it for 7 days is acceptable.
80
+
81
+ ## Limits
82
+
83
+ Kept calls rest on the node that served them, in a file its operators can read, and are not encrypted at rest; they are never stored at the edge (a content read passes through it). Each call keeps at most 256 KiB (the middle of the longest texts is cut, marked `[... N bytes cut ...]`), and a project at most 256 MiB a UTC day. A call kept as metadata only says why: too large, the project's daily amount reached, the key scrub failed, the node's call log full, or too many calls at once. The bytes kept are metered as `platform.content_bytes`, priced at 0 in the beta. Your other limits are on [Platform limits](https://docs.beta.b3os.org/platform/limits).
84
+
85
+ ## Read and delete
86
+
87
+ | Call | Scope | Answers |
88
+ |---|---|---|
89
+ | `GET /v1/llm-calls` | `platform:read` | the project's kept calls, newest first, filtered by `trace_id`, `model`, `sandbox_id` or `since` |
90
+ | `GET /v1/llm-calls/{request_id}` | `platform:read` | one call's metadata: model, tokens, timing, whether its content was kept and until when |
91
+ | `GET /v1/llm-calls/{request_id}/content` | `platform:content:read` | the request and the answer, scrubbed, with `Cache-Control: no-store` |
92
+ | `DELETE /v1/llm-calls/{request_id}` | `platform:write` | `204`: gone from the node now |
93
+ | `DELETE /v1/llm-calls?before=` | `platform:write` | every kept call of the project, or those before a time |
94
+
95
+ `platform:content:read` is never granted by `*` or `platform:*`. On the dashboard owners and admins hold it and members do not. Every content read is in the request log. Another project's call answers [`404 llm_call_not_found`](https://docs.beta.b3os.org/errors#llm_call_not_found). Calls are kept 7 days and then deleted; a delete zeroes the freed space before it answers. When the node is too busy to take a delete it answers [`503 capacity_unavailable`](https://docs.beta.b3os.org/errors#capacity_unavailable) with `Retry-After`, and nothing was deleted. Deleting a project or an organization does not delete its kept calls: they expire within 7 days, or delete them all first with `DELETE /v1/llm-calls`.
96
+
97
+ ## Replay
98
+
99
+ **Replay** on a kept call opens the request with its model and its last user message editable, sends it again to the same API with `stream: true` and the header `X-B3OS-Replay-Of: <request id>`, and shows both answers side by side with their tokens and time to first token. A replay is an ordinary call: metered on `infer.input_tokens` and `infer.output_tokens`, limited like any other, and kept with `replay_of` set when prompt logging is on. Values the scrub removed are sent as removed, and media that was not kept is left out.
@@ -0,0 +1,104 @@
1
+ # Custom domains
2
+
3
+ > Serve an application's address on your own name, such as shop.example.com, with one DNS record. Not turned on for customers yet.
4
+
5
+ Source: https://docs.beta.b3os.org/platform/custom-domains.md
6
+
7
+ Note:
8
+ Custom domains are not turned on for customers yet. B3 runs them on its own organization first: since 2026-11-16, `researcher.b3os.org` serves B3's GPT Researcher. For your organization `b3os app domains` says `custom domains are not on for this organization yet`, the API answers [`404 feature_not_enabled`](https://docs.beta.b3os.org/errors#feature_not_enabled), and the console shows no Domains row. There is no date yet for turning them on for you. The `b3os app domains` commands need CLI 0.2.2 or later (0.2.2 is the **next** release). This page describes how they work once they are on.
9
+
10
+ A custom domain serves one of an application's [addresses](https://docs.beta.b3os.org/platform/addresses) on a name you own, such as `shop.example.com`. You add the name, put one record in your DNS that points it at the address, and B3OS gets its certificate. The address keeps serving beside it: there is no redirect between the two.
11
+
12
+ ## Add a domain
13
+
14
+ ```bash
15
+ b3os app domains add shop.example.com
16
+ ```
17
+
18
+ It prints the record to add:
19
+
20
+ ```text
21
+ shop.example.com waiting for its DNS record (serves https://shop.b3os.io)
22
+ add at your DNS host:
23
+ CNAME shop.example.com shop.b3os.io (DNS only, if your DNS is on Cloudflare)
24
+ at the root of a zone, add instead: ALIAS shop.example.com shop.b3os.io, and TXT _b3os.shop.example.com label=shop
25
+ then: b3os app domains verify shop.example.com
26
+ ```
27
+
28
+ The domain serves the application's own address. `--service NAME` (with `--port N` when the service has more than one address) picks another of its addresses. In the console, the service panel's Domains row does the same: type the name under the address and press Add.
29
+
30
+ ## What to put in DNS
31
+
32
+ The record points at the application's own address, `<label>.b3os.io`, never at a name B3OS shares between customers.
33
+
34
+ | Your name | Records |
35
+ |---|---|
36
+ | A subdomain (`shop.example.com`) | `CNAME shop.example.com` to `<label>.b3os.io` |
37
+ | The root of a zone (`example.com`) | `ALIAS` (also called `ANAME`, or a flattened CNAME) at `example.com` to `<label>.b3os.io`, and `TXT _b3os.example.com` with the value `label=<label>` |
38
+
39
+ - If your DNS is on Cloudflare, set the CNAME to DNS only (grey cloud), not proxied.
40
+ - The root of a zone cannot hold a CNAME, so B3OS cannot read the ALIAS as one: the TXT record is what proves it.
41
+ - If your zone has CAA records, they must allow `pki.goog` or `letsencrypt.org`, which issue the certificate.
42
+ - B3OS reads the records exactly: the name's own CNAME must be `<label>.b3os.io`, or one TXT record at `_b3os.<name>` must be `label=<label>`. A CNAME to another name that leads there does not count.
43
+
44
+ ## Verify
45
+
46
+ Once the record is in, run:
47
+
48
+ ```bash
49
+ b3os app domains verify shop.example.com
50
+ ```
51
+
52
+ B3OS looks at DNS when you run verify, by itself every few minutes, and more often while the application's page is open in the console. When it sees the record, the domain takes its name and Cloudflare starts on the certificate; from then on B3OS follows it by itself. A domain whose record B3OS has not seen within 72 hours is removed: add it again.
53
+
54
+ Adding a name reserves nothing. Several applications may add the same name, and the first whose record DNS shows gets it. A name another application holds while DNS still names that application's address is [`409 app_domain_taken`](https://docs.beta.b3os.org/errors#app_domain_taken).
55
+
56
+ The record keeps the name, not only takes it: B3OS looks at it again each time it looks at the domain (at least once a day). A domain whose record no longer names its address stops serving at that look and shows Failed; put the record back and it serves again.
57
+
58
+ ## States
59
+
60
+ `b3os app domains ls` lists each domain with its state, and so does the console.
61
+
62
+ | State | CLI | Console | What it means |
63
+ |---|---|---|---|
64
+ | `dns_pending` | waiting for its DNS record | Waiting for DNS | Added; B3OS has not seen the record yet. Nothing is served. |
65
+ | `certificate_pending` | DNS record seen, waiting for the certificate | Getting a certificate | The record is seen and the name is the application's. Cloudflare is validating it over HTTP and issuing the certificate. Nothing is served yet. |
66
+ | `active` | active | Active | Served. |
67
+ | `failed` | failed, with Cloudflare's words | Failed | Cloudflare reports a timeout or a validation error, or the name moved away, or DNS no longer names the address. Nothing is served. Fix what it says, then `verify` starts the check again. |
68
+ | `removing` | being removed | Removing | Removed; nothing is served, and B3OS is deleting its certificate. |
69
+
70
+ Only an `active` domain is served. A name in any other state answers [`404 app_not_found`](https://docs.beta.b3os.org/errors#app_not_found).
71
+
72
+ ## What visitors and your app get
73
+
74
+ - The domain serves exactly what the address serves: the same app, the same `access` and `cookies`, the same pages while nothing serves it, and [`410 app_blocked`](https://docs.beta.b3os.org/errors#app_blocked) if B3 takes the address offline.
75
+ - A link address stays shared by link on the domain. A link from `b3os app link` works there too: put its `?b3os_link=` part after your name. A browser that opened it stays in on that name for 30 days; the address and the domain each need the link once.
76
+ - `http://` answers 301 to `https://` on the same name.
77
+ - `/.well-known/acme-challenge/` and `/.well-known/pki-validation/` answer 404 on the domain, as on the address: your app cannot serve them. Cloudflare validates the certificate itself.
78
+ - The `frame-ancestors` policy B3OS adds to HTML lists the application's active domains beside its addresses, so its pages can frame each other.
79
+ - Your app still sees `Host` and `X-Forwarded-Host` as the address (`shop.b3os.io`), and `B3OS_APP_URL` stays the address. Build links from relative paths, or from the `Origin` the browser sends.
80
+
81
+ ## Remove a domain
82
+
83
+ ```bash
84
+ b3os app domains rm shop.example.com
85
+ ```
86
+
87
+ It asks first (`--yes` without a terminal). In the console, Remove asks in a dialog. The domain stops serving within 6 s (longer while B3OS cannot read its address table), and B3OS deletes its certificate. Delete the record at your DNS host too.
88
+
89
+ A record you leave behind can only ever point at your own address: a label is never given to anyone else, and no other application can take the name without a record that names its own address.
90
+
91
+ If you delete the DNS record but keep the domain, it stops serving and shows Failed at B3OS's next look (at least once a day). It keeps the name for 7 days in case the record comes back; after that B3OS lets the name go and the domain leaves your list.
92
+
93
+ ## Move a domain to another application
94
+
95
+ Point the record at the second application's address, then add the domain there and verify it. The second application gets the name as soon as its verify sees the record, and the first one's domain goes. You can also remove it from the first application first. The record is the proof, so nobody can move a name they cannot change the DNS of.
96
+
97
+ ## Limits
98
+
99
+ - An organization holds at most 3 custom domains, pending ones included (`apps.domains.max`; [limits](https://docs.beta.b3os.org/concepts/limits)). B3 raises it on request.
100
+ - A domain serves one address. A name is on one application at a time.
101
+ - No wildcard names (`*.example.com`): add each name. No IP addresses, no names without a dot, and no names under `b3os.io`, where each application already has its address. Names under B3's own domains are B3's. Nor may a name have a label that holds `b3os` or `b3iq`, read without hyphens and with digits as the letters they look like (`login-b3os.example.com`, `b3-os.example.com`, `b30s.example.com`): only B3's own organizations may use one. [`422 app_domain_invalid`](https://docs.beta.b3os.org/errors#app_domain_invalid) says which.
102
+ - An international name is stored and shown in its `xn--` form.
103
+ - B3OS holds a fixed number of custom domains in all during the beta. When it is reached, verify answers [`503 app_domain_unavailable`](https://docs.beta.b3os.org/errors#app_domain_unavailable) and the domain stays pending: try again later.
104
+ - When Cloudflare or DNS cannot be reached, the domain commands answer `503 app_domain_unavailable` with `Retry-After`, and nothing changes.