Microsoft-Decision-1: gate a text brief before a paid Sume video job
Send the brief to Decision-1 as a choice question, render only on 'render', and fail closed on any error. Python sample using the Foundry systemone path.

To gate a Sume video job with Microsoft-Decision-1, send the brief as the state of a choice question with three options (render, review, reject), and submit to Sume only when the model picks render. Any HTTP error, timeout or unexpected option should return review, so a broken gate never turns into a paid render. The sample below is the whole gate.
The gate
Microsoft's Learn page says to post to <resource endpoint>/providers/microsoft/v1/systemone, to set model to your deployment name (not the underlying model name), and to authenticate with Entra ID or an api-key header. The response answers object is keyed by your question names, and a choice answer carries the selected option. Set AZURE_ENDPOINT, DEPLOYMENT_NAME and AZURE_API_KEY first.
import json, os, urllib.request
OPTIONS = {
"render": "One clear subject, a length and a ratio, safe to render now",
"review": "Missing a subject, length, or ratio; a person should look",
"reject": "Not a video request at all",
}
def decide(brief: str) -> str:
body = {"model": os.environ["DEPLOYMENT_NAME"], "state": brief,
"questions": {"gate": {"type": "choice",
"instructions": "Is this brief ready to render as one short video?",
"criteria": OPTIONS}}}
req = urllib.request.Request(
os.environ["AZURE_ENDPOINT"].rstrip("/") + "/providers/microsoft/v1/systemone",
data=json.dumps(body).encode(),
headers={"Content-Type": "application/json", "api-key": os.environ["AZURE_API_KEY"]},
method="POST")
try:
with urllib.request.urlopen(req, timeout=30) as resp:
choice = json.load(resp)["answers"]["gate"].get("choice")
except Exception:
return "review" # fail closed
return choice if choice in OPTIONS else "review"
if __name__ == "__main__":
print(decide("9:16, 8 seconds, a ceramic mug on a walnut table, slow push-in"))What happens after render
Only then call Sume. `POST /v1/videos` answers 202 with an id and a polling_url; send an Idempotency-Key derived from your own order id, so a retry returns the original job instead of a second charge. If the balance cannot cover the reserve, you get 402 insufficient_credits with details.required_credits and details.available_credits before provider work starts, and the gate cost you nothing on the Sume side.
| Failure | Handled by | What to do |
|---|---|---|
| Brief is vague | Decision-1 returns review | Ask the author for subject, length, ratio |
| Decision call times out or returns 5xx | Your try/except | Treat as review, do not render |
| Decision call returns 429 | Microsoft's table says retry with backoff | Back off, then retry the gate |
| Balance too low | Sume 402 insufficient_credits | Top up or shrink the request; same key on retry |
| Queue full | Sume 429 queue_full | Wait for jobs to finish; same key on retry |
Caveats
The Learn page warns that wording and option order can move the scores, that the model gives no rationale, and that you should validate on labelled examples before automating a gate. Do not use the gate as the sole decision about people. For a brief about a product shot, the cost of a wrong review is one human glance.
Sources
Related posts
More in Developers
- Decision-1 score question: order a Sume render queue by urgency
A Decision-1 score is a probability-weighted index, good for ordering but not an absolute grade. Sort briefs with it, then respect Sume's queue limits.
- Decision-1: judge a pending generate_video call as JSON state
Decision-1 accepts JSON as state. Pass the tool arguments of a pending Sume call and ask one noul question; keep keys and signed URLs out of the state.
- Decision-1: ask three questions in one request before a Sume render
Questions sharing a state can share one Decision-1 request. Route, rate severity and check repeat contact once, then render only if all three pass.
- Image API returned 202 at 4K: handle the job envelope in Python
A slow 4K, high-quality or large-n request can miss the 30 second wait and return 202 with a job, not images. Branch on the status code, then poll.
Written by Sume