GPT-6.1 Sol function calling to start a Sume Agent Completion safely
Expose one function that starts an Agent Completion. Let GPT-6.1 Sol fill instruction and input, and keep the spend cap and idempotency key out of its args.

Give the model a function whose parameters are only the creative fields, and add the money fields yourself. OpenAI's model page lists function calling as supported for GPT-6.1 Sol. The function schema should hold instruction and input. Your handler adds generation_spend_cap_usd, which Agent Completions require, and an Idempotency-Key that you derive.
Which side owns which field
Keep untrusted text in input, since Sume gives input to the agent as caller data, not as instructions. Put only your own wording in instruction.
| Field | Owner | Note |
|---|---|---|
instruction | Model, from your template | Short and specific |
input | Model | Caller data from the user |
generation_spend_cap_usd | Handler | Required, no default |
Idempotency-Key header | Handler | One per tool call id |
import os
import requests
def start_completion(call_id: str, args: dict, cap_usd: float) -> str:
r = requests.post(
"https://api.sume.com/v1/agent/completions",
headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}",
"Idempotency-Key": f"call-{call_id}"},
json={"instruction": args["instruction"], "input": args.get("input", {}),
"generation_spend_cap_usd": cap_usd},
timeout=30,
)
r.raise_for_status()
return r.json()["data"]["status_url"]
Return a pointer, not the media
Return the status_url to the model as the tool result, and poll it in your own loop. Do not let the model poll in a tight loop, since each turn has its own cost.
Check the docs before you ship
Sume's limits and field names change faster than blog posts do. Read the linked docs pages for the current request fields before you ship, and send a dry_run or a low spend cap on your first real call.
Sources
Related posts
More in Integrations
- Read-only MCP session lists avatars; create gives insufficient_scope
A hosted MCP connection with read scope can list and search avatars, but paid avatar and video tools return insufficient_scope until you grant write.
- HyperFrames on the Sume Integrations page: built in, not Frame.io
The HyperFrames row is Sume's own video editor and composition stack. It has no Connect button and is not Frame.io, YouTube or any external host.
- Integration OAuth in Sume: 10-minute state, one claim, admin recheck
Sume's connector OAuth state is random, user-bound and valid ten minutes. A cookie binds the browser, one callback claims it, and admin rights are rechecked.
- jobs_wait defaults to 50 seconds: how many calls for a long render
Remote MCP jobs_wait waits 50 seconds by default and 55 at most. A render that takes N minutes needs about N x 60 / 50 calls on the same ids. Never resubmit.
Written by Sume