llm.music/v1

A model makes music from a prompt (and lyrics). It takes a while, so it's a job. Every call names its model as provider/model: a provider the app's admins added in Settings → LLM, a slash, and that provider's own id for the model. Shared types (File, Usage, ModelInfo, Job, the errors) are in pocketone.dev/ext/contracts/llm.

A wire contract at /api/_c/llm.music/v1 (music.go), one provider. The llm extension provides it, over Vultr, Cloudflare Workers AI, OpenRouter and any OpenAI-compatible API.

Use

In page code it's $llm.music (bound by the llm extension):

const job = await $llm.music.createAsync({ model: "vultr/ace-step-1.5", prompt: "gentle lullaby", seconds: 60, wait: "5m" })
if (job.status === "done") record.set("music", $llm.file(job.files[0]))

Over HTTP (a superuser, or a token with the scope shown):

Operation HTTP Body Token scope
Create POST /api/_c/llm.music/v1/create {"model": "...", "prompt": "...", "lyrics": "", "seconds": 60, "wait": ""} llm
Get POST /api/_c/llm.music/v1/get {"id": "vultr:music_..."} llm:read
Content POST /api/_c/llm.music/v1/content {"id": "...", "index": 0} llm:read
Models GET /api/_c/llm.music/v1/models ?provider= (optional) llm:read

create and get answer a job: {"id", "status" (queued, running, done, failed), "progress", "files", "outputs", "error", "model", "usage"}. With wait ("5m") create returns once the job stops, its files included; without it, at once. The id carries the provider (vultr:music_02a2…), and the provider keeps the job. content returns one of a done job's files.

Errors: not_configured (no providers), unknown_model, not_supported, provider (the cloud's own error), timeout.

From Go: musicv1.Contract.Must(app) (from pocketone.dev/ext/contracts/llm/music/v1).

Provide

Implement musicv1.Music and provide it in Register (musicv1.Contract.Provide(app, impl)). Route on the provider/ prefix, answer not_supported for a provider that can't do this kind, unknown_model for a missing model or provider, and provider with the cloud's own message (never its key) when the cloud refuses. Fill model with the full provider/model that answered, and usage with what the provider reports.

Commands and APIs

Every operation is a REST endpoint, a pocketone command and an MCP tool, all generated from the contract and behind the same token scope check and hooks. See Remote CLI, or the full CLI, Extension APIs and MCP references.

create

Starts making music. With Wait it returns once the job is done (or failed), its files included; otherwise at once, to follow with Get.

REST POST /api/_c/llm.music/v1/create
CLI pocketone remote llm music create --model <value> --prompt <value> --lyrics <value> --seconds <n> --wait <value> --options <json>
MCP llm_music_create
Token scope llm
Input field Flag Type
model --model string
prompt --prompt string
lyrics --lyrics string
seconds --seconds float
wait --wait string
options --options json

get

Says how a job is going.

REST POST /api/_c/llm.music/v1/get
CLI pocketone remote llm music get --id <value>
MCP llm_music_get
Token scope llm:read
Input field Flag Type
id --id string

content

Fetches one of a done job's files.

REST POST /api/_c/llm.music/v1/content
CLI pocketone remote llm music content --id <value> --index <n>
MCP llm_music_content
Token scope llm:read
Input field Flag Type
id --id string
index --index int

models

Lists the music models of every provider in Settings → LLM.

REST GET /api/_c/llm.music/v1/models
CLI pocketone remote llm music models --provider <value>
MCP llm_music_models
Token scope llm:read
Input field Flag Type
provider --provider string

Extensions

Extension
llm provides

License

MIT