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.

4 min readSume
All posts

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 External API Request fields for a Sume call (read 2026-10-06)
Xano fieldValueWhy
URLhttps://api.sume.com/v1/agent/completionsCreates an agent.run
MethodPOSTThe create call is a POST
HeaderAuthorization: Bearer plus an environment variable holding the keyKey needs agent_completions:write; older keys return 403 insufficient_scope
HeaderIdempotency-Key with a value you derive from the record idA repeated call returns the original receipt
Paramsinstruction, generation_spend_cap_usd, optional communication.webhook_urlThe 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 assistant turn in messages[]. 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

All Integrations posts

Written by Sume