curl --request POST \
--url https://apistable.com/v1/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "prism-image-2",
"input": {
"prompt": "<string>",
"duration_seconds": 123,
"resolution": "<string>",
"seed": 1,
"generate_audio": true,
"instrumental": true,
"lyrics": "<string>"
},
"output_count": 1,
"fallback": false,
"max_credits": 1
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'prism-image-2',
input: {
prompt: '<string>',
duration_seconds: 123,
resolution: '<string>',
seed: 1,
generate_audio: true,
instrumental: true,
lyrics: '<string>'
},
output_count: 1,
fallback: false,
max_credits: 1
})
};
fetch('https://apistable.com/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.com/v1/tasks"
payload = {
"model": "prism-image-2",
"input": {
"prompt": "<string>",
"duration_seconds": 123,
"resolution": "<string>",
"seed": 1,
"generate_audio": True,
"instrumental": True,
"lyrics": "<string>"
},
"output_count": 1,
"fallback": False,
"max_credits": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "provider_not_configured",
"message": "Live model providers are not connected in this build. No credits were reserved or charged."
}
}Create a task
Submit asynchronous image, video, or music work.
curl --request POST \
--url https://apistable.com/v1/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "prism-image-2",
"input": {
"prompt": "<string>",
"duration_seconds": 123,
"resolution": "<string>",
"seed": 1,
"generate_audio": true,
"instrumental": true,
"lyrics": "<string>"
},
"output_count": 1,
"fallback": false,
"max_credits": 1
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'prism-image-2',
input: {
prompt: '<string>',
duration_seconds: 123,
resolution: '<string>',
seed: 1,
generate_audio: true,
instrumental: true,
lyrics: '<string>'
},
output_count: 1,
fallback: false,
max_credits: 1
})
};
fetch('https://apistable.com/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.com/v1/tasks"
payload = {
"model": "prism-image-2",
"input": {
"prompt": "<string>",
"duration_seconds": 123,
"resolution": "<string>",
"seed": 1,
"generate_audio": True,
"instrumental": True,
"lyrics": "<string>"
},
"output_count": 1,
"fallback": False,
"max_credits": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "provider_not_configured",
"message": "Live model providers are not connected in this build. No credits were reserved or charged."
}
}API preview: generation providers are not connected. An authenticated request can return 503 without creating a task or charging credits.
Request body
| Parameter | Type | Behavior |
|---|---|---|
| model | string · required | Exact model and operation ID. |
| input | object · required | Validated against that model’s schema. |
| output_count | integer · default 1 | Images/videos only; 1–4 target items. |
| fallback | boolean · default false | Authorizes eligible official fallback. |
| max_credits | non-negative integer · optional | Maximum total reservation you accept. |
Planned live acceptance
When live execution is enabled, successful acceptance atomically records the operation, result items, credit reservation, and durable scheduling record. HTTP 202 means work is accepted, not that a model has finished. With output_count=4, you receive one task ID containing four stable items. The worker schedules each item within account and provider limits. There is no guarantee that all four start simultaneously.During this build, real provider execution is not connected. A request must not manufacture a successful model output or a completed paid generation.
Planned idempotent acceptance
Once live task acceptance is enabled, send Idempotency-Key and retain it with the input. In this build, POST /v1/tasks rejects live execution before creating an operation, so the header does not yet produce a stored operation. Reusing it with the same input refers to the original operation; changing quantity, fallback, or the credit cap should return a conflict. Deliberately generating again requires a new key and a new paid operation. Errors and recoveryAuthorizations
API key beginning as_. Keep on the server. Scope permissions are checked separately.
Headers
Reserved for live acceptance. No task is currently created or deduplicated by this header.
Body
1"prism-image-2"
Current preview input. Supported fields vary by modality and exact catalog model. No live provider mapping is implied.
Show child attributes
Show child attributes
Target result count. Images/videos accept 1–4; music and LLM must remain 1. Not a concurrency guarantee. / 目标结果数,非同时并发保证。
1 <= x <= 4Authorizes a higher-priced compatible official fallback after an eligible confirmed failure. Live execution is disabled in this build.
Whole-request reservation cap. Reject the entire request when max_reserved_credits exceeds it.
x >= 0Response
Invalid or unsupported input
Show child attributes
Show child attributes