Skip to content

    API documentation

    Generate Lyrics Package

    POST/api/v1/lyrics/generate

    Authentication · x-api-key

    Create a GPT lyrics-generation task, persist it through the unified task pipeline, and wait briefly for the completed result.

    Scope: task:create

    Billing and effects: Paid operation: credits are authorized when the Task is accepted. Review the quote or preflight and save the receipt.

    Recovery: Save one Idempotency-Key with the exact request body before submission. Reuse both after an uncertain response.

    Follow this operation’s workflow → · All permission rules

    Request

    Request headers

    Idempotency-Keyheader · Optional
    string

    Unique key for one logical write. Retrying the same body with the same key replays the original result; reusing it with a different body returns 409.

    Maximum characters: 255.

    JSON request body

    Content-Type: application/json · Required body

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    Only the listed fields are accepted in this object.

    • Request · promptRequired

      string

      Core song brief, story, scene, or hook idea.

      Maximum characters: 2000.

    • Request · configOptional

      object

      Standard task configuration: priority, tags, metadata, and webhookUrl.

      4 fields
      • Request · config.metadataOptional

        object

        Free-form caller metadata, echoed back on read. Stored as opaque JSON; the server never mutates it.

        1 field
      • Request · config.priorityOptional

        number

        Task priority 1-10 (higher = sooner). Default 5.

        Minimum: 1. Maximum: 10. Default: 5.

      • Request · config.tagsOptional

        array<string>

        Free-form labels for filtering. Up to 20, 100 chars each.

        Maximum items: 20.

        1 field
        • Request · config.tags[]Each item

          string

          Maximum characters: 100.

      • Request · config.webhookUrlOptional

        string

        URL to receive task.* lifecycle events via the central webhook service.

        Format: uri.

    • Request · durationSecOptional

      number

      Target duration in seconds.

      Minimum: 30. Maximum: 480.

    • Request · explicitOptional

      boolean

      Whether explicit language is acceptable.

    • Request · extraGuidanceOptional

      string

      Additional creative guidance or constraints.

      Maximum characters: 2000.

    • Request · genreOptional

      string

      Requested musical genre direction.

      Maximum characters: 200.

    • Request · languageOptional

      string

      Primary lyric language. Use 'auto' to let the model decide.

      Maximum characters: 80.

    • Request · languagesOptional

      array<string>

      Additional languages to include or consider.

      1 field
      • Request · languages[]Each item

        string

        Additional languages to consider for multilingual lyrics.

        Maximum characters: 80.

    • Request · modeOptional

      "gpt"

      Lyrics generation mode. GPT is the supported mode.

    • Request · moodOptional

      string

      Requested musical or visual mood.

      Maximum characters: 200.

    • Request · multilingualModeOptional

      "auto" | "sectioned" | "blended" | "call_and_response"

      How multiple languages should be mixed.

    • Request · negativeConstraintsOptional

      array<string>

      Topics, styles, or tropes the output should avoid.

      1 field
      • Request · negativeConstraints[]Each item

        string

        Styles, topics, or tropes to avoid.

        Maximum characters: 80.

    • Request · perspectiveOptional

      "first_person" | "second_person" | "third_person" | "mixed"

      Requested lyric narrative perspective.

    • Request · structureOptional

      array<string>

      Requested lyric section order.

      1 field
      • Request · structure[]Each item

        string

        Requested section order, e.g. Verse 1, Chorus, Bridge.

        Maximum characters: 50.

    • Request · themeKeywordsOptional

      array<string>

      Short theme keywords to anchor the lyrics.

      1 field
    • Request · vocalStyleOptional

      string

      Requested vocal performance direction.

      Maximum characters: 200.

    Responses

    Read the HTTP status and body together. A receipt confirms acceptance; poll the returned Task or product view for terminal execution and media delivery. Example IDs and credit amounts are illustrative, not a price quote.

    HTTP 401 · Request rejected; correct the key before retrying

    Complete JSON example (optional fields may be omitted).

    {
    "success": false,
    "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API key"
    }
    }
    200 OK

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 200 · creditsChargedRequired

      number

      Credits charged as reported by this view. Task creditsCharged is final net debit; operation ledger charged is gross, with refunded and net reported separately. Do not subtract a refund twice.

    • Response 200 · hookRequired

      string

      Main memorable lyric phrase generated for the song, typically the chorus hook.

    • Response 200 · languagePlanRequired

      object

      Generated plan for language use in the lyrics; it describes the result rather than changing the request.

      4 fields
    • Response 200 · lyricsRequired

      string

      Complete generated lyric text including section markers; this endpoint does not synthesize audio.

    • Response 200 · modelRequired

      string

      Model identifier reported by the lyric-generation result.

    • Response 200 · modelPathRequired

      string

      Resolved provider/model/feature route used to create the lyric Task; also returned while processing continues.

    • Response 200 · notesRequired

      array<string>

      Creative and production suggestions accompanying the generated lyric package.

      1 field
      • Response 200 · notes[]Each item

        string
    • Response 200 · producerRequired

      object

      Provider-neutral package for downstream music production: title, lyrics and a sound/style brief.

      3 fields
      • Response 200 · producer.lyricsRequired

        string

        Lyric text prepared for downstream music production.

      • Response 200 · producer.soundPromptRequired

        string

        Natural-language description of the intended instrumentation, vocals, mood and sound.

      • Response 200 · producer.titleRequired

        string

        Suggested title in the downstream production package.

    • Response 200 · sectionOrderRequired

      array<string>

      Ordered section labels in the generated song, such as Verse 1, Chorus and Bridge.

      1 field
    • Response 200 · statusRequired

      "COMPLETED"

      State of the object containing this field. Use its listed values; operation acceptance, Task completion and media delivery are separate states.

    • Response 200 · sunoRequired

      object

      Suggested Suno input package; generating these suggestions does not submit a Suno song request.

      4 fields
      • Response 200 · suno.negativeTagsRequired

        string | null

        Styles or sonic traits suggested for exclusion from Suno generation; null when no exclusions are supplied.

        May be null.

      • Response 200 · suno.promptRequired

        string

        Section-marked lyric text intended for the Suno custom-lyrics prompt.

      • Response 200 · suno.tagsRequired

        string

        Suno style tags describing genre, mood, instrumentation and vocal character.

      • Response 200 · suno.titleRequired

        string

        Suggested Suno song title.

    • Response 200 · taskIdRequired

      string

      Operation Task identifier. Save it before polling; a receipt does not mean the operation has completed.

    • Response 200 · titleRequired

      string

      Title generated for this lyric package.

    • Response 200 · usageOptional

      object

      Optional language-model token usage reported for this generation; not a separate credit charge.

      3 fields
      • Response 200 · usage.completionTokensOptional

        number

        Number of output tokens reported by the lyric model, when available.

      • Response 200 · usage.promptTokensOptional

        number

        Number of input tokens reported by the lyric model, when available.

      • Response 200 · usage.totalTokensOptional

        number

        Total input and output tokens reported by the lyric model, when available.

    202 Accepted

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 202 · creditsRequiredRequired

      number

      Credits required for this operation. A quote is an estimate; an accepted Task records its authorized charge.

    • Response 202 · messageRequired

      string

      Human-readable explanation. Wording may change; use the machine-readable code for programmatic decisions.

    • Response 202 · modelPathRequired

      string

      Resolved provider/model/feature route used to create the lyric Task; also returned while processing continues.

    • Response 202 · pollUrlRequired

      string

      Read URL for the accepted operation. Poll this existing operation instead of resubmitting work.

    • Response 202 · statusRequired

      "PENDING" | "PROCESSING"

      State of the object containing this field. Use its listed values; operation acceptance, Task completion and media delivery are separate states.

    • Response 202 · taskIdRequired

      string

      Operation Task identifier. Save it before polling; a receipt does not mean the operation has completed.

    400 Bad Request

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 400 · errorRequired

      object

      Structured failure information. Branch on code, show message, and interpret details only for that code. The request ID is returned in the X-Request-Id header.

      3 fields
      • Response 400 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 400 · error.messageRequired

        string

        Human readable error message

      • Response 400 · error.detailsOptional

        object

        Optional error-specific context. Read code first; details keys depend on that code. Unknown keys must not break error handling. See /resources/errors/.

        1 field
    • Response 400 · successRequired

      false

      Always false for error responses

    401 Unauthorized

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 401 · errorRequired

      object

      Structured failure information. Branch on code, show message, and interpret details only for that code. The request ID is returned in the X-Request-Id header.

      3 fields
      • Response 401 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 401 · error.messageRequired

        string

        Human readable error message

      • Response 401 · error.detailsOptional

        object

        Optional error-specific context. Read code first; details keys depend on that code. Unknown keys must not break error handling. See /resources/errors/.

        1 field
    • Response 401 · successRequired

      false

      Always false for error responses

    402 Payment Required

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 402 · errorRequired

      object

      Structured failure information. Branch on code, show message, and interpret details only for that code. The request ID is returned in the X-Request-Id header.

      3 fields
      • Response 402 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 402 · error.messageRequired

        string

        Human readable error message

      • Response 402 · error.detailsOptional

        object

        Optional error-specific context. Read code first; details keys depend on that code. Unknown keys must not break error handling. See /resources/errors/.

        1 field
    • Response 402 · successRequired

      false

      Always false for error responses

    403 Forbidden

    Forbidden: the API key lacks the required scope or its IP policy rejects this request. Forbidden: API-key scope/IP restrictions or billing hold. A positive balance does not bypass payment review. Check GET /api/v1/account/credits billingStatus before further paid requests.

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 403 · errorRequired

      object

      Structured failure information. Branch on code, show message, and interpret details only for that code. The request ID is returned in the X-Request-Id header.

      3 fields
      • Response 403 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 403 · error.messageRequired

        string

        Human readable error message

      • Response 403 · error.detailsOptional

        object

        Optional error-specific context. Read code first; details keys depend on that code. Unknown keys must not break error handling. See /resources/errors/.

        1 field
    • Response 403 · successRequired

      false

      Always false for error responses

    409 Conflict

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 409 · errorRequired

      object

      Structured failure information. Branch on code, show message, and interpret details only for that code. The request ID is returned in the X-Request-Id header.

      3 fields
      • Response 409 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 409 · error.messageRequired

        string

        Human readable error message

      • Response 409 · error.detailsOptional

        object

        Optional error-specific context. Read code first; details keys depend on that code. Unknown keys must not break error handling. See /resources/errors/.

        1 field
    • Response 409 · successRequired

      false

      Always false for error responses

    429 Too Many Requests

    Request allowance or task admission capacity exceeded. Follow Retry-After when present; otherwise wait for active tasks and use bounded backoff. Limits do not guarantee throughput. For SSE, this is the HTTP connection response, not an event.

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 429 · errorRequired

      object

      Structured failure information. Branch on code, show message, and interpret details only for that code. The request ID is returned in the X-Request-Id header.

      3 fields
      • Response 429 · error.codeRequired

        string

        RATE_LIMITED for request and task admission rejections.

      • Response 429 · error.messageRequired

        string

        Human-readable explanation. Wording may change; use the machine-readable code for programmatic decisions.

      • Response 429 · error.detailsOptional

        object

        Optional error-specific context. Read code first; details keys depend on that code. Unknown keys must not break error handling. See /resources/errors/.

        9 fields
        • Response 429 · error.details.currentOptional

          integer

          Current count for the rate-limit window identified by policy and scope.

          Minimum: 0.

        • Response 429 · error.details.inFlightOptional

          integer

          Current accepted tasks counted against the relevant account or API-key admission limit.

          Minimum: 0.

        • Response 429 · error.details.limitOptional

          integer

          Maximum count allowed by this response context. A limit is not a throughput guarantee.

          Minimum: 0.

        • Response 429 · error.details.policyOptional

          "operation" | "query"

          Allowance bucket: query for resource reads, operation for task-producing or operation requests. See the rate-limit response headers.

        • Response 429 · error.details.retryAfterSecOptional

          integer

          Suggested delay in seconds before another request. Honor the Retry-After header when present; use bounded backoff.

          Minimum: 1.

        • Response 429 · error.details.scopeOptional

          "user" | "api-key" | "ip" | "apiKey"

          Entity whose allowance was exceeded, such as the user, API key or IP address.

        • Response 429 · error.details.tierOptional

          "FREE" | "PREMIUM" | "ENTERPRISE"

          Account allowance tier used for this admission or rate-limit decision.

        • Response 429 · error.details.typeOptional

          "rps" | "daily" | "monthly"

          Admission limit that rejected the request: rps (continuously refilled requests-per-second bucket), daily or monthly UTC request budget. Interpret with policy, scope and retryAfterSec.

        • Response 429 · error.details[key]Each value

          any JSON value

          Key pattern: ^(.*)$.

    • Response 429 · successRequired

      false

      Whether this response reports a successful action; false accompanies the structured error object.

      Default: false.

    500 Internal Server Error

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 500 · errorRequired

      object

      Structured failure information. Branch on code, show message, and interpret details only for that code. The request ID is returned in the X-Request-Id header.

      3 fields
      • Response 500 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 500 · error.messageRequired

        string

        Human readable error message

      • Response 500 · error.detailsOptional

        object

        Optional error-specific context. Read code first; details keys depend on that code. Unknown keys must not break error handling. See /resources/errors/.

        1 field
    • Response 500 · successRequired

      false

      Always false for error responses

    502 Bad Gateway

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 502 · errorRequired

      object

      Structured failure information. Branch on code, show message, and interpret details only for that code. The request ID is returned in the X-Request-Id header.

      3 fields
      • Response 502 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 502 · error.messageRequired

        string

        Human readable error message

      • Response 502 · error.detailsOptional

        object

        Optional error-specific context. Read code first; details keys depend on that code. Unknown keys must not break error handling. See /resources/errors/.

        1 field
    • Response 502 · successRequired

      false

      Always false for error responses

    503 Service Unavailable

    application/json

    Required, optional and null

    Required fields apply within their object and selected option. An optional object may be absent; when present, its required fields must be included. Required and nullable are independent: null is allowed only where listed.

    • Response 503 · errorRequired

      object

      Structured failure information. Branch on code, show message, and interpret details only for that code. The request ID is returned in the X-Request-Id header.

      3 fields
      • Response 503 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 503 · error.messageRequired

        string

        Human readable error message

      • Response 503 · error.detailsOptional

        object

        Optional error-specific context. Read code first; details keys depend on that code. Unknown keys must not break error handling. See /resources/errors/.

        1 field
    • Response 503 · successRequired

      false

      Always false for error responses

    Workflow and next steps → · Recover an uncertain request

    Interactive API Explorer → · OpenAPI JSON