Submit a task
Submits one AI task. The input is the underlying task path, media URLs, tool parameters, and context. The output is either a synchronous result or a task_id for an asynchronous task that you poll.
Request
Request body
task_type values
Response
Completed synchronously
Read data.result directly.
Accepted asynchronously
Continue with Poll task status.
Failed
See Errors and troubleshooting.
cURL example
Continuing from the config, ai, media_url, and consume variables on the previous pages. First build the submission URL:
Then read the default parameters for SKM0006 from the config, serialize params as a JSON string, and submit:
If data.status is 10, read data.result. If it is 9, query it as in Poll task status. If the submission times out, check the original request first so you are not charged twice.
Notes
- Serialize the merged parameter object as a JSON string and put it in the
paramsfield of the body. - The
Hostheader must match the URL and be signed. Strip the scheme when you extract the host from the AI policy'surl. - Send
contextonly when the quota API returns one. Do not make up a value when there is no quota context.