Skip to main content
POST

Authorizations

Authorization
string
header
required

API Key created in the DreamTo console, sent as Authorization: Bearer <API Key>.

Body

application/json

Request body of createTask.

model
enum<string>
default:ai-music-api/speech
required

Endpoint name; it decides the fields of input.

Allowed values:

  • ai-music-api/speech: Suno Generate speech
Available options:
ai-music-api/speech
input
object
required

Task parameters; the fields depend on model.

callBackUrl
string

Optional URL that receives a callback when the task finishes (success or failure); it must be a public http / https URL. Recommended in production; you can also just poll the query endpoint. See Task callback for the body and signature.

Response

200 - application/json

Always HTTP 200. With code 200 the task was created and data.taskId is its ID; any other code is an error with the reason in msg and data null.

Response of createTask; always HTTP 200.

code
integer<int64>
required

Result code:

  • 200: success
  • 401: missing or invalid API Key
  • 402: insufficient balance
  • 404: the model does not exist or is not enabled
  • 405: wrong HTTP method
  • 422: invalid request, with the reason in msg; no task is created or charged
  • 429: too many requests; retry later
  • 455: service under maintenance
  • 500: server error; retry later
  • 501: generation failed
  • 505: feature disabled
msg
string
required

Message: success, or the English reason of an error.

data
object
required

The task on success; null on error.