Skip to main content
These APIs submit and inspect gateway-persisted tasks, list artifacts, and download them. They do not accept arbitrary provider task IDs and are not OpenAI Batch / Files APIs. Use the public ID returned by submission under the same user and project scope.

Submit and inspect

Set up the REST runtime. Use submit only when the operator confirms that the plugin supports the legacy generic entry. task-request.json must contain that plugin’s normalized request object with model; other fields are plugin-specific. Arbitrary native provider bodies are not interchangeable with it. Prefer the documented image, video, or Responses protocol when available.
Run the commands step by step, submit only once, and paste the actual returned ID. Submission’s queued is a fixed acceptance receipt; even immediate completion needs a status read. Status values are uppercase NOT_START, SUBMITTED, QUEUED, IN_PROGRESS, SUCCESS, FAILURE, NEEDS_REVIEW, or UNKNOWN. NEEDS_REVIEW requires manual investigation; UNKNOWN is not success. Failure reasons may contain sensitive data and should not be copied into public logs. The example queries once without polling. A successful status exit means a valid observation; only completed: true means SUCCESS. If adding polling, bound the total deadline, interval, and attempts. A timeout or disconnect does not cancel a task. There are no generic inference endpoints to cancel, delete, or list all tasks.

Artifacts and downloads

artifacts, head, and download first require SUCCESS. Successful tasks may still have no artifacts, for example because the plugin exposes none or did not retain results. Do not hard-code video or invent keys. Entries contain key, type, optional mime_type, and content_url. The example prints only the first three and constructs an authenticated gateway content path from the listed key, without following redirects. content_url may contain a temporary signature. Treat it as a temporary access credential; do not log it or append an API key. The example does not use it. Put deployment path prefixes in API_ROOT_URL. GET downloads the whole artifact, while HEAD checks availability. Validate Range / conditional requests separately using the reference; HEAD success cannot guarantee future availability. The download example allows up to 20 MiB, creates a new file only after reading the entire response, and rejects overwrites, empty content, non-200 responses, HTML / JSON, and MIME mismatches. JSON file artifacts require a separate explicit handler. It does not decode or validate media contents or open downloaded files. References: submit, status, list, GET, HEAD.
阅读中文版