Create a task (plural route)
/api/v1/openapi/tasks · POST
Required access: openapi_tools with task:write. Authentication.
AuthorizationBearer <token>MuseSpark API key. Tasks accept a case-insensitive Bearer prefix; compatibility extraction requires Bearer with this casing.
X-Idempotency-Key?stringStable business request identity. Sets metadata.reference_id. Reuse only for identical intent. No fixed public retention guarantee.
application/json- body
type?stringOptional; inferred from public item projection when omitted. A supplied type must match.
item_key*stringFirst choice identifier. Precedence: item_key > model_key > model > model_id.
1 <= lengthmodel_key?stringSecond choice identifier.
1 <= lengthmodel?stringThird choice identifier.
1 <= lengthmodel_id?stringFourth choice identifier.
1 <= lengthprompt?stringCopied into parameters.prompt only when that key is absent.
parameters?Model-specific parameters. Obtain the current schema from the model page.
metadata?Business metadata. reference_id is stripped and replaced by X-Idempotency-Key. Capacity controls are server-managed.
Success. MuseSpark success envelope.
application/json- response
code*200200msg*"success""success"data*curl -X POST 'https://api.musespark.ai/api/v1/openapi/tasks' \ -H 'Content-Type: application/json' \ -d '{ "item_key": "YOUR_ITEM_KEY", "parameters": { "prompt": "A paper city under soft morning light" }}'{ "code": 200, "msg": "success", "data": { "task_id": "736fde4d-9029-4915-8189-01353d6982cb", "status": "string" }}