curl https://api.infery.ai/v1/music/generations \ -H "Authorization: Bearer $INFERY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "suno-v4", "prompt": "Upbeat indie folk about a sunrise coastal drive" }'
This call is synchronous: it holds the connection until the track is rendered and answers with the audio. There is no job_id and no status endpoint to poll — allow for a client timeout of several minutes.The response carries a URL to the MP3 for each rendered track, plus separate stems if the model exposes them (Suno supports vocals + instrumentals):
Add ?stream=true to receive SSE progress events instead of one blocking response. If rendering outruns the 5-minute wait budget the call answers 504 with a job_id in the error body; the track is still rendered and billed, and is collected from GET /v1/images/jobs/{job_id}, which serves media jobs of every modality.
response_format — mp3 (default) or wav, where the model supports it
custom_mode — Suno: unlocks title, style and lyrics
style — Suno: genre/style string, max 1000 chars
lyrics — Suno: explicit lyrics, custom mode only
instrumental — Suno: render without vocals
vocal_gender — Suno: exactly m or f
There is no duration parameter. Length is set by the model and the material you give it — Lyria 3 Clip always renders 30 s. duration_seconds appears on each track in the response, reporting what was actually rendered.See Music generation for the full Suno parameter set.
Read the generation as Server-Sent Events instead of waiting for a JSON body. A QUERY parameter, not a body field — the handler reads @Query('stream') and accepts only the strings "true" and "1", so a stream key in the BODY is ignored and the caller silently gets buffered JSON. (chat/completions made the opposite choice and takes it in the body; the two are not interchangeable.) A streaming request also never defers: it stays on the inline path, so it cannot answer 504 with a job id the way the JSON mode can.
Text prompt describing the music. For Lyria 3 Clip, always produces 30s. For Lyria 3 Pro, control duration via prompt or timestamps. For Suno, max 500 chars in non-custom mode, up to 5000 in custom mode.
Without ?stream=true (the default) this is application/json — one result object, shown below. Audio is uploaded to private storage and returned as a signed url (7-day expiry); if the storage upload fails, the response falls back to inline b64_audio.
With ?stream=true it is text/event-stream instead: a sequence of data: <json>\n\n lines terminated by a literal data: [DONE]. OpenAPI 3.0 has no vocabulary for "repeat this, then terminate with a sentinel", so the text/event-stream schema below describes the JSON payload of a SINGLE data: line — never the whole body — which is the precedent chat/completions set.
A three-member oneOf rather than chat's single chunk schema, because music's frames are three genuinely different objects, and rather than the pipeline-run stream's bare {type: "string"}, because here the discriminant is IN the payload: progress repeats while the track renders, then exactly one terminal frame, completed or error. (The pipeline-run stream cannot be described this way — its encoder moves type out onto the SSE event: line, leaving no discriminant in the body to key a oneOf on.)
Read type before anything else. The error frame is a real failure delivered as a frame — once SSE headers are flushed the gateway cannot answer with an HTTP status, so the response is still a 200 that ends in [DONE] — and credits_used appears ONLY on the completed frame, so a client that ignores type sees a successful, empty, apparently free stream.
Credits deducted from the workspace balance for this request
Example:
180
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Infery.ai","colors":{"primary":"#2E5BE8","light":"#7B99F2","dark":"#1F41B0"},"logo":{"light":"https://mintcdn.com/inferyai/0Jgb47bSQtZI-re9/brand/logo-light.svg?fit=max\u0026auto=format\u0026n=0Jgb47bSQtZI-re9\u0026q=85\u0026s=d3ebed9120aa8e785f372aa43a7cccf3","dark":"https://mintcdn.com/inferyai/0Jgb47bSQtZI-re9/brand/logo-dark.svg?fit=max\u0026auto=format\u0026n=0Jgb47bSQtZI-re9\u0026q=85\u0026s=da2c52e6d74e21413d1e79df66776bb3"},"favicon":"https://mintcdn.com/inferyai/rVSpR6coVFjanvjI/brand/icon.svg?fit=max\u0026auto=format\u0026n=rVSpR6coVFjanvjI\u0026q=85\u0026s=9fa7355d4fc03bbe56cb42824f82e371","background":{"color":{"light":"#FFFFFF","dark":"#08090B"}},"navbar":{"links":[{"href":"https://app.infery.ai","label":"Studio"},{"href":"https://infery.ai/pricing","label":"Pricing"}],"primary":{"type":"button","label":"Sign in","href":"https://app.infery.ai/login"}},"footer":{"socials":{"website":"https://infery.ai","x":"https://x.com/infery_ai","github":"https://github.com/infery-ai"}},"seo":{"metatags":{"og:site_name":"Infery.ai Docs","og:type":"website","og:image":"https://docs.infery.ai/brand/og.jpg","twitter:card":"summary_large_image","twitter:site":"@infery_ai","robots":"index, follow"},"indexing":"all"},"fonts":{"heading":{"family":"Bricolage Grotesque","weight":700},"body":{"family":"IBM Plex Sans","weight":400}},"integrations":{"gtm":{"tagId":"GTM-P3237J9B"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"inferyai","hasAudioNarration":false,"actualSubdomain":"inferyai","customDomains":["docs.infery.ai"],"gitSource":{"type":"github","owner":"infery-ai","repo":"infery-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ac0d01453c5cd08031ddef8","collectionId":"e9cbfa7c-70b0-4c88-a370-6174686c606c","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ac0d01453c5cd08031ddef8"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ac0d01453c5cd08031ddef8","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"default","tag":"Guides","count":85},{"language":"default","tag":"API Reference","count":38},{"language":"default","tag":"Workflows","count":20},{"language":"default","tag":"Models","count":17},{"language":"default","tag":"Studio","count":10},{"language":"default","tag":"Tools","count":8},{"language":"default","tag":"SDKs","count":6},{"language":"default","tag":"Files","count":5},{"language":"default","tag":"Workspaces","count":5},{"language":"default","tag":"Overview","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"api-reference/music","slug":"/api-reference/music","pageMetadata":{"title":"Music","description":"Generate full songs from a prompt.","openapi":"openapi.json POST /v1/music/generations","href":"/api-reference/music"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Generate full songs from a prompt.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.infery.ai/v1/music/generations`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$INFERY_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"suno-v4\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\": \"Upbeat indie folk about a sunrise coastal drive\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This call is `,_jsx(_components.strong,{children:`synchronous`}),`: it holds the connection until the track is rendered and answers with the audio. There is no `,_jsx(_components.code,{children:`job_id`}),` and no status endpoint to poll — allow for a client timeout of several minutes.`]}),`\n`,_jsx(_components.p,{children:`The response carries a URL to the MP3 for each rendered track, plus separate stems if the model exposes them (Suno supports vocals + instrumentals):`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1713204900`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://storage.googleapis.com/...mp3?X-Goog-Signature=...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"audio/mpeg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"duration_seconds\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`30`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"credits_used\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`180`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Add `,_jsx(_components.code,{children:`?stream=true`}),` to receive SSE progress events instead of one blocking response. If rendering outruns the 5-minute wait budget the call answers `,_jsx(_components.strong,{children:`504`}),` with a `,_jsx(_components.code,{children:`job_id`}),` in the error body; the track is still rendered and billed, and is collected from `,_jsx(_components.code,{children:`GET /v1/images/jobs/{job_id}`}),`, which serves media jobs of every modality.`]}),`\n`,_jsx(Heading,{level:`3`,id:`sample-output`,children:`Sample output`}),`\n`,_jsx(`video`,{controls:true,src:`https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/music.mp3?fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=51fbabfb08030b46cedcd502720022cd`,style:{width:`100%`,maxWidth:480,height:54},\"data-path\":`samples/music.mp3`}),`\n`,_jsx(_components.p,{children:_jsxs(_components.em,{children:[`30-second clip generated with `,_jsx(_components.code,{children:`lyria-3-clip`}),` (Google Lyria).`]})}),`\n`,_jsx(Heading,{level:`2`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`prompt`}),` — natural-language description (required)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`operation`}),` — `,_jsx(_components.code,{children:`generate`}),` (default), `,_jsx(_components.code,{children:`extend`}),`, `,_jsx(_components.code,{children:`upload_cover`}),`, `,_jsx(_components.code,{children:`upload_extend`}),`, `,_jsx(_components.code,{children:`add_instrumental`}),`, `,_jsx(_components.code,{children:`add_vocals`}),`, `,_jsx(_components.code,{children:`sounds`}),`, `,_jsx(_components.code,{children:`vocal_removal`}),`, `,_jsx(_components.code,{children:`lyrics`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`response_format`}),` — `,_jsx(_components.code,{children:`mp3`}),` (default) or `,_jsx(_components.code,{children:`wav`}),`, where the model supports it`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`custom_mode`}),` — Suno: unlocks `,_jsx(_components.code,{children:`title`}),`, `,_jsx(_components.code,{children:`style`}),` and `,_jsx(_components.code,{children:`lyrics`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`style`}),` — Suno: genre/style string, max 1000 chars`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`lyrics`}),` — Suno: explicit lyrics, custom mode only`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`instrumental`}),` — Suno: render without vocals`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`vocal_gender`}),` — Suno: exactly `,_jsx(_components.code,{children:`m`}),` or `,_jsx(_components.code,{children:`f`})]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`There is no duration parameter. Length is set by the model and the material you give it — Lyria 3 Clip always renders 30 s. `,_jsx(_components.code,{children:`duration_seconds`}),` appears on each track in the `,_jsx(_components.strong,{children:`response`}),`, reporting what was actually rendered.`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/guides/music-generation`,children:`Music generation`}),` for the full Suno parameter set.`]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-models`,children:`Supported models`}),`\n`,_jsxs(_components.p,{children:[`Suno and Google Lyria. See `,_jsx(_components.a,{href:`/models/catalog`,children:`Models`}),` → Music.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Music","description":"Generate full songs from a prompt.","openapi":"openapi.json POST /v1/music/generations","href":"/api-reference/music"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Sample output","slug":"sample-output","depth":3,"children":[]},{"title":"Parameters","slug":"parameters","depth":2,"children":[]},{"title":"Supported models","slug":"supported-models","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createMusicGeneration","parameters":["05227565-ebe0-4c7b-83bb-7b98daf58180"],"requestBody":"8eade88d-8296-42d6-b748-d068952cd117","responses":{"200":"4d5ac534-18a9-4db2-aea7-688a3d0d389c","400":"9ae14369-5037-4fe0-9276-575d38216149","401":"401b0e3b-fe39-4a80-a166-52d95aa5e5ab","404":"995de94a-9740-428f-b0ce-3f66cb388729"},"security":["28329752-e8e2-45dc-9c9e-5bc577460aea"],"summary":"Generate music from text prompt","tags":["Music"],"method":"post","type":"path","servers":["70c58c78-558b-477f-817f-fa094a9f1354","250da9ba-2678-444c-bc3b-e169d87db6d0"],"path":"/v1/music/generations","baseUrlOptions":["https://api.infery.ai","http://localhost:3001"],"title":"Generate music from text prompt","description":"Generate full songs from a prompt.","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"05227565-ebe0-4c7b-83bb-7b98daf58180":{"name":"stream","required":false,"in":"query","schema":{"type":"string","enum":["true","1"],"isRequired":false,"description":"Read the generation as Server-Sent Events instead of waiting for a JSON body. A QUERY parameter, not a body field — the handler reads `@Query('stream')` and accepts only the strings `\"true\"` and `\"1\"`, so a `stream` key in the BODY is ignored and the caller silently gets buffered JSON. (`chat/completions` made the opposite choice and takes it in the body; the two are not interchangeable.) A streaming request also never defers: it stays on the inline path, so it cannot answer 504 with a job id the way the JSON mode can.","uniqueKey":"","typeLabel":"enum\u003cstring>"},"description":"Read the generation as Server-Sent Events instead of waiting for a JSON body. A QUERY parameter, not a body field — the handler reads `@Query('stream')` and accepts only the strings `\"true\"` and `\"1\"`, so a `stream` key in the BODY is ignored and the caller silently gets buffered JSON. (`chat/completions` made the opposite choice and takes it in the body; the two are not interchangeable.) A streaming request also never defers: it stays on the inline path, so it cannot answer 504 with a job id the way the JSON mode can."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"Model ID to use for music generation","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"prompt":{"type":"string","description":"Text prompt describing the music. For Lyria 3 Clip, always produces 30s. For Lyria 3 Pro, control duration via prompt or timestamps. For Suno, max 500 chars in non-custom mode, up to 5000 in custom mode.","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"},"operation":{"type":"string","enum":["generate","extend","upload_cover","upload_extend","add_instrumental","add_vocals","sounds","vocal_removal","lyrics"],"default":"generate","description":"Suno operation type. Default = generate. Other operations require additional fields (audio_id, upload_url, etc).","uniqueKey":"operation","typeLabel":"enum\u003cstring>"},"images":{"type":"array","description":"Up to 10 base64-encoded images to inspire the music (Lyria 3 only)","items":{"type":"object","required":["data"],"properties":{"data":{"type":"string","description":"Base64-encoded image data","isRequired":true,"uniqueKey":"images.items.[INDEX].data","typeLabel":"string"},"mime_type":{"type":"string","enum":["image/jpeg","image/png","image/webp","image/gif"],"default":"image/jpeg","uniqueKey":"images.items.[INDEX].mime_type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"images.items.[INDEX]","typeLabel":"object"},"uniqueKey":"images","typeLabel":"object[]"},"response_format":{"type":"string","enum":["mp3","wav"],"default":"mp3","description":"Output format. WAV only supported by Lyria 3 Pro and Suno.","uniqueKey":"response_format","typeLabel":"enum\u003cstring>"},"custom_mode":{"type":"boolean","description":"Suno: Enable custom mode (full control over style/title/lyrics)","uniqueKey":"custom_mode","typeLabel":"boolean"},"instrumental":{"type":"boolean","description":"Suno: Generate instrumental track only (no vocals)","uniqueKey":"instrumental","typeLabel":"boolean"},"title":{"type":"string","description":"Suno: Track title (custom mode, max 100 chars)","uniqueKey":"title","typeLabel":"string"},"style":{"type":"string","description":"Suno: Music genre/style (custom mode, max 1000 chars)","uniqueKey":"style","typeLabel":"string"},"lyrics":{"type":"string","description":"Suno: Lyrics text (custom mode, when not instrumental)","uniqueKey":"lyrics","typeLabel":"string"},"negative_tags":{"type":"string","description":"Suno: Styles to exclude (e.g. \"Heavy Metal, Upbeat Drums\")","uniqueKey":"negative_tags","typeLabel":"string"},"vocal_gender":{"type":"string","enum":["m","f"],"description":"Suno: Preferred vocal gender","uniqueKey":"vocal_gender","typeLabel":"enum\u003cstring>"},"style_weight":{"type":"number","minimum":0,"maximum":1,"description":"Suno: Style adherence weight (0.0-1.0)","uniqueKey":"style_weight","typeLabel":"number"},"weirdness_constraint":{"type":"number","minimum":0,"maximum":1,"description":"Suno: Creativity/novelty constraint (0.0-1.0)","uniqueKey":"weirdness_constraint","typeLabel":"number"},"audio_weight":{"type":"number","minimum":0,"maximum":1,"description":"Suno: Input audio influence weight (0.0-1.0)","uniqueKey":"audio_weight","typeLabel":"number"},"persona_id":{"type":"string","description":"Suno: Persona ID to apply (custom mode)","uniqueKey":"persona_id","typeLabel":"string"},"persona_model":{"type":"string","enum":["style_persona","voice_persona"],"description":"Suno: Persona model type","uniqueKey":"persona_model","typeLabel":"enum\u003cstring>"},"audio_id":{"type":"string","description":"Suno: Source audio ID (for extend, vocal_removal)","uniqueKey":"audio_id","typeLabel":"string"},"task_id":{"type":"string","description":"Suno: Task ID (vocal_removal — references original generation task)","uniqueKey":"task_id","typeLabel":"string"},"upload_url":{"type":"string","description":"Suno: Audio file URL (for upload_cover, upload_extend, add_instrumental, add_vocals)","uniqueKey":"upload_url","typeLabel":"string"},"continue_at":{"type":"number","description":"Suno: Continue from this second mark (extend operations)","uniqueKey":"continue_at","typeLabel":"number"},"default_param_flag":{"type":"boolean","description":"Suno: Use default params (extend operations)","uniqueKey":"default_param_flag","typeLabel":"boolean"},"separation_type":{"type":"string","enum":["separate_vocal","split_stem"],"description":"Suno: Vocal removal type (2 stems vs up to 12 stems)","uniqueKey":"separation_type","typeLabel":"enum\u003cstring>"},"tags":{"type":"string","description":"Suno: Tags for add_instrumental operation","uniqueKey":"tags","typeLabel":"string"},"sound_loop":{"type":"boolean","description":"Suno sounds: Loop the generated sound","uniqueKey":"sound_loop","typeLabel":"boolean"},"sound_tempo":{"type":"integer","minimum":1,"maximum":300,"description":"Suno sounds: BPM (1-300)","uniqueKey":"sound_tempo","typeLabel":"integer"},"sound_key":{"type":"string","description":"Suno sounds: Musical key","uniqueKey":"sound_key","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"\u003cstring>","prompt":"\u003cstring>","operation":"generate","images":[{"data":"\u003cstring>","mime_type":"image/jpeg"}],"response_format":"mp3","custom_mode":true,"instrumental":true,"title":"\u003cstring>","style":"\u003cstring>","lyrics":"\u003cstring>","negative_tags":"\u003cstring>","style_weight":0.5,"weirdness_constraint":0.5,"audio_weight":0.5,"persona_id":"\u003cstring>","audio_id":"\u003cstring>","task_id":"\u003cstring>","upload_url":"\u003cstring>","continue_at":123,"default_param_flag":true,"tags":"\u003cstring>","sound_loop":true,"sound_tempo":150,"sound_key":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"4d5ac534-18a9-4db2-aea7-688a3d0d389c":{"description":"Without `?stream=true` (the default) this is `application/json` — one result object, shown below. Audio is uploaded to private storage and returned as a signed `url` (7-day expiry); if the storage upload fails, the response falls back to inline `b64_audio`.\n\nWith `?stream=true` it is `text/event-stream` instead: a sequence of `data: \u003cjson>\\n\\n` lines terminated by a literal `data: [DONE]`. OpenAPI 3.0 has no vocabulary for \"repeat this, then terminate with a sentinel\", so the `text/event-stream` schema below describes the JSON payload of a SINGLE `data:` line — never the whole body — which is the precedent `chat/completions` set.\n\nA three-member `oneOf` rather than `chat`'s single chunk schema, because music's frames are three genuinely different objects, and rather than the pipeline-run stream's bare `{type: \"string\"}`, because here the discriminant is IN the payload: `progress` repeats while the track renders, then exactly one terminal frame, `completed` or `error`. (The pipeline-run stream cannot be described this way — its encoder moves `type` out onto the SSE `event:` line, leaving no discriminant in the body to key a `oneOf` on.)\n\nRead `type` before anything else. The `error` frame is a real failure delivered as a frame — once SSE headers are flushed the gateway cannot answer with an HTTP status, so the response is still a 200 that ends in `[DONE]` — and `credits_used` appears ONLY on the `completed` frame, so a client that ignores `type` sees a successful, empty, apparently free stream.","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"integer","example":1713204900,"description":"Unix timestamp (seconds) when the generation completed","uniqueKey":"created","typeLabel":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","example":"https://storage.googleapis.com/.../music/...mp3?X-Goog-Signature=...","description":"Signed URL to the generated audio (private, 7-day expiry). Primary field.","uniqueKey":"data.items.[INDEX].url","typeLabel":"string"},"b64_audio":{"type":"string","description":"Base64-encoded audio bytes. Present only when GCS upload fails or on providers that return inline bytes exclusively.","uniqueKey":"data.items.[INDEX].b64_audio","typeLabel":"string"},"content_type":{"type":"string","example":"audio/mpeg","description":"MIME type of the audio (audio/mpeg for Lyria, varies per provider)","uniqueKey":"data.items.[INDEX].content_type","typeLabel":"string"},"duration_seconds":{"type":"number","example":30,"description":"Parsed duration of the generated track","uniqueKey":"data.items.[INDEX].duration_seconds","typeLabel":"number"},"lyrics":{"type":"string","description":"Generated lyrics (Suno only, when requested)","uniqueKey":"data.items.[INDEX].lyrics","typeLabel":"string"}},"uniqueKey":"data.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data","typeLabel":"object[]"},"credits_used":{"type":"integer","example":180,"description":"Credits deducted from the workspace balance for this request","uniqueKey":"credits_used","typeLabel":"integer"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"created":1713204900,"data":[{"url":"https://storage.googleapis.com/.../music/...mp3?X-Goog-Signature=...","b64_audio":"\u003cstring>","content_type":"audio/mpeg","duration_seconds":30,"lyrics":"\u003cstring>"}],"credits_used":180}}},"exampleType":"generated"},"text/event-stream":{"schema":{"oneOf":[{"type":"object","required":["type","status","progress"],"properties":{"type":{"type":"string","enum":["progress"],"description":"Discriminant. Repeats while the track renders; a stream can carry any number of these, including none.","isRequired":true,"uniqueKey":"oneOf.0.type","typeLabel":"enum\u003cstring>"},"status":{"type":"string","enum":["queued","processing","completed","failed"],"description":"The provider's normalised job state. `completed`/`failed` can appear HERE, on a progress frame, before the terminal `completed`/`error` frame arrives — this is the job's state, not the stream's.","isRequired":true,"uniqueKey":"oneOf.0.status","typeLabel":"enum\u003cstring>"},"progress":{"type":"number","description":"Percentage, 0-100.","example":40,"isRequired":true,"uniqueKey":"oneOf.0.progress","typeLabel":"number"},"provider_status":{"type":"string","description":"The provider's own untranslated status string.","uniqueKey":"oneOf.0.provider_status","typeLabel":"string"},"message":{"type":"string","description":"Human-readable progress note, when the provider supplies one.","uniqueKey":"oneOf.0.message","typeLabel":"string"},"error":{"type":"string","description":"A provider-reported error on a STILL-OPEN stream — the generation may still succeed. The terminal failure is the `error` frame, whose `error` is an object rather than this string.","uniqueKey":"oneOf.0.error","typeLabel":"string"},"data":{"description":"Tracks a provider reported early. Rarely populated; the deliverable arrives on the `completed` frame.","type":"array","items":{"type":"object","properties":{"content_type":{"type":"string","description":"MIME type of the audio (`audio/mpeg` for Lyria; varies per provider).","example":"audio/mpeg","isRequired":true,"uniqueKey":"oneOf.0.data.items.[INDEX].content_type","typeLabel":"string"},"duration_seconds":{"type":"number","description":"Parsed duration of the generated track, in seconds.","example":30,"isRequired":true,"uniqueKey":"oneOf.0.data.items.[INDEX].duration_seconds","typeLabel":"number"},"url":{"type":"string","description":"Signed URL to the generated audio (private, 7-day expiry). The primary field — the same offloaded track the non-streaming 200 carries, because the `completed` frame is built from the same `offloadTrackToGcs` pass.","example":"https://storage.googleapis.com/.../music/....mp3?X-Goog-Signature=...","uniqueKey":"oneOf.0.data.items.[INDEX].url","typeLabel":"string"},"b64_audio":{"type":"string","description":"Base64-encoded audio bytes. Present only when the GCS upload failed, or on a provider that returns inline bytes exclusively.","uniqueKey":"oneOf.0.data.items.[INDEX].b64_audio","typeLabel":"string"},"lyrics":{"type":"string","description":"Generated lyrics (Suno only, when requested).","uniqueKey":"oneOf.0.data.items.[INDEX].lyrics","typeLabel":"string"}},"required":["content_type","duration_seconds"],"uniqueKey":"oneOf.0.data.items.[INDEX]","typeLabel":"object"},"uniqueKey":"oneOf.0.data","typeLabel":"object[]"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","required":["type","created","data","credits_used","model"],"properties":{"type":{"type":"string","enum":["completed"],"description":"Discriminant. Terminal success — exactly one of this or `error` arrives, immediately before `data: [DONE]`.","isRequired":true,"uniqueKey":"oneOf.1.type","typeLabel":"enum\u003cstring>"},"created":{"type":"integer","description":"Unix timestamp, in seconds, of when the generation completed.","example":1713204900,"isRequired":true,"uniqueKey":"oneOf.1.created","typeLabel":"integer"},"data":{"description":"The generated tracks.","type":"array","items":{"type":"object","properties":{"content_type":{"type":"string","description":"MIME type of the audio (`audio/mpeg` for Lyria; varies per provider).","example":"audio/mpeg","isRequired":true,"uniqueKey":"oneOf.1.data.items.[INDEX].content_type","typeLabel":"string"},"duration_seconds":{"type":"number","description":"Parsed duration of the generated track, in seconds.","example":30,"isRequired":true,"uniqueKey":"oneOf.1.data.items.[INDEX].duration_seconds","typeLabel":"number"},"url":{"type":"string","description":"Signed URL to the generated audio (private, 7-day expiry). The primary field — the same offloaded track the non-streaming 200 carries, because the `completed` frame is built from the same `offloadTrackToGcs` pass.","example":"https://storage.googleapis.com/.../music/....mp3?X-Goog-Signature=...","uniqueKey":"oneOf.1.data.items.[INDEX].url","typeLabel":"string"},"b64_audio":{"type":"string","description":"Base64-encoded audio bytes. Present only when the GCS upload failed, or on a provider that returns inline bytes exclusively.","uniqueKey":"oneOf.1.data.items.[INDEX].b64_audio","typeLabel":"string"},"lyrics":{"type":"string","description":"Generated lyrics (Suno only, when requested).","uniqueKey":"oneOf.1.data.items.[INDEX].lyrics","typeLabel":"string"}},"required":["content_type","duration_seconds"],"uniqueKey":"oneOf.1.data.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.1.data","typeLabel":"object[]"},"credits_used":{"type":"number","description":"Credits settled for this request (1 credit = $0.01). THE ONLY PLACE a streamed generation's cost appears — a stream has no JSON body to carry it and no `x-request-id`-bearing 200 envelope, so a client that ignores this frame never learns what it paid.","example":180,"isRequired":true,"uniqueKey":"oneOf.1.credits_used","typeLabel":"number"},"model":{"type":"string","description":"Slug of the model that actually ran, which fallback may make different from the one requested.","isRequired":true,"uniqueKey":"oneOf.1.model","typeLabel":"string"},"fallback_from":{"type":"string","description":"Slug originally requested, present only when fallback moved the request off it.","uniqueKey":"oneOf.1.fallback_from","typeLabel":"string"}},"uniqueKey":"oneOf.1","typeLabel":"object"},{"type":"object","required":["type","error"],"properties":{"type":{"type":"string","enum":["error"],"description":"Discriminant. Terminal failure. Once SSE headers are sent the gateway cannot answer with an HTTP status, so a real failure arrives as a FRAME and the stream still ends with `data: [DONE]` and a 200 — a client that ignores `type` sees a successful, empty stream.","isRequired":true,"uniqueKey":"oneOf.2.type","typeLabel":"enum\u003cstring>"},"error":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable failure message.","isRequired":true,"uniqueKey":"oneOf.2.error.message","typeLabel":"string"},"type":{"type":"string","description":"`invalid_request_error` for a 4xx, `provider_error` otherwise.","example":"provider_error","isRequired":true,"uniqueKey":"oneOf.2.error.type","typeLabel":"string"},"status":{"type":"integer","description":"HTTP status this would have been, had the headers not already been flushed.","example":500,"isRequired":true,"uniqueKey":"oneOf.2.error.status","typeLabel":"integer"}},"required":["message","type","status"],"isRequired":true,"uniqueKey":"oneOf.2.error","typeLabel":"object"}},"uniqueKey":"oneOf.2","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"progress","status":"queued","progress":40,"provider_status":"\u003cstring>","message":"\u003cstring>","error":"\u003cstring>","data":[{"content_type":"audio/mpeg","duration_seconds":30,"url":"https://storage.googleapis.com/.../music/....mp3?X-Goog-Signature=...","b64_audio":"\u003cstring>","lyrics":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"9ae14369-5037-4fe0-9276-575d38216149":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"The error envelope. Every non-2xx response from this API has this shape, so a client can parse failures without branching on the endpoint.","required":["message","type","code","param"],"properties":{"message":{"type":"string","example":"Model not found","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","description":"Error category","enum":["invalid_request_error","authentication_error","permission_error","quota_exceeded","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"oneOf":[{"type":"string","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"job_id":{"type":"string","example":"job_1hR9xTPZqK4mVLc2nJ7fY5wB","description":"Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present on the few errors that carry one. When it is here, this is not a failure to retry — retrying pays twice. Collect the result from `GET /v1/images/jobs/{job_id}`, which serves every durable media job regardless of modality.\n\nTwo situations produce it. A media generation that outruns the gateway's wait answers `504` with `code: \"job_timeout\"` and keeps working. And `POST /v1/audio/speech` answers **500** with `code: \"artifact_unreadable\"` when the speech was generated and settled but could not be read back from storage — the audio exists and is paid for; only this response failed.\n\nDeclared here rather than per-endpoint because the rule is about the FIELD, not the status: if this is present, there is a paid-for result to collect. It was undeclared until now, so a client generated from this document could not see the one field that recovers money already spent.","uniqueKey":"error.job_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Model not found","type":"invalid_request_error","code":"model_not_found","param":"model","job_id":"job_1hR9xTPZqK4mVLc2nJ7fY5wB"}}}},"exampleType":"generated"}},"exampleType":"generated"},"401b0e3b-fe39-4a80-a166-52d95aa5e5ab":{"description":"Unauthorized — invalid or missing API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"The error envelope. Every non-2xx response from this API has this shape, so a client can parse failures without branching on the endpoint.","required":["message","type","code","param"],"properties":{"message":{"type":"string","example":"Model not found","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","description":"Error category","enum":["invalid_request_error","authentication_error","permission_error","quota_exceeded","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"oneOf":[{"type":"string","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"job_id":{"type":"string","example":"job_1hR9xTPZqK4mVLc2nJ7fY5wB","description":"Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present on the few errors that carry one. When it is here, this is not a failure to retry — retrying pays twice. Collect the result from `GET /v1/images/jobs/{job_id}`, which serves every durable media job regardless of modality.\n\nTwo situations produce it. A media generation that outruns the gateway's wait answers `504` with `code: \"job_timeout\"` and keeps working. And `POST /v1/audio/speech` answers **500** with `code: \"artifact_unreadable\"` when the speech was generated and settled but could not be read back from storage — the audio exists and is paid for; only this response failed.\n\nDeclared here rather than per-endpoint because the rule is about the FIELD, not the status: if this is present, there is a paid-for result to collect. It was undeclared until now, so a client generated from this document could not see the one field that recovers money already spent.","uniqueKey":"error.job_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Model not found","type":"invalid_request_error","code":"model_not_found","param":"model","job_id":"job_1hR9xTPZqK4mVLc2nJ7fY5wB"}}}},"exampleType":"generated"}},"exampleType":"generated"},"995de94a-9740-428f-b0ce-3f66cb388729":{"description":"Model not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"The error envelope. Every non-2xx response from this API has this shape, so a client can parse failures without branching on the endpoint.","required":["message","type","code","param"],"properties":{"message":{"type":"string","example":"Model not found","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","description":"Error category","enum":["invalid_request_error","authentication_error","permission_error","quota_exceeded","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"oneOf":[{"type":"string","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"job_id":{"type":"string","example":"job_1hR9xTPZqK4mVLc2nJ7fY5wB","description":"Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present on the few errors that carry one. When it is here, this is not a failure to retry — retrying pays twice. Collect the result from `GET /v1/images/jobs/{job_id}`, which serves every durable media job regardless of modality.\n\nTwo situations produce it. A media generation that outruns the gateway's wait answers `504` with `code: \"job_timeout\"` and keeps working. And `POST /v1/audio/speech` answers **500** with `code: \"artifact_unreadable\"` when the speech was generated and settled but could not be read back from storage — the audio exists and is paid for; only this response failed.\n\nDeclared here rather than per-endpoint because the rule is about the FIELD, not the status: if this is present, there is a paid-for result to collect. It was undeclared until now, so a client generated from this document could not see the one field that recovers money already spent.","uniqueKey":"error.job_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Model not found","type":"invalid_request_error","code":"model_not_found","param":"model","job_id":"job_1hR9xTPZqK4mVLc2nJ7fY5wB"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"28329752-e8e2-45dc-9c9e-5bc577460aea":{"ApiKey":{"type":"apiKey","in":"header","name":"Authorization","description":"API key in format: Bearer inf_***","scopes":[]}}},"servers":{"70c58c78-558b-477f-817f-fa094a9f1354":{"url":"https://api.infery.ai","description":"Production"},"250da9ba-2678-444c-bc3b-e169d87db6d0":{"url":"http://localhost:3001","description":"Local"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"Authorization","description":"API key in format: Bearer inf_***","scopes":[]},"schema":{"title":"Authorization","type":"string","description":"API key in format: Bearer inf_***","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKey","name":"Authorization"}],"title":"ApiKey"}]},"originalFileLocation":"openapi.json"},"subdomain":"inferyai","siteName":"Infery.ai","title":"Music - Infery.ai","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-19T11:36:41.706Z","originalFileLocation":"api-reference/music.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Generate full songs from a prompt.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Infery.ai\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Music - Infery.ai\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate full songs from a prompt.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Infery.ai Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.infery.ai/api-reference/music\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.infery.ai/brand/og.jpg\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Music - Infery.ai\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate full songs from a prompt.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.infery.ai/brand/og.jpg\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Infery.ai\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2E5BE8\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.infery.ai/api-reference/music\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/music.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.infery.ai/#organization\",\"name\":\"Infery.ai\",\"url\":\"https://docs.infery.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/inferyai/0Jgb47bSQtZI-re9/brand/logo-light.svg?fit=max\u0026auto=format\u0026n=0Jgb47bSQtZI-re9\u0026q=85\u0026s=d3ebed9120aa8e785f372aa43a7cccf3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.infery.ai#website\",\"name\":\"Infery.ai\",\"url\":\"https://docs.infery.ai\",\"publisher\":{\"@id\":\"https://docs.infery.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.infery.ai/api-reference/music#webpage\",\"url\":\"https://docs.infery.ai/api-reference/music\",\"name\":\"Music\",\"description\":\"Generate full songs from a prompt.\",\"dateModified\":\"2026-08-19T11:36:41.706Z\",\"isPartOf\":{\"@id\":\"https://docs.infery.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.infery.ai/api-reference/music#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.infery.ai/api-reference/music#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Infery.ai\",\"item\":\"https://docs.infery.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Music\",\"item\":\"https://docs.infery.ai/api-reference/music\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.infery.ai/api-reference/music#apireference\",\"headline\":\"Music\",\"name\":\"Music\",\"description\":\"Generate full songs from a prompt.\",\"url\":\"https://docs.infery.ai/api-reference/music\",\"mainEntityOfPage\":{\"@id\":\"https://docs.infery.ai/api-reference/music#webpage\"},\"image\":\"https://docs.infery.ai/brand/og.jpg\",\"dateModified\":\"2026-08-19T11:36:41.706Z\",\"publisher\":{\"@id\":\"https://docs.infery.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.infery.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Infery.ai\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Infery.ai","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API overview","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"Errors","href":"/api-reference/errors"},{"title":"Rate limits","href":"/api-reference/rate-limits"}]},{"group":"Chat Completions","pages":[{"title":"Chat completions","openapi":"openapi.json POST /v1/chat/completions","href":"/api-reference/chat-completions"}]},{"group":"Embeddings","pages":[{"title":"Embeddings","openapi":"openapi.json POST /v1/embeddings","href":"/api-reference/embeddings"}]},{"group":"Images","pages":[{"title":"Generate an image","openapi":"openapi.json POST /v1/images/generations","href":"/api-reference/images/generations"},{"title":"Edit an image","openapi":"openapi.json POST /v1/images/edits","href":"/api-reference/images/edits"},{"title":"Upscale an image","openapi":"openapi.json POST /v1/images/upscale","href":"/api-reference/images/upscale"}]},{"group":"Audio","pages":[{"title":"Text-to-speech","openapi":"openapi.json POST /v1/audio/speech","href":"/api-reference/audio/speech"},{"title":"Speech-to-text","openapi":"openapi.json POST /v1/audio/transcriptions","href":"/api-reference/audio/transcriptions"},{"title":"Transform audio","openapi":"openapi.json POST /v1/audio/transformations","href":"/api-reference/audio/transformations"}]},{"group":"Video","pages":[{"title":"Create video generation","openapi":"openapi.json POST /v1/videos/generations","href":"/api-reference/videos/generations"},{"title":"Get video generation status","openapi":"openapi.json GET /v1/videos/generations/{jobId}","href":"/api-reference/videos/status"},{"title":"Upscale a video","description":"POST /v1/video/upscale","openapi":"openapi.json POST /v1/video/upscale","href":"/api-reference/videos/upscale"}]},{"group":"Music","pages":[{"title":"Music","openapi":"openapi.json POST /v1/music/generations","href":"/api-reference/music"}]},{"group":"Files","pages":[{"title":"Upload a file","description":"POST /v1/files — upload a file and get back a reusable file_id.","openapi":"openapi.json POST /v1/files","href":"/api-reference/files/upload"},{"title":"List files","openapi":"openapi.json GET /v1/files","href":"/api-reference/files/list"},{"title":"Retrieve file metadata","openapi":"openapi.json GET /v1/files/{fileId}","href":"/api-reference/files/retrieve"},{"title":"Delete a file","openapi":"openapi.json DELETE /v1/files/{fileId}","href":"/api-reference/files/delete"},{"title":"Download file contents","openapi":"openapi.json GET /v1/files/{fileId}/content","href":"/api-reference/files/content"}]},{"group":"Models","pages":[{"title":"Models","openapi":"openapi.json GET /v1/models","href":"/api-reference/models"},{"title":"Estimate a model request","openapi":"openapi.json POST /v1/models/{slug}/estimate","href":"/api-reference/models-estimate"}]},{"group":"Capabilities","pages":[{"title":"List capabilities","openapi":"openapi.json GET /v1/tools","href":"/api-reference/tools"},{"title":"Run a capability","openapi":"openapi.json POST /v1/capabilities/{id}/run","href":"/api-reference/capabilities/run"},{"title":"Generate a 3D model","openapi":"openapi.json POST /v1/3d/generations","href":"/api-reference/3d/generations"}]},{"group":"Workflows","pages":[{"title":"Run a workflow","openapi":"openapi.json POST /v1/workflows/runs","href":"/api-reference/workflows/run"},{"title":"Retrieve a run","openapi":"openapi.json GET /v1/workflows/runs/{id}","href":"/api-reference/workflows/run-retrieve"},{"title":"Cancel a run","openapi":"openapi.json POST /v1/workflows/runs/{id}/cancel","href":"/api-reference/workflows/run-cancel"},{"title":"Run logs","openapi":"openapi.json GET /v1/workflows/runs/{id}/logs","href":"/api-reference/workflows/run-logs"},{"title":"Estimate a run","openapi":"openapi.json POST /v1/workflows/estimate","href":"/api-reference/workflows/estimate"},{"title":"Create a workflow","openapi":"openapi.json POST /v1/workflows","href":"/api-reference/workflows/create"},{"title":"List workflows","openapi":"openapi.json GET /v1/workflows","href":"/api-reference/workflows/list"},{"title":"Retrieve a workflow","openapi":"openapi.json GET /v1/workflows/{id}","href":"/api-reference/workflows/retrieve"},{"title":"Update a workflow","openapi":"openapi.json PUT /v1/workflows/{id}","href":"/api-reference/workflows/update"},{"title":"Delete a workflow","openapi":"openapi.json DELETE /v1/workflows/{id}","href":"/api-reference/workflows/delete"},{"title":"List templates","openapi":"openapi.json GET /v1/workflows/templates","href":"/api-reference/workflows/templates-list"},{"title":"Retrieve a template","openapi":"openapi.json GET /v1/workflows/templates/{slug}","href":"/api-reference/workflows/templates-retrieve"}]}]}]},"title":"Music - Infery.ai","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-Bbp7I60D.js","utils-C3RIvJha.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DqD-vLt8.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B31Loprg.js","snippetPresets-DKpk-b8t.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Cj65AhOR.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BXtn5gcC.js","shallow-RY2b03Cp.js","getApiPlaygroundDisplay-B0jeiPk3.js","CodeSnippet-CYgBjjwn.js","CodeSnippets-DOngDrYB.js","Page-n7I5XbKb.js","getPastedJson-DRQbJx-T.js","icon-CQiQCicY.js","MethodPill-BKTLdNtu.js","DuplicateIcon-B9jpAdat.js","createIcon-DCddRrXv.js","DynamicMarkdown-a8hUKrw6.js","SectionHeading-eECVV2eH.js","axios-vUo_bRtp.js","Markdown--GF7ZIpf.js","clsx-DZLdJUrt.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-2LoAhjKH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Zwc0ZncM.js"]}