Xano External API Request to start a Sume Agent Completion
In Xano, add headers with push and a JSON body with set, then POST to Sume's agent endpoint. The call returns 202, so plan a poll or webhook for the result.

Add an External API Request step in your Xano function stack, set the URL to https://api.sume.com/v1/agent/completions, add one auth header, and send a JSON body that includes generation_spend_cap_usd. Sume answers 202 with a receipt, not the finished work, so the step succeeds quickly and the result arrives later.
Configure the step
Xano's page says you add headers by hovering over the value space and clicking push, and that parameters, also called the request body, are added by clicking set. Use that for the pieces below. Send exactly one credential header: Authorization: Bearer <key> or x-api-key. Sending both makes Sume return 401.
Test with a throwaway instruction and a one-dollar cap before connecting the step to a table of real records. Xano's page tells you to focus on the URL, the parameters and the shape of the response, which is the right checklist for this call: the URL is fixed, the parameters are the three above, and the response is a receipt you store rather than a result you display.
| Xano field | Value | Why |
|---|---|---|
| URL | https://api.sume.com/v1/agent/completions | Creates an agent.run |
| Method | POST | The create call is a POST |
| Header | Authorization: Bearer plus an environment variable holding the key | Key needs agent_completions:write; older keys return 403 insufficient_scope |
| Header | Idempotency-Key with a value you derive from the record id | A repeated call returns the original receipt |
| Params | instruction, generation_spend_cap_usd, optional communication.webhook_url | The cap has no default; leaving it out returns 400 invalid_request |
The body
Xano builds the body from params, and the result is the JSON below.
{
"instruction": "Write a 20-word caption for this product",
"generation_spend_cap_usd": 1,
"communication": { "webhook_url": "https://example.com/hooks/sume" }
}Finishing the loop
Xano's page does not describe a result structure, so read the response in a debug run before wiring later steps to it. The receipt carries id, status, status_url and cancel_url. Save the id on your record. Then either expose a public API endpoint in Xano as the webhook_url and verify the x-sume-webhook-signature header, or run a second scheduled function that calls GET /v1/agent-runs/{id} until next_action is not poll_status.
A completed run puts the final text in output.text and media URLs in output.images, output.videos and the sibling lists. Branch on outcome in the webhook body: a degraded run billed and produced artifacts but no structured output.
Mistakes to avoid
If a run is still going and you decide to stop it, POST /v1/agent-runs/{id}/cancel ends it, and a canceled run sends no webhook.
- Using a service-account key. It cannot create Agent Completions and fails with
403 insufficient_scope. - Sending an
assistantturn inmessages[]. Sume rejects it, because it does not replay conversations. - Expecting streaming. It is not available, so the run needs a poll or a webhook.
- Putting the key in a Xano input that is logged. Use an environment variable.
Sources
More in Integrations
- Zed tool permissions: confirm by default, rules per Sume tool
Zed confirms every tool action by default and can allow or deny one MCP tool by name. Keep Sume's paid generators on confirm while reads run freely.
- Approval gate before posting AI video: verify the Sume webhook
Hold every AI video for human review before it posts. A Node verifier for Sume's signed job webhooks that refuses an empty secret, plus the review steps.
- Cline autoApprove for Sume: list only the read-only tools
Cline's remote MCP entry supports an autoApprove array. Put Sume's read tools in it and keep paid creates such as generate_image on manual approval.
- Azure DevOps remote MCP is GA: run it beside Sume's hosted MCP
Azure DevOps remote MCP went GA in sprint 278 with Foundry and Copilot Studio support. Here is how to hold it and Sume's MCP with separate credentials.
Written by Sume