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
- How to add an MCP server to ChatGPT with developer mode
Turn on ChatGPT developer mode, create an app for the server's URL, and sign in with OAuth. The steps, with Sume's hosted MCP server as the example.
- How to add subtitles to a video in Python
Add subtitles to a video in Python with Requests: POST the video URL to Sume's /v1/video-captions, poll the job, then read the captioned video_url.
- Add Sume to Claude as a custom connector (remote MCP)
Add Sume's hosted MCP server to Claude under Customize > Connectors, see what Sume's OAuth consent grants, and decide whether to allow paid tools.
- Airflow HTTP sensor: wait for an AI video job to finish
Submit an AI video job with Airflow's HttpOperator, then wait with an HttpSensor in reschedule mode that passes once the job's status is completed.
Written by Sume