xpay✦ pay-per-use icon

xpay✦ pay-per-use

Discover and execute marketplace services with automatic payment handling

Run → Run Async

AI-generated

Summary

Start an asynchronous execution of a specified service with given inputs and model, optionally waiting and polling until the execution completes or a timeout occurs.

Inputs

  • Service Slug (required) — The slug or ID of the service to execute, e.g., from a Discover operation.
  • Model (required) — The LLM model to use for execution, selectable from available options.
  • Inputs — A set of key-value input pairs for the service according to its schema.
  • Wait for Completion — Boolean flag indicating whether to poll and wait for execution completion (default true).
  • Polling Timeout (seconds) — Maximum time in seconds to wait for completion when polling (default 180).
  • Options — Advanced options such as model temperature and max tokens for the execution.

Output shape

a single JSON object representing the async run result or status

Returns immediately with run ID and status 'processing' if not waiting; otherwise, polls the run status until completion, failure, error, or timeout. Includes runId, status, output (if completed), cost, duration, error message if failed, and related service and model identifiers.

Examples

Example 1: Run a service asynchronously and receive the run ID immediately without waiting for completion.

Set 'Wait for Completion' to false to get the run ID and status URL immediately.

Example 2: Run a service asynchronously and wait up to 3 minutes for execution to finish, automatically polling status.

Set 'Wait for Completion' to true and use default or customized 'Polling Timeout' seconds.

Links

Discussion