Skip to content

Generate media with an agent

An agent can generate images, video, music, speech and 3D models with the MCP tool media.generate. The tool does not wait for the result: it checks the request, checks the media budget and queues a job. A background tick submits the job to a provider, stores the result in the workspace’s artifact store, writes a provenance record for every file and books the cost. The agent follows the job with media.status.

Generative media is off by default. It needs three things: a plan that includes it, the workspace policy switched on, and a provider the workspace can reach.

  1. Open Settings → Models and find the Generative media card. If the card says Generative media is not included in your plan, the plan does not carry the media.generate entitlement; ask the instance admin (see Set up generative media).
  2. Switch on Allow generative media.
  3. Optionally narrow the Allowed modalities and Allowed providers, set a Budget per modality (USD) per day and per month, and choose the Default disclosure.
  4. Select Save policy. A value the server refuses is shown next to the form with the key it refers to, for example media_policy.caps.video.daily_usd.
The Generative media card in Settings, Models tab, with the Allow generative media switch, the allowed modalities and providers, the budget per modality and the default disclosure.The Generative media card in Settings, Models tab, with the Allow generative media switch, the allowed modalities and providers, the budget per modality and the default disclosure.

Only an owner or admin can change the policy. A project can narrow the workspace policy on the project page’s Media tab (Project media policy), but never widen it: a project cannot switch generation on when the workspace has it off, add a modality or provider, or allow model pins. Every key, its default and its precedence are listed in the media policy reference.

Media providers are called with an API key. A subscription sign-in (OAuth) never reaches a media provider, whatever the provider. Add a key under the workspace’s API keys:

Provider Modalities Key
openai image OpenAI API key
google image (Imagen), video (Veo) Gemini API key
minimax video, music, speech MiniMax API key
lyria music Google Vertex AI key (express mode)
local_runner image, video, music, speech, 3D model none: open-weights models on your own GPU runner

When no provider is named in the call, the job goes to the first reachable provider in the workspace’s generation lane (image_gen, video_gen, music_gen, speech_gen, model3d_gen) that the policy allows. When the lane names nothing reachable, the order is openai, google, minimax, lyria, local_runner. 3D models are served only by local_runner, which your admin sets up.

An agent needs a profile with Ops tools (supacloud.ops.* or media.generate by name). media.generate counts against the Ops rolling caps like every other Ops tool, and it is not available on the external MCP gateway.

{
"modality": "image",
"prompt": "Isometric illustration of a small data centre at dusk",
"purpose": "exploration",
"params": { "size": "1024x1024" },
"idempotency_key": "hero-illustration-1"
}
Argument Required Meaning
modality yes image, video, audio_music, audio_speech or model_3d
prompt yes 1 to 4000 characters
purpose yes exploration, shippable_asset, marketing or internal
idempotency_key yes 1 to 128 characters; see below
negative_prompt no Up to 2000 characters
reference_artifact_ids no Up to 4 artifact ids of this workspace
params no size (1024x1024), duration_s, aspect (16:9), seed, voice
territory no ISO 3166-1 alpha-2 code of the market the file is meant for
disclosure_class no none, label_required, synthetic_person or synthetic_voice
provider, model no A pin; allowed only when the policy has Allow model pins on

The answer is {job_id, state, deduplicated}. Calling again with the same idempotency_key and the same arguments returns the same job with deduplicated: true; the same key with other arguments is refused as a conflict.

Poll with media.status {job_id}. A finished job reports state: "done", the artifact ids, the provenance ids, the cost and the approval state.

Each job is priced before any provider is called. The estimate is checked against, in this order:

  1. the workspace hard stop (the workspace budget is blocked, or the remaining budget is smaller than the estimate);
  2. the workspace’s daily and monthly cap for the modality;
  3. the project’s daily and monthly cap for the modality, when the project sets one.

A cap refuses when used + estimate is greater than the cap; reaching it exactly is allowed. Used counts finished jobs at their real cost and unfinished jobs at their estimate, so jobs in flight already hold their share. A refusal names the layer, for example workspace_video_daily, and no provider is called. The real cost of a finished job is booked to the workspace month spend under media:<modality>, so it also counts against the workspace budget.

Other refusals:

  • generation switched off, a modality or provider the policy does not allow, a pin without Allow model pins, or a territory the provider is not licensed for;
  • a prompt the injection scan flags;
  • a reference to an artifact that still awaits approval.

Secrets are removed from the prompt before it is stored and before it is sent; the provider receives the redacted text. The generated file is stored byte for byte as the provider delivered it, so an embedded C2PA manifest or SynthID watermark survives.

A job ends in one of five states: done, failed, refused, timed_out or canceled. A provider that refuses a prompt for its content ends the job as refused after one call; SupaCloud never retries it with a changed prompt.

A file waits for a human approval before any agent can use it when:

  • it is speech (audio_speech is always a synthetic voice),
  • its disclosure is synthetic_person or synthetic_voice, or
  • its purpose is shippable_asset.

Until an owner or admin approves it, artifact.get returns url: null and approval_required: true, so an agent cannot fetch the bytes to commit them. The agent’s feed shows a text line with a link to the Media tab instead of a preview. Autonomy level does not change this: the decision is a person’s, on the web.

media.provenance.get {artifact_id} returns the provenance records and a sidecar document (schema supacloud.media-provenance/v1): provider, model, prompt hash, redacted prompt, seed, references, disclosure, watermark, C2PA manifest, territory licence, approval. When an agent commits a generated file to a repository, it commits the sidecar next to it as <file>.provenance.json. A repository may choose another name in its own rules; SupaCloud supplies the content.

  • Media tab on the project page: the job list, a provenance drawer per file with preview, badges, the C2PA download and the sidecar.
  • Web terminal and chat: media lists the ten newest jobs of the workspace; media status <job_id> shows one.