Set up generative media
Agents generate images, video, music, speech and 3D models with the MCP tool
media.generate (see Generate media with an agent).
The module is off by default on three levels, and each one is a separate
decision:
- the plan must carry the
media.generateentitlement (this page); - the workspace must switch its media policy on (the workspace owner or an admin, under Settings → Models);
- a provider must be reachable for the modality (a workspace key, an instance key the workspace opted into, or your own GPU runner).
The design is recorded in ADR 0082.
1. Grant the plan entitlement
Section titled “1. Grant the plan entitlement”media.generate is a plan feature. New installations seed it as:
| Plan id | media.generate |
|---|---|
free, pro, team |
false |
legacy, enterprise |
true |
Whether a paid plan sells generative media is a pricing decision, so the paid tiers
start denied. To grant it, open the owner console at /admin, pick the Plans
tab and set media.generate to true on the plan. A self-hosted instance running
the Enterprise edition grants every feature by edition, so no plan edit is
needed there.
2. Choose where provider keys come from
Section titled “2. Choose where provider keys come from”Media providers accept only an API key. A subscription sign-in (OAuth) is never used for a media call, even where the same provider accepts it for agent runs.
A key is resolved the same way as for the other internal model calls:
- a key the workspace pinned as its system credential, then
- a workspace key (BYOK) visible to the workspace; both are used while the
workspace budget’s
api_mode_controls.api_keyis on (the default), then - the instance key from the environment or the OpenBao
supacloud/aimap, used only when the workspace budget’sapi_mode_controls.systemistrue. It isfalseby default, so an instance key is never spent for a workspace that did not opt in. The flag is part of the workspace budget (PUT /api/settings/budget).
| Provider | Instance key | Base URL |
|---|---|---|
openai |
OPENAI_API_KEY |
OPENAI_BASE_URL (the same setting as the completion path) |
google |
GEMINI_API_KEY |
the Gemini API base of the completion path |
minimax |
MINIMAX_API_KEY |
MINIMAX_BASE_URL, default https://api.minimax.io |
lyria |
Vertex AI express-mode API key | VERTEX_EXPRESS_BASE_URL, default https://aiplatform.googleapis.com |
Every provider call goes through the provider gateway: an SSRF-vetted client, pinned to the resolved IP, without redirects, with the gateway’s retry on 429 and 5xx only. A base URL that points at an internal address is refused.
3. Run open-weights models on your own GPU
Section titled “3. Run open-weights models on your own GPU”The local_runner provider runs an open-weights model on a runner you operate. It
serves all five modalities and is the only provider for 3D models. It costs
nothing in the media budget, because the hardware is yours.
- Enroll a runner on the GPU host with the label
cuda(see Set up a runner securely). The host holds thegpuhost lock, so two GPU jobs never share the card. - Create an agent profile for the generation tasks. It needs the
artifact.puttool, which every profile has by default. - In the workspace media policy, set
local_runner.agent_profile_idto that profile andlocal_runner.commandto the command that generates a file, for example a script on the runner that reads a prompt file and writes into an output directory (one line, at most 500 characters).
A local_runner job creates one task in the job’s project on that profile, with
the task config runner.required_labels = ["cuda"], runner.on_no_runner = "fail"
and runner.host_lock = "gpu". The task writes the redacted prompt to
media-job/<job_id>/prompt.txt, runs the command, and uploads each output with
artifact.put as a render. When the task succeeds, the media tick adopts the
uploads as generated_media with their provenance. Without an enrolled cuda
runner the task fails instead of running somewhere else. A job without a project
cannot use local_runner.
4. Storage and retention
Section titled “4. Storage and retention”Generated files are artifacts of kind generated_media (cap 256 MiB) in the
artifact store, stored byte for byte as the provider delivered them. A C2PA
manifest found in a PNG or JPEG is stored as a separate artifact of type
application/c2pa and linked from the file’s provenance record. A database
constraint refuses any generated_media artifact without a provenance record, and
agents and runners cannot upload that kind directly.
Retention is the plan’s artifact retention (30 days on free, 90 on pro, 180 on
team, by contract on enterprise). A workspace can shorten it for generated files
with artifact_storage.retention_days.generated_media. See
Configure artifact storage.
5. Watch what it costs
Section titled “5. Watch what it costs”The actual cost of every finished job is booked to the workspace month spend under
media:image, media:video, media:audio_music, media:audio_speech or
media:model_3d, next to the agent spend, so the workspace budget and its hard
stop cover it. Each step is audited: media.job_queued, media.job_<state>,
media.generated, media.prompt_flagged, media.approval_decided and
media.policy_updated.