REST API

REST reference

Every endpoint an agent uses under /v1.

The full schemas are in /v1/openapi.json. This page is the map. The requests that create briqs take an Idempotency-Key header (Retries).

Sandbox credentials permit only the guide's target-only routes, not this whole map. Quota and detailed file-limit messages need a team credential. Ask the owner for transfer limits when using a sandbox credential.

Briqs

MethodPathNotes
POST/v1/briqs{ recipe, name?, sleep? } with the fields of the service it makes (image, env, cmd, size, volume, files; checkout, steps, ports for a language recipe), or { spec } (spec), plus stack and expose ("public" or "private": the URL comes back as outputs.URL). Waits until ready, up to waitTimeoutMs (120000), unless wait: false. The answer has ready and, when false, a message
GET/v1/briqs?stack=&all=List with state and cost; all=true includes destroyed briqs
GET/v1/briqs/:idOne briq: cost, sleep and sleepsAt, endpoints, env (secrets masked), stoppedReason, lastExit, files (path and bytes)
GET/v1/briqs/:id/statusSafe { sandbox, costLine }: identity, size/state, timestamps, sleep and target cost. No configuration, endpoints or access tokens
POST/v1/briqs/:id/exec{ cmd, timeoutMs?, stdin?, async? } → { exitCode, stdout, stderr }, for up to 60 s (a longer timeoutMs runs with 60000 and adds a warning). cmd is an argv, run without a shell: ["sh", "-c", "…"] for pipes or $VARS. With async: true: 202 { exec } at once, the command runs on (Run a long command)
GET/v1/briqs/:id/execs/:execId?waitMs=An async exec: state, exitCode, the last 64 KB of its output. waitMs (up to 45000) waits for it to end
GET/v1/briqs/:id/execsThe briq's async execs, newest first
DELETE/v1/briqs/:id/execs/:execIdStops an async exec and everything it started
GET/v1/briqs/:id/logs?since=&limit=Log lines and a next cursor
POST/v1/briqs/:id/files{ path, contentBase64 }, up to 1 MB; larger is a 400 validation that names the raw route, and so is base64 cut short (line breaks are fine) → { path, bytes, sha256, verified }: verified when the briq computed the same SHA-256 from its disk. A warning when the path is a boot file
PUT/v1/briqs/:id/files?path=The same, with the raw bytes as the body: curl -X PUT --data-binary @server.py; the same answer. Up to maxFileBytes of GET /v1/quota (1 MB or more); more is a 413 that names the limit. The body is passed on as it arrives
GET/v1/briqs/:id/files?path={ path, contentBase64 }, up to 1 MB; larger is a 400 validation that names the raw route
GET/v1/briqs/:id/files/raw?path=The file's bytes as the body, up to maxFileBytes of GET /v1/quota; its size is the Content-Length
POST/v1/briqs/:id/expose{ port, mode?, rotate? } → { url, mode, port, warning? }. One URL per briq: another port moves it and restarts the machine. See Expose
POST/v1/briqs/:id/fork{ name?, stack?, sleep? }. See Forks
POST/v1/briqs/:id/stopKeeps the disk. Pass { "mode": "cold" } to discard memory and boot the image on the next start; accepted only while running
POST/v1/briqs/:id/startStarts a briq stopped by /stop or by its own exit. A sleeping briq wakes on its next use without it, and so does one stopped by a limit once the limit has cleared
POST/v1/briqs/:id/sleep{ sleep, stack? }: "30m", "3h", "7d" or "never", a string. stack: true for every briq of its stack → { briqs }. See Sleep
DELETE/v1/briqs/:idDestroy

Existing sandboxes may retain a 1 MB file limit. The error names that limit; use a new sandbox for larger transfers.

Stacks

MethodPathNotes
GET/v1/stacks
POST/v1/stacks{ name }. POST /v1/briqs also creates the stack it names
GET/v1/stacks/:idThe stack and its briqs
POST/v1/stacks/:id/fork{ into?, expose?, sleep? }. expose (private or public): outputs reachable from outside briq. See Forks
DELETE/v1/stacks/:idDestroys every briq of the stack. The empty stack stays
POST/v1/stacks/up{ file } (the stack file, YAML or JSON), plus stack?, secrets?, expose? and wait. expose: true: outputs reachable from outside briq, each database over a TLS endpoint. Creates the services the stack lacks, all or none; never changes or deletes → { stack, briqs, created, existing, outputs }

Recipes and pricing

MethodPathNotes
GET/v1/recipesEvery recipe: name, title, description, tags
GET/v1/recipes/:nameOne recipe: every parameter (type, default, description), outputs and briqs
GET/v1/pricingSizes and prices

Agents, quota and audit

MethodPathNotes
GET/v1/quotaWhat this credential may still spend and run, maxFileBytes (the largest file the raw file routes take), with its team and key (id, kind: key or oauth, name). features.sandboxScopedCredentials reports whether scoped minting/admission is enabled. Not available to a sandbox credential
GET/v1/audit?limit=&key=&agent=The team's audit events
GET/v1/usage?days=The team's usage per day (default 14 days)
GET/v1/agentsKeys and connected clients
GET, POST/v1/keysList or create keys. Creating needs a person session. Optional sandboxId binds a bq_sbox_… key to that existing sandbox when enabled
POST/v1/keys/:id/rotateReplace the bearer, preserving its immutable sandboxId; the old secret stops working. Person session only
PATCH, DELETE/v1/keys/:id, /v1/agents/:idEdit a policy or revoke. Session only

Support

MethodPathNotes
POST/v1/support{ topic: "question" | "bug" | "idea", message } emails the briq team; the answer goes to the account's address (with a key or an agent's token: to the person who connected it, or the team's owner). Five per ten minutes

Example

curl -X POST https://api.briq.cloud/v1/briqs \
  -H "Authorization: Bearer $BRIQ_API_KEY" -H "Content-Type: application/json" \
  -d '{ "recipe": "postgres", "image": "postgres:17" }'
{
  "briqs": [
    {
      "id": "bq_7kq2m9x1p4ab",
      "name": "db",
      "image": "postgres:16",
      "size": "small",
      "state": "running",
      "internalHost": "…internal",
      "endpoints": [],
      "sleep": "1h",
      "sleepsAt": "2026-09-18T17:41:12Z",
      "costCentsSoFar": 0.058,
      "…": "…"
    }
  ],
  "outputs": { "DATABASE_URL": "postgres://postgres:…@…internal:5432/app" },
  "recipe": "postgres",
  "costLine": "cost so far … · sleeps at 17:41 UTC unless used"
}

A recipe can start several briqs, so briqs is a list and outputs belongs to the run. Destroy each id with DELETE /v1/briqs/:id.

On this page

Free to try

Try briq, on us.

Every new account starts with €10 of credits. No card.

Start building

How can we help?

Message to the briq team