Create a media task
curl --request POST \
--url https://apistable.ai/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "prism-image-2",
"input": {
"prompt": "A red fox",
"output_count": 3,
"fallback": true
},
"callback_url": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'prism-image-2',
input: {prompt: 'A red fox', output_count: 3, fallback: true},
callback_url: '<string>'
})
};
fetch('https://apistable.ai/api/v1/tasks/create_task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.ai/api/v1/tasks/create_task"
payload = {
"model": "prism-image-2",
"input": {
"prompt": "A red fox",
"output_count": 3,
"fallback": True
},
"callback_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "<string>"
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}Common APIs and guides
Create task
Submit image, video or music generation.
POST
/
api
/
v1
/
tasks
/
create_task
Create a media task
curl --request POST \
--url https://apistable.ai/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "prism-image-2",
"input": {
"prompt": "A red fox",
"output_count": 3,
"fallback": true
},
"callback_url": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'prism-image-2',
input: {prompt: 'A red fox', output_count: 3, fallback: true},
callback_url: '<string>'
})
};
fetch('https://apistable.ai/api/v1/tasks/create_task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.ai/api/v1/tasks/create_task"
payload = {
"model": "prism-image-2",
"input": {
"prompt": "A red fox",
"output_count": 3,
"fallback": True
},
"callback_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "<string>"
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}Operations are enabled individually by server configuration. Disabled operations return 503 without a task. Music credit deduction is currently disabled.
Request
Send model and an input object. Place optional output_count and fallback inside input according to the model schema. callback_url is an optional top-level public HTTPS URL. No max_credits, quote step, or submission idempotency key is used. Each successful acceptance creates a new task. Retrying after an uncertain network timeout may create and charge another task. Enabled Suno operations create durable tasks. Disabled operations return 50301 without creating a task.{
"model": "prism-image-2",
"input": {
"prompt": "A red fox in a snowy forest",
"output_count": 3,
"fallback": true
}
}
Acceptance response
Successful acceptance for an enabled model returns HTTP 200 with data.task_id. Acceptance does not mean generation succeeded. A disabled operation returns HTTP 503 with code 50301 and does not create a task.{
"code": 200,
"msg": "success",
"data": {
"task_id": "task_example"
}
}
Authorizations
Every valid key can submit and query its own account. Revoked keys are rejected.
Body
application/json
Example:
"prism-image-2"
Validate against the selected model input_schema. output_count/fallback are optional model-specific input fields; never top-level.
Example:
{
"prompt": "A red fox",
"output_count": 3,
"fallback": true
}
Optional public HTTPS endpoint for signed completion callbacks; no redirects or private IPs.