Quick start and interfaces¶
Quick start¶
The normal path is the published release. brama detect is the safe first
command either way: it reads local hardware, performs no provider request, reads
no credential, creates no Brama state, and incurs no model cost.
Download the release for your platform from https://brama.wisent.com/download,
verify the manifest's signature and the archive's digest, and unpack it, as
Download shows step by step; then run
./bin/brama detect.
Serving traffic takes more than the archive. Provision this installation's trust
material once with bin/provision-skarbiec-trust — the archive ships no signing
key and the launcher refuses to start until that material exists — then read
ONBOARDING.md before the first authenticated request.
Maintainers working on unreleased source run the same command from a checkout,
which needs Git and the Rust toolchain required by Cargo.lock (the production
build uses the pinned builder in Dockerfile):
git clone https://github.com/wisent-ai/brama.git brama
cd brama
cargo run --locked -- detect
Expected output contains these fields with host-specific values:
GPU Type: ...
VRAM: ... GB
RAM: ... GB
CPU Cores: ...
Neither command starts a service. The checkout path may leave build output under
target/; it is a local build cache, not product state. Continue with
ONBOARDING.md for the authenticated loopback and production
operator paths. Runnable, risk-labeled workflows are indexed in
examples/.
Primary interfaces¶
- HTTP inference:
POST /v1/chat/completions,/v1/messages,/v1/responses,/v1/embeddings, and/v1/moderationsare the canonical model-execution interfaces. The three chat formats share one routing decision, one identity contract, and one attempt budget; they differ only in the shape of the request and the answer. - Streaming: any of the three chat formats streams when the request asks
for it --
"stream": trueon chat completions and Anthropic Messages,"stream": trueon Responses. The response istext/event-streamin the caller's own dialect:chat.completion.chunkframes closed bydata: [DONE], Anthropicmessage_start/content_block_*/message_stopevents, orresponse.*events closed byresponse.completed. A stream that ends without its terminal event is a generation that was cut after it committed; the caller holds an incomplete answer and Brama has already stopped. Rotation across models and credentials happens only before the first byte, so a committed stream is never silently re-run. - Account API keys and subscriptions: authenticated Wisent users use
GET|POST /v1/account/subscriptionsandDELETE /v1/account/subscriptions/:subscription_id. Brama derives the owner from the verified Wisent session; the caller never supplies an account or agent identifier.POSTaccepts an API key for any supported remote provider, stores it through Skarbiec without returning it, and makes that account's canonicalprovider/modelroutes available for buffered and streamed calls. - HTTP discovery:
GET /v1/models; account discovery combines public catalog metadata with models executable by that account's stored keys, while signed agent discovery includes the shared subscription pool. - Subscription lifecycle:
GET,POST, andDELETE/v1/subscriptions/:agent_id; always bearer- and HMAC-protected. AGETreturns, per subscription, the plan windows the provider itself reported (limits:used_fraction,window_label,resets_at_ms, and therecorded_at_msthe reading was taken at), what Brama measured (measured: requests, failures, input and output tokens, first and last use), any rate-limitblockin force, when the record last changed (observed_at_ms), where the newest window came from and whether it is still current (usage_source:provider,trafficorprobe, andstale), the newest proactive check (probe:attempted_at_ms,ok,detailwhen there is something to explain, andsource--usage_reportorcompletion), and where the credential itself stands (credential:state--active,needs_reauthorizationordisabled-- withcause,recorded_at_ms,expires_at_msandrefreshed_at_ms;nullwhile nothing has been recorded about the grant).credential.stateis what separates a subscription that is quiet from one whose sign-in is overdue, andcauseis the provider's own sentence for the refusal. - How fresh a plan window is:
usage_sourcenames which statement the newest window is -- the provider's own usage report, the headers of real traffic, or an operator's probe -- and isnullwhen there is no window to attribute.staleis true when the newest usage report failed or a served window's own reset instant has passed. Every recorded reading is served, because a number that says when it was taken is information and an empty plan is not; a newer reading replaces it. - What an empty
limitsarray means: one of four states, and the newest check is what tells them apart. Windows present: render them, aged by the newestrecorded_at_ms, and say "as of" only whenstaleis false. Empty withprobe.okfalse: the credential or the provider refused, andprobe.detailis its own sentence. Empty with noprobeand nothing measured: nothing has ever gone through this subscription. Empty withprobe.oktrue: the provider genuinely publishes no plan state, andprobe.detailsays so when the provider publishes no usage report at all. Only the last of those may be shown as "no plan window", and none of them is a zero. - Operations: public
GET /healthandGET /readyz; protectedGET /stats./healthis liveness only and says so in its body (dependencies: not_probed): it answersokfrom a gateway whose every credential redemption is being refused./readyzis the one that answers whether the product works: it redeems one capability per configured provider and returns503naming the providers that failed, with no secret in the body. Deploy checks and uptime monitors should read/readyz;/healthonly proves the process is running. - Error contract: a refused redemption is
503 authorization_errorwith codecredential_unauthorizedandretryable: false, never a429 capacity_error. Waiting does not repair an authorization id that does not match, and classifying it as capacity sends the caller into retries and the operator into the subscription catalogue. - Desktop control plane:
brama-desktopalone may callGET /v1/admin/snapshot,PUT /v1/admin/routes, theGET,POST, andDELETE/v1/admin/subscriptions/:agent_idfamily, andPOST /v1/admin/subscriptions/:agent_id/:subscription_id/probe, which is the only endpoint in the product that deliberately spends plan quota. These endpoints return identifiers, usage and status only; subscription credentials remain write-only. - CLI:
serve,version,detect,test,subscriptions list,subscription refresh,collect-task-quality, andmcp. Billable commands require an explicit cost acknowledgement, and commands that mutate state require an explicit--reason. - MCP: read-only stdio JSON-RPC exposing
brama_detectonly. Model execution, credential discovery, collection, and mutation are deliberately excluded.
The complete state, error, retry, authorization, and resource contract is in
CORE.md. Provider capability and lifecycle contracts are in
INTEGRATIONS.md.