Beatra

Generate music from a prompt and/or lyrics

POST
/v1/music/text-to-music

Request Body

application/jsonRequired
metadataMetadata

Caller-supplied metadata; limited by task creation policy.

callback_urlCallback Url

HTTPS URL Beatra will POST the final Task envelope to when the Task reaches a terminal state

callback_signing_key_idCallback Signing Key Id

Optional standalone callback signing key. Omit for unsigned callback delivery; requires callback_url when provided.

model
Required
Model
Value in: "auto" | "minimax-music-3.0" | "suno-6"
prompt
Required
Prompt

Style, mood, genre, and instrumentation. When lyrics are supplied (or Suno custom mode is on) this maps to the provider's style-conditioning field; otherwise it is the song description the model writes the song from. Either way it is not an instruction field: execution directives written here (for example "do not omit anything", "sing it verbatim", "make chapter three differ from chapter one") are not read as instructions and will not be obeyed. Put the words to be sung in lyrics, or set instrumental to true for a track with no vocals.

Minimum length: 1Maximum length: 2000
lyricsLyrics

Optional lyrics text. Must be omitted for instrumental music.

instrumentalInstrumental

When true, generate instrumental music without vocals.

Default: false
titleTitle
model_optionsAny properties in MusicModelOptions

Options grouped by public music model family.

Header Parameters

X-Request-Idstring

Optional client request id echoed in the response.

Idempotency-Key
Required
Idempotency-Key
Minimum length: 1Maximum length: 128
Authorization
Required
string

Bearer API key.

curl -X POST "https://example.com/v1/music/text-to-music" \
  -H "X-Request-Id: string" \
  -H "Idempotency-Key: string" \
  -H "Authorization: string" \
  -H "Content-Type: application/json" \
  -d '{
    "metadata": {
      "property1": "string",
      "property2": "string"
    },
    "callback_url": "string",
    "callback_signing_key_id": "string",
    "model": "auto",
    "prompt": "string",
    "lyrics": "string",
    "instrumental": false,
    "title": "string",
    "model_options": {
      "suno": {
        "custom_mode": true,
        "negative_tags": "string",
        "vocal_gender": "m",
        "style_weight": 1,
        "weirdness_constraint": 1,
        "audio_weight": 1
      },
      "minimax": {
        "lyrics_optimizer": true,
        "aigc_watermark": true,
        "audio_setting": {
          "sample_rate": 16000,
          "bitrate": 32000,
          "format": "mp3"
        }
      }
    }
  }'

Task accepted

{
  "object": "task",
  "task_id": "string",
  "status": "queued",
  "capability": "string",
  "workload_type": "model",
  "model": "string",
  "resolved_model": "string",
  "social": {
    "platform": "string",
    "operation_key": "string",
    "operation_name": "string",
    "schema_hash": "string"
  },
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "input": {},
  "progress": {
    "percent": 100,
    "stage": "string",
    "message": "string"
  },
  "output": {},
  "warnings": [
    {
      "code": "string",
      "message": "string",
      "field": "string"
    }
  ],
  "error": {
    "code": "string",
    "type": "string",
    "message": "string",
    "retryable": true,
    "param": "string",
    "details": {},
    "request_id": "string"
  },
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "cache_read_tokens": 0,
    "cache_creation_tokens": 0,
    "reasoning_tokens": 0,
    "image_count": 0,
    "image_pixels": 0,
    "video_seconds": 0,
    "input_video_seconds": 0,
    "output_video_seconds": 0,
    "audio_seconds": 0,
    "characters": 0,
    "lines": [
      {
        "meter": "string",
        "quantity": "string",
        "unit": "string",
        "billed_amount_credits": "string"
      }
    ],
    "credits": "string"
  },
  "billing": {
    "charged_credits": "string",
    "refunded_credits": "string",
    "granted_credits": "string",
    "grant_source": "string",
    "net_charged_credits": "string"
  },
  "callback": {
    "url": "string",
    "status": "pending",
    "attempt_count": 0,
    "delivered_at": "2019-08-24T14:15:22Z",
    "last_error": "string"
  },
  "created_at": "2019-08-24T14:15:22Z",
  "started_at": "2019-08-24T14:15:22Z",
  "deadline_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z",
  "cancel_requested_at": "2019-08-24T14:15:22Z",
  "links": {
    "self": "string",
    "cancel": "string",
    "assets": "string"
  }
}