BBramaDocs

Brama CLI command reference

brama speak

Speak one text through a voice route, over the same credential redemption and refusals POST /v1/audio/speech uses. The provider answers encoded audio rather than JSON, so this command writes a file and says how many bytes went where; printing audio into a terminal is not an outcome anybody wanted, which is why --output is required rather than optional.

Invocation

brama speak --input <TEXT> --voice <VOICE> --output <FILE> [--model <ALIAS|ROUTE>] [--response-format <FORMAT>] [--speed <SPEED>] [--json] --allow-provider-cost
InputRequired/defaultMeaning
--input <TEXT>requiredWhat to say. The endpoint accepts up to four thousand and ninety-six bytes in one request.
--voice <VOICE>requiredThe provider's own voice name, such as alloy. Every declared voice provider requires one.
--output <FILE>requiredWhere the audio is written.
--model <ALIAS|ROUTE>optional; voice-modelThe media alias, or a canonical route the catalogue lists as an audio model.
--response-format <FORMAT>optionalThe container the provider should encode, such as mp3 or wav.
--speed <SPEED>optionalPlayback speed between a quarter and four.
--allow-provider-costrequired to send anythingAcknowledge that this performs a billable provider request.
--jsonoptional; offPrint the result as one JSON document instead of key: value lines.

Output and state

A successful run prints model, the route it resolved to, the audio content type the provider stated, how many bytes were written and the output file, as key: value lines or, with --json, as one document with the same fields. Brama re-encodes nothing: what lands on disk is exactly what the provider sent.

A refused run prints the provider's own sentence and exits non-zero. This is a real one, against voice-model routed to openai/gpt-4o-mini-tts on a deployment whose OpenAI account has no credit:

$ brama speak --input "Brama speaks." --voice alloy --output spoken.mp3 --allow-provider-cost
provider_rate_limited: You have no credits remaining. Add credits to continue using the API at https://platform.openai.com/settings/organization/billing/.

Refusals

SentenceMeaning
refusing a billable speech request without explicit --allow-provider-costNothing was sent.
--speed must be a finite number, not NaN (likewise --stability and --similarity-boost)A usage error, exit 2; the setting cannot be carried as JSON, so nothing was sent rather than a request with the setting dropped.
alias `voice-model` is a media alias this gateway knows but no route is declared for it; declare one with `brama routes set voice-model <provider/model>` or `PUT /v1/admin/routes`The alias has no route here.
invalid_request: route `together/…` does not generate speechThe named route's provider serves no speech endpoint.
provider_failure: provider returned no audioThe provider answered success with an empty body; no file was written.
provider_rate_limited: <the provider's own sentence>The route was reached and refused.
cannot write <path>: <reason>The audio arrived and the destination could not be written.

Every refusal prints on standard error. A missing --allow-provider-cost is a usage error and exits 2 before anything is sent; every other refusal exits 1.

See media, brama image, brama video, or the CLI tree.