Every deployed Boogy service has a boogy.toml manifest next to its crate. The manifest tells the host how to route requests to your service, what capabilities it needs, and how to gate access. You pass the path to this file when deploying:
boogy deploy path/to/my-service/boogy.toml
The host parses and validates the manifest on every deploy. Unknown fields are rejected everywhere, in every section — a misspelled or stale key is a hard parse failure at deploy time, not a silently ignored line. That includes [capabilities]: a capability name that does not exist fails the deploy rather than defaulting to off. Stick to documented fields.
A realistic notes service with persistent storage, per-user auth, rate limiting, and a scheduled cleanup job:
[service]
id = "notes"
name = "Notes API"
version = "0.2.0"
wasm = "target/wasm32-wasip2/release/notes_api.wasm"
description = "Per-user notes with tagging and full-text search."
keywords = ["notes", "personal", "storage"]
category = "productivity"
owner = "alice" # optional — the platform sets this to your handle at deploy; normally omit it
[routing]
path = "/"
methods = ["GET", "POST", "PUT", "DELETE"]
[capabilities]
store = true
auth = true
clock = true
entropy = true
logging = true
background_jobs = true
[limits]
memory_mb = 64
timeout_ms = 10000
cpu_deadline_ms = 15000
[ingress]
mode = "authenticated"
[ingress.rate_limit]
rpm = 600
burst = 60
[background_jobs.handlers.cleanup_old_notes]
deadline_ms = 30000
max_attempts = 3
backoff_ms = 5000
max_concurrent_per_tenant = 2
schedule = "0 0 3 * * *" # 03:00 UTC daily (sec min hour day month dow)
[service]Top-level service identity. All fields in this section are required unless marked optional.
| Field | Type | Required / Default | Meaning |
|---|---|---|---|
id |
string | required | Stable identifier for this service. ASCII alphanumeric, -, _; max 64 chars; no leading -; no dots or slashes. Used in URLs and on-disk paths. |
name |
string | required | Human-readable display name. |
version |
string | required | Must be semver (MAJOR.MINOR.PATCH, e.g. "0.2.0"), refused otherwise at publish. Stored with the deployment; not used for routing. It is the info.version of the service’s served openapi.json and openrpc.json. |
release_notes |
string | optional, null |
What changed in this version, shown as plain text to an owner offered the update. Max 2000 characters. |
wasm |
string | optional, "" |
Path to the compiled .wasm file, relative to the manifest (typically target/wasm32-wasip2/release/<crate_name>.wasm). Omit it for a frontend-only (Frontend shape) deployment — it runs no wasm. A Service/FullStack deploy with no wasm and no [frontend] is rejected (“nothing to deploy”). |
description |
string | optional, null |
One-paragraph description. Max 2000 chars. |
keywords |
string array | optional, [] |
Searchable tags. At most 40 entries; each ≤ 64 chars. |
category |
string | optional, null |
Category tag for grouping. Max 64 chars. |
repository, homepage, documentation |
string | optional, null |
Links shown with your module (its source, its site, its docs). Each must be an http:// or https:// URL with a host, at most 1024 chars; publish refuses any other scheme (javascript:, data:, file: …), a URL with no host or a user name before the host, and boogy check names the field first. |
thumbnails |
string array | optional, [] |
Pictures of your app for its registry listing — an app picker shows them as the listing’s cover, paged when there are several (an app with none gets a placeholder). At most 3. Each is a path relative to [frontend].root to a PNG, WebP, JPEG or AVIF file, so it ships in your frontend bundle; requires a [frontend] block. Publish refuses a thumbnail that is not in the bundle, is larger than 1 MiB, or whose bytes are not really one of those image types (the file’s contents decide, not its name). Shown in order; they fill a wide, short frame, so keep the subject away from the edges. |
owner |
string | optional, "" |
The owning user’s handle, as a bare key (owner = "alice"), NOT a [service.owner] table. Normally omit it — you are authenticated when you deploy, so the platform sets the owner to your handle at publish/provision and overwrites any value here. Keep it only for local-dev/tests that provision under a fixed owner without the auth flow. Same character rules as service.id; not a platform-reserved name (v1, healthz, _admin, _agents, _sys). |
The
owner+idpair is the unique key for a deployment: deploying the same pair replaces the running service. Since the platform fillsownerfrom your authenticated handle, you normally only setid.
[routing]Both fields are required.
| Field | Type | Required / Default | Meaning |
|---|---|---|---|
path |
string | required | The base your service’s own router sees. Use "/" — every new service should. The service is served at the root of its own address, https://<name>-<suffix>.boogy.app (the name from [service] id, the suffix random; boogy deploy prints it), and the platform relocates each request to this base before your handler sees it, so the base never appears in a URL: with "/", a route /notes is at https://notes-7k3q.boogy.app/notes; with "/api" the router must register /api/notes for that same URL. |
methods |
string array | required | HTTP methods to accept: ["GET", "POST"]. Use ["*"] to match any method. |
[capabilities]The [capabilities] section is optional — a missing or empty one grants nothing (deny-by-default). Each capability defaults to false; a service that doesn’t declare a capability gets a host error if its wasm code attempts to use it. (A frontend-only deployment grants none and may omit the section entirely.)
| Field | Type | Default | Meaning |
|---|---|---|---|
store |
bool | false |
Isolated, transactional storage scoped to this service. |
auth |
bool | false |
Read the caller’s identity (auth::current_principal(), ownership guards). |
clock |
bool | false |
Read the current wall-clock time. |
entropy |
bool | false |
Cryptographic random bytes. |
logging |
bool | false |
Write to the platform log stream. |
peer |
bool | false |
Call other deployed services via peer::fetch (in-process, no network hop). |
outbound_http |
bool | false |
Make HTTPS calls to external URLs. Requires a [outbound] block with non-empty allowed_hosts. |
background_jobs |
bool | false |
Enqueue and manage background jobs (jobs::enqueue / jobs::cancel / jobs::status). |
signing |
bool | false |
Produce cryptographic signatures (ECDSA secp256k1 / P-256, Ed25519) with a private key the host holds and your code never sees — only a public key and the signature come back. |
websockets |
bool | false |
Publish real-time messages to end-user clients over channels declared in [[websockets.channels]]. |
files |
bool | false |
Store and serve files (uploads, images, documents, exports) through the platform, so the bytes never pass through your service. Also needs a file-collection block declaring each collection and its ceilings — see the boogy-file-storage skill for its shape. |
There is no capability for serving protobuf: it is an inbound surface that grants your wasm nothing, so it is declared in [grpc] instead.
[limits]The [limits] section is optional — a missing or empty one takes the per-field defaults below.
Storage capacity is not among them: storage is set per account, not per
service, and a [limits] storage_mb key is refused by name at publish. Every
service you own shares one budget, tables and files together: a free allowance,
paid growth above it, and a ceiling your operator can raise. Check it with
GET /v1/storage (the account) and GET /v1/quota (each service).
| Field | Type | Default | Meaning |
|---|---|---|---|
memory_mb |
u32 | 32 |
Per-request Wasm linear memory cap in MiB. The platform sets a maximum (64 MiB on the hosted platform); a manifest above it is refused at deploy with a 400 naming the cap. |
timeout_ms |
u64 | 5000 |
Legacy wall-clock timeout in ms. |
cpu_deadline_ms |
u64 | 30000 |
Per-request wall-clock budget B_req in ms. The scheduler uses this as the slot-holding ceiling. Epoch deadline traps a CPU-bound guest; an outer timeout returns HTTP 504. Range: 1–600000. |
[frontend]Optional. Declares a web frontend the platform serves for you — no bundler, no Node, no JS toolchain. You ship TypeScript/JS/HTML/CSS source; the control plane transpiles it at deploy and serves the assets from object storage, decoupled from your wasm. Presence + whether you publish a wasm derives the deployment shape:
[frontend] + wasm → full-stack (UI + API, one origin).[frontend], no wasm → frontend-only (a static site / SPA).[frontend] → a plain service (wasm only).| Field | Type | Default | Meaning |
|---|---|---|---|
root |
string | required | Source dir holding the frontend (e.g. index.html + .ts/.css/assets). Safe relative path — no .., no leading /. |
api_prefix |
string | — | Full-stack only: requests under this prefix go to the wasm backend; everything else is served as a static asset. Must start with /. Omit for a frontend-only deployment. |
index |
string | "index.html" |
SPA entry document, served for extensionless / fallback routes. |
build |
string | "ts" |
"ts" (platform transpiles TypeScript) or "none" (assets are already built). |
private |
bool | false |
true gates asset serving behind the service ingress (a private app). Default public. |
allow_cdn |
bool | false |
When a bare import isn’t vendored under /vendor/, resolve it to an esm.sh CDN URL in the generated import map instead of failing the build. |
jsx_import_source |
string | "preact" |
Module specifier the automatic JSX runtime imports from — the emitted import is <value>/jsx-runtime. Only affects .tsx/.jsx sources under build = "ts". |
minify |
bool | on when build = "ts" |
Minify (compact) the transpiled .ts → .js output at deploy. Defaults on whenever the bundle is transpiled; set minify = false to ship readable JS for debugging. Compaction only (whitespace/optional tokens); passthrough .js is served verbatim. |
csp |
string | — | Opt-in Content-Security-Policy, emitted verbatim on served responses. Unset = no CSP header. A safe baseline (X-Content-Type-Options, Referrer-Policy, X-Frame-Options) is always on. |
frame_options |
string | "same_origin" |
same_origin (→ SAMEORIGIN), deny (→ DENY), or none (omit the header, for apps meant to be embedded). |
[frontend]
root = "web"
api_prefix = "/api" # full-stack; omit for a frontend-only site
build = "ts"
private = false
A frontend-only deployment needs no [capabilities] and no data model — it
runs no wasm. It still declares [ingress]: the assets are served over HTTP, so
who may fetch them is a decision like any other (mode = "public" for a public
site). See the boogy-serving-frontends skill.
[boards] — in a Boards paneOptional. Needs a [frontend] block.
| Key | Type | Default | Meaning |
|---|---|---|---|
background |
string | "app" |
"app": the app paints its own background. "board": in a Boards pane the app draws no page background and the board’s shows through; the app renders in the board’s colour scheme (Boards is dark), whatever the viewer’s system setting. |
[frontend]
root = "web"
[boards]
background = "board"
With "board", paint your page background with var(--ground) from @boogy/web, or redefine your own background token under :root[data-board-background]. Redefine only a token used as page paint: a token also used as a colour (an ink, a solid ground) must stay opaque, or everything it colours disappears with the page. The SDK’s own rule sits in its cascade layer, so an app’s own (unlayered) body or --ground rule outranks it: a page that sets its own background elsewhere keeps it. Covering surfaces keep the app’s own colour: an SDK sheet covers with the opaque --ground-solid unless the app sets --sheet-ground, and full-page popovers use --ground-solid too. An app that wants them see-through sets --sheet-ground: transparent and hides what they cover.
In a board your page renders in the board’s colour scheme — your text and controls must read in that scheme (an opaque light page background with default dark-scheme text will be unreadable). Outside a board the app is unchanged.
[branding] — the sign-in pages your app sends people toOptional. When your app sends someone to sign in, the platform’s sign-in, consent and handle pages lead with your app: its logo and name sit at the top, and the heading names it (“Sign in to Pollster”). The platform appears once, in a strip at the bottom of every page that shows the page’s own address. Without [branding] the pages use the platform’s look: a calm blue, in the viewer’s own light or dark preference.
| Key | Type | Default | Meaning |
|---|---|---|---|
theme |
string | "system" |
"light", "dark", or "system" to follow the viewer’s light/dark setting. |
logo |
string | none | A PNG, WebP, JPEG or AVIF file inside [frontend].root, checked like a [service].thumbnails entry: it must be in the bundle, at most 1 MiB, and really one of those image types. Shown in a fixed 56 px rounded square. Without one, the page shows your app’s initials. Needs a [frontend] block. |
accent |
string | calm blue | One hex colour, "#1d5fd6" or "#15d", for the primary button, links, checkboxes and the focus ring. The platform adjusts it for each theme so text on it and links stay readable (at least 4.5:1), so a very light or very dark accent may come out darker or lighter than you wrote. |
[frontend]
root = "web"
[branding]
theme = "system"
logo = "assets/logo.png"
accent = "#1d5fd6"
The name is your [service].name; there is no separate one. What you cannot change: the platform strip, the address it shows, the “by
[ingress]Controls who can call your service. The section is required, and it must state
a mode — a manifest that omits either is refused at publish. There is no
default: public would be an unsafe guess and authenticated would silently
401 a service you meant to publish, so the decision is yours to write down.
mode is what is required, not merely the header: a bare [ingress], or a
manifest that writes only [ingress.rate_limit], is refused the same way.
[ingress]
mode = "public" # public = anyone on the internet, with no credential
| Mode | Who can call | When to use |
|---|---|---|
"public" |
Anyone, including unauthenticated | Static content, public APIs, redirect handlers |
"authenticated" |
Any agent or workload with a valid token | Most user-facing APIs |
"allowlist" |
Agents listed in allowed_agents |
Invite-only APIs, beta access |
"internal" |
Workloads listed in allowed_origins |
Service-to-service only, no human callers |
"mixed" |
Agents in allowed_agents OR workloads in allowed_origins |
APIs serving both a public UI and an internal mesh |
| Field | Type | Default | Meaning |
|---|---|---|---|
mode |
string | required | One of the five modes above. No default — state it. Required on every [[ingress.routes]] block too (see below). |
allowed_agents |
string array | [] |
For allowlist / mixed: agent matchers. Each entry is * (any agent), @handle (by handle, case-insensitive), or agent_<uuid> (exact ID). Required non-empty when mode = "allowlist". |
allowed_origins |
string array | [] |
For internal / mixed: workload URI matchers. Each entry is * / boogy://* (any workload), boogy://<owner>/* (any service owned by <owner>), or boogy://<owner>/services/<name> (exact service). Required non-empty when mode = "internal". |
[[ingress.routes]]Per-route carve-outs. Each block pins its own mode (and its own allowlists — a
route inherits nothing from the service-wide policy) for the paths it matches.
The classic case is a mode = "public" webhook receiver inside an otherwise
restricted service.
[ingress]
mode = "authenticated"
[[ingress.routes]]
path = "/webhook" # service-relative; exact, or trailing /* for a prefix
mode = "public" # required — see below
| Field | Type | Default | Meaning |
|---|---|---|---|
path |
string | required | Service-relative pattern: exact (/webhook) or prefix (/stripe/*). Literal only — no {param} capture. Applies to all HTTP methods. |
mode |
string | required | One of the five modes above. No default — state it. |
allowed_agents |
string array | [] |
This route’s own matchers. Same rules as the service-wide field. |
allowed_origins |
string array | [] |
This route’s own matchers. Same rules as the service-wide field. |
A matching route replaces the service-wide mode for that path — it does not
narrow it. That is why mode is required here as well: omitting it on an
internal service would leave that one path reachable by anyone. A block with no
mode is refused at deploy, and the diagnostic names the path. Among matching
routes the most specific wins (exact beats prefix, longer prefix beats shorter);
if none match, the service-wide mode applies.
[ingress.rate_limit]Token-bucket rate limiter. Applied after auth checks pass — denied requests do not consume budget.
| Field | Type | Default | Meaning |
|---|---|---|---|
rpm |
u32 | — | Requests per minute (refill rate). |
burst |
u32 or null | rpm / 60 |
Burst capacity. Omit to use the default of one second’s worth. |
[ingress.delegation]Opt-in on-behalf-of (OBO) policy. Absent = delegated (actor-bearing) tokens are rejected. Present = delegated calls are accepted when they satisfy the rules below.
| Field | Type | Default | Meaning |
|---|---|---|---|
allow_actor |
string array | [] |
Workload URIs permitted to deliver requests on behalf of agents. Same matcher syntax as allowed_origins. Empty = delegation disabled even if the section is present. |
max_delegated_scopes |
string array | [] |
Optional scope cap. When non-empty, every scope on the inbound token must match at least one entry. Matchers: * (any), resource:action (exact), resource:* (any action), *:action (any resource). Empty = no scope cap. |
require_principal_in_allowed_agents |
bool | false |
When true, the principal (the agent being acted for) must also appear in allowed_agents. |
[ingress]
mode = "authenticated"
[ingress.delegation]
allow_actor = ["boogy://alice/services/gateway"]
max_delegated_scopes = ["notes:*"]
[ingress.cors]Opt-in, host-enforced cross-origin allowlist. Absent = no CORS headers emitted (default-deny; browsers block cross-origin reads). Only relevant when a different origin calls your API — a same-origin full-stack page needs none. The host answers OPTIONS preflights at the edge and reflects the allowed origin on actual responses. CORS is not authorization — an allowed origin still passes the normal ingress (token) check.
| Field | Type | Default | Meaning |
|---|---|---|---|
allowed_origins |
string array | [] |
Exact origins (https://app.example.com), or ["*"] to allow any — permitted only when allow_credentials = false. |
allowed_methods |
string array | [] |
Methods echoed on preflight. Empty = a safe default set. |
allowed_headers |
string array | [] |
Request headers echoed on preflight. |
allow_credentials |
bool | false |
Emit Access-Control-Allow-Credentials: true, which lets the browser attach cookies to a cross-origin request. true forbids allowed_origins = ["*"] (rejected at deploy). You do not need this for an Authorization: Bearer header — that is admitted by listing authorization in allowed_headers, and it works alongside the ["*"] wildcard. Reach for a bearer rather than a cookie when callers come from origins you cannot enumerate in advance. |
max_age |
u64 | — | Preflight cache lifetime in seconds. |
[ingress.cors]
allowed_origins = ["https://app.example.com"]
allowed_methods = ["GET", "POST"]
allow_credentials = false
[ingress.app_tokens]For a service without a [frontend]: the exact URLs a sign-in for an app token may return to. A page on another origin signs the service’s people in and calls it with Authorization: Bearer; the one-time code comes back in the fragment of one of these URLs, so only the pages you list can receive it. Absent = no page can obtain an app token for this service.
| Field | Type | Default | Meaning |
|---|---|---|---|
redirect_uris |
string array | — | 1 to 20 absolute URLs. A sign-in’s redirect must equal one of them byte for byte — no extra query, other path or other spelling. Each must be https:// (http:// only for localhost, *.localhost or 127.0.0.1), on a host written in lowercase letters, digits, - and . (no IPv6 literal such as [::1]: use localhost), carry no #fragment and no userinfo, be written in canonical form (https://app.example.com/, not https://app.example.com), and be on an origin [ingress.cors] allowed_origins names by itself (a "*" entry names no page). Rejected at deploy otherwise. |
[ingress.cors]
allowed_origins = ["https://app.example.com"]
allowed_headers = ["authorization", "content-type"]
[ingress.app_tokens]
redirect_uris = ["https://app.example.com/signed-in"]
[outbound]Required (with non-empty allowed_hosts) when capabilities.outbound_http = true. Ignored when the capability is off.
[outbound] uses deny_unknown_fields — any unrecognised key is a parse error.
| Field | Type | Default | Meaning |
|---|---|---|---|
allowed_hosts |
string array | [] |
Glob patterns for permitted HTTPS destinations. Supports * wildcards (e.g. "*.openai.com"). Must be non-empty when outbound_http is granted. |
max_timeout_ms |
u32 | 30000 |
Hard ceiling on the per-call timeout wasm can request. |
default_timeout_ms |
u32 | 10000 |
Per-call timeout when wasm doesn’t specify one. Must be ≤ max_timeout_ms. |
max_request_bytes |
u64 | 1048576 (1 MiB) |
Cap on the outbound request body size. |
max_response_bytes |
u64 | 10485760 (10 MiB) |
Cap on the response body size. |
allow_plaintext |
bool | false |
Allow http:// destinations. Default requires HTTPS. |
[outbound.rate_limit]| Field | Type | Default | Meaning |
|---|---|---|---|
rpm |
u32 | — | Per-API egress rate cap (requests per minute). |
burst |
u32 or null | rpm / 60 |
Burst capacity. |
[capabilities]
outbound_http = true
[outbound]
allowed_hosts = ["api.stripe.com", "*.openai.com"]
max_timeout_ms = 15000
default_timeout_ms = 5000
[secrets]Declares the names of secrets your service will reference at runtime. Values are bound out-of-band via the admin API (PUT /_admin/secrets/{owner}/{service}/{name}); your Wasm code never sees the raw value — only the declared name.
The [secrets] table is transparent: each key is a secret name, each value is a spec object.
[secrets]
stripe_key = { usage = ["outbound-header"] }
openai_key = { usage = ["outbound-header"] }
| Spec field | Values | Meaning |
|---|---|---|
usage |
["outbound-header"] |
Where the secret may be used. Currently the only accepted value is outbound-header — inject the secret value as an HTTP header in an outbound_http::fetch call. At least one entry is required. |
Undeclared secret names return unknown-secret at runtime regardless of whether a value is bound.
[background_jobs.handlers.<name>]Declares a job handler that the background-jobs worker can call. Each handler is a separate TOML sub-table. Handler names must start with an ASCII letter and contain only ASCII alphanumerics and _ (max 64 chars).
Declaring handlers without granting capabilities.background_jobs = true is valid (the service processes jobs but never enqueues them). The inverse is also valid (the service enqueues jobs but another service processes them — not typical, but supported).
| Field | Type | Default | Meaning |
|---|---|---|---|
deadline_ms |
u32 | 30000 |
Max wall-clock time for one handler invocation. Must be > 0. |
max_attempts |
u32 | 3 |
Retry limit per job. Must be ≥ 1. |
backoff_ms |
u32 | 1000 |
Delay between retry attempts (ms). |
max_concurrent_per_tenant |
u32 or null | null (unlimited) |
Per-tenant in-flight cap for this handler. Omit for no per-handler limit; the global tenant cap still applies. Must be > 0 when set. |
schedule |
string or null | null |
6-field cron expression (sec min hour day month dow). When set, the host materialises a scheduled job that fires this handler on the given cadence. Example: "0 0 * * * *" = top of every hour. |
[grpc]Serve a protobuf surface — gRPC, Connect and gRPC-Web, all three from one
Router::grpc mount, chosen by the caller’s request content-type. Connect and
gRPC-Web are served on the service’s own address, at
/<package.Service>/<Method>; native gRPC is not served by the platform at
present. Optional: omit the section (or leave services empty) and protobuf is
off for this deployment.
Not a capability. Protobuf is an inbound surface, so nothing new is granted to your wasm and deny-by-default is untouched.
[routing]
path = "/"
methods = ["GET", "POST"] # POST is REQUIRED when [grpc] is present
[grpc]
proto = "proto/notes.proto"
services = ["notes.v1.NotesService"]
# reflection = true # the default
| Field | Type | Default | Meaning |
|---|---|---|---|
proto |
string | "" |
Path to the .proto, relative to your crate root. Required when services is non-empty. Must be a safe relative path (no .., no leading /). |
services |
string array | [] |
The fully-qualified service names this deployment serves (notes.v1.NotesService, not NotesService). Empty = protobuf off. |
reflection |
bool | true |
Serve gRPC server reflection, plus the compiled descriptor set verbatim at GET /descriptor.bin on the service’s address. Both inherit this service’s [ingress] policy — on a public service they publish your .proto shape. |
[routing] methods must include POST. The gRPC wire is POST-only, and a
[grpc] block without it is rejected when the manifest is parsed.
Build before you deploy. A build script compiles the .proto (pure Rust — no
protoc or buf to install) and writes the compiled descriptor into your crate;
the deploy step ships it beside the wasm. Deploying without building stops with
exactly that instruction.
Two ways a [grpc] deployment is refused with a 409 at provision, before it
ever becomes routable — deliberately at deploy time rather than per request:
services names something the compiled descriptor does not contain (usually a
package or service-name typo between the manifest and the .proto).stream on either
side of any declared method refuses the whole deployment. Make the method
unary, or leave that service out of services.Where a previous version exists the platform restores it so your service keeps serving; the 409 body says whether that restore succeeded.
[pricing]Charge callers for your routes. Optional: omit it and every route is free.
Each priced route declares what it costs — a fixed price, a rate over a unit,
or both — and who pays. Money comes from the payer’s prepaid balance: the
platform sets aside the route’s maximum before your handler runs, charges the
actual amount after it completes, and returns the rest. Your service’s owner
account receives the charge.
[routing]
path = "/"
methods = ["GET", "POST"]
[pricing.units.tokens]
source = "guest" # your code reports this unit
[pricing.routes.summarize]
match = { path = "/summarize", methods = ["POST"] }
payer = "principal" # the user who sent the request pays
price = "0.0005" # fixed part, USD
rate = { unit = "tokens", per = 1000, price = "0.0020" }
max = "0.0500" # required with rate; the most one call can cost
[pricing.routes.lookup]
match = { path = "/items/{id}", methods = ["GET"] }
payer = "caller_service" # the service that called you pays
price = "0.0001"
| Field | Type | Meaning |
|---|---|---|
match |
table | Exactly one of: path (+ optional methods), grpc = "pkg.Service/Method", path + jsonrpc_method, or path + mcp_tool. path is relative to [routing] path — with path = "/", the URL path — and uses the same {param} / {*rest} syntax as your router. A route naming GET also covers HEAD; leaving methods out covers every method except OPTIONS. A grpc rule also prices a POST to /<package.Service>/<Method> at the service’s address, however the call arrives. |
payer |
"principal" | "caller_service" |
principal: the signed-in user who sent the request. caller_service: the owner of the service that called yours; a direct call from outside is refused. |
price |
decimal string | Fixed amount in USD, up to 6 decimal places. Write it as a string — "0.0010", not 0.001. |
rate |
table | unit, per (a positive integer) and price: the charge adds ceil(units x price / per). |
max |
decimal string | Required with rate. The most one call can cost; also the amount set aside before it runs. |
ceiling |
table | Module authors only: price, rate_price, max upper bounds that a provisioner of your module may not exceed. |
refund_if_request_fails |
bool | Default false. When true, this route charges nothing if the request that reached it ultimately fails with a server error. |
Units. fuel, wall_ms, request_bytes and response_bytes are measured by the
platform and need no declaration. A unit your code reports is declared with
source = "guest" and reported per request with boogy_sdk::pricing::report_units.
Because your own code reports it, a guest unit is bounded by max: callers see
max as the most a call can cost.
When a call is charged. Only when your handler completes without a server error. A 5xx, a crash, or a timeout charges nothing. A 4xx is charged: your handler ran.
Who needs extra permission. A user’s own signed-in request may spend their balance. A service acting on a user’s behalf, a background job running as the user, or an app calling a service other than its own may spend it only under a spending grant the user created.
Discovery. Every priced service serves its price list at
GET /pricing.json on its address, and its openapi.json operations carry an
x-boogy-pricing extension written by the platform. On a priced service
/pricing.json is reserved: a route of yours at that path is not reachable.
Refusals are JSON, {"error": "<code>", "route": "<id>", "required": "<amount>"}:
| Status | error |
Meaning |
|---|---|---|
| 401 | payment_requires_identity |
A principal-paid route was called without signing in. |
| 402 | insufficient_funds |
The payer’s balance is below the route’s max (or price). |
| 402 | payer_unavailable |
No one can pay: a caller_service route called directly, or a principal route called by a service identity. |
| 402 | spending_grant_required |
Someone other than the user is spending the user’s balance without a grant. |
| 402 | spend_limit / request_budget |
The payer’s own spending limit, or the request’s X-Boogy-Max-Charge-Usd, would be exceeded. |
| 400 | non_canonical_path / ambiguous_envelope |
The request path or JSON body is ambiguous about which route it is. |
| 503 | ledger_contended / ledger_unavailable |
Try again later. |
Every response carries X-Boogy-Charged, so a client can see what a request cost —
including one that failed.
[store]Reserved section. The platform provides isolated, transactional storage to any service with capabilities.store = true. No configuration knobs are available today — the section may be omitted or left empty.
[store]
# no fields today
[provisioning]Advanced: controls who may provision a service instance from a published module (relevant to the Boogy module registry). Most developers deploying their own services can omit this section entirely.
| Field | Type | Default | Meaning |
|---|---|---|---|
mode |
string | "public" |
"public" (anyone may provision), "private" (only the module author), or "allowlist" (only listed user IDs). |
allow |
string array | [] |
User IDs permitted to provision when mode = "allowlist". Required non-empty when mode is allowlist. |
[discovery]Lets other services find an account’s instance of this module, and says what each instance publishes for them. With it, a service can ask the platform “does dave run this module, and where?” and get an answer instead of assuming a service id. Use it when instances of one module talk to each other, as in a messenger where every person runs their own copy.
[discovery]
listed = true # the default whenever routes are declared
[[discovery.routes]]
name = "peer-messages" # the stable name a caller looks for
path = "/chats/api/peer/messages" # the module's own path
version = 1 # bump when this route's contract changes
| Field | Type | Default | Meaning |
|---|---|---|---|
listed |
boolean | true if any routes are declared, else false |
Whether an instance can be found by a lookup. The one [discovery] field a provisioner may override, at provision or later through an upgrade’s overrides, so whoever runs an instance can hide theirs (or list it, if the author left it off). |
routes |
array of { name, path, version } |
[] |
What every instance publishes. Set by the module author alone: a provision override may not add, remove or change them. |
[discovery] section means an instance is never listed, whatever a provisioner’s override says: discovery is the author’s opt-in.path is the module’s own path, as the module declares its routes. A call from another service reaches it at that path on every instance. path must be absolute, with no .., query or fragment. version starts at 1.discovery::lookup(handle, &Module::Same) returns the instances of the module the calling service runs (see the SDK reference). Over HTTP, GET /v1/registry/instances/{handle}?module=<author>/<name> works for anyone signed in.Capability used but not granted
If your Wasm component calls store::*, auth::*, etc. without the corresponding capability in [capabilities], the host will return an error at the linker stage (before your code runs). Grant the capability in the manifest.
Path traversal characters rejected
service.id (and owner, if you set it) must be ASCII alphanumeric plus - and _, max 64 chars, no leading -. Characters like /, \, ., :, and all Unicode are rejected. The validator also rejects .. outright, and reserved owner names (v1, healthz, _admin, _agents, _sys).
outbound_http with empty allowed_hosts
Granting capabilities.outbound_http = true without a [outbound] block (or with allowed_hosts = []) fails validation. The capability requires at least one destination.
No [ingress], or an [ingress] with no mode
Both are refused at publish. A service is reachable over HTTP, so its exposure
must be stated rather than inferred — and the section header is not the
statement, mode is. A bare [ingress], or a manifest whose only ingress key
is a subtable such as [ingress.rate_limit], fails the same check.
allowlist/internal/mixed ingress with empty lists
mode = "allowlist" requires at least one allowed_agents entry; mode = "internal" requires at least one allowed_origins entry; mode = "mixed" requires at least one entry in either list. An empty list silently denies every request at runtime — the validator catches this at deploy time.
cpu_deadline_ms out of range
Must be in the range 1–600000. Zero or values above 600000 are rejected.
Invalid handler name
Background-job handler names must start with an ASCII letter and contain only ASCII alphanumerics or _, max 64 chars. Names that don’t meet this rule are rejected at deploy time.
A price written as a number
price = 0.001 is rejected: prices are decimal strings (price = "0.001"), so no
amount is ever rounded by a floating-point parse. More than 6 decimal places, a
negative amount, and rate without max are rejected too.
Two priced routes that can match the same request
Rejected at deploy. Every request matches at most one priced route, so which price applies is never a matter of declaration order.