primary_output_key: which output key is a Sume agent run's headline
Set primary_output_key on a Sume agent run so a backend can read one URL; the receipt resolves it into primary_output_url once the run completes.

An agent run can return text, several images, a video and files. Your backend usually wants one of them. primary_output_key names it, and the receipt resolves it for you.
Where the field lives
On Agent Completions, primary_output_key is an optional request field: the output key that holds the headline result. On a schedule you bind it in the dashboard together with an output schema, as described in Create a schedule. The receipt then carries primary_output_key and primary_output_url, which are null unless status is completed (Runs and results).
A worked example
The docs give an image schema named sume/action-image-v1 with caption and image properties, where image is a SumeMediaFile reference, and primary output key image. The run then returns output.image.url as a durable media.sume.com URL. Clearing the schema name and key returns you to the default shape, sume/action-run-output/v1, with text, images[], videos[], audio[] and files[].
{
"type": "object",
"additionalProperties": false,
"required": ["caption", "image"],
"properties": {
"caption": { "type": ["string", "null"] },
"image": { "$ref": "SumeMediaFile#" }
}
}Why not just take the first video
Picking output.videos[0] works until the agent makes a draft and a final, or an intro and an outro. Naming the key moves that decision into the schema, where it is versioned with the run, and gives your code a single field to read when next_action says there is nothing more to fetch.
If projection fails, the receipt carries output_error and the run's error.code is that code; read both before you retry. Retrying a failed projection by starting a new run starts a new spend, so check the cap first.
Sources
Related posts
More in Agents
- Scheduled run cap null: no ceiling, but wallet and limits still bind
Sending generation_spend_cap_usd null drops the automation ceiling for one run. Wallet balance, admission and org limits still apply, and 0 is a 400.
- Scheduled Sume agent runs: the $1.00 default cap and min(request, cap)
A Sume schedule saves a spend cap, defaulting to $1.00 when unset. An API trigger can lower a run's cap but never raise it past the saved one.
- script_run budget stop: split the batch and wait outside the script
A Sume script_run budget stop (timeout, call or paid budget) means the script asked for more than allowed. Split it, or return job ids and wait outside.
- script_run on Sume MCP: what the sandbox cannot call, and its budgets
Sume's script_run tool runs JavaScript that calls other tools with await sume.call. It has 5 to 55 second timeouts, call budgets, and no discovery tools.
Written by Sume