Skip to content

feat: music generation capability over suno-api compatible gateways - #14

Open
amos-aios wants to merge 1 commit into
mofa-org:mainfrom
amos-aios:feat/music-gen
Open

feat: music generation capability over suno-api compatible gateways#14
amos-aios wants to merge 1 commit into
mofa-org:mainfrom
amos-aios:feat/music-gen

Conversation

@amos-aios

Copy link
Copy Markdown

What

Adds a music_gen capability over any gcui-art/suno-api compatible gateway — the community de-facto standard contract for Suno (deploy to Vercel/Docker or self-host).

  • Capability::MusicGen (music_gen, aliases music/ttm/singing)
  • ProviderKind::CloudMusicGen (kind = "cloud_music_gen"): submit → poll clips → download, mirroring CloudVideoGenProvider's task shape:
    • POST /api/generate (standard) or POST /api/custom_generate when lyrics/style/title params are set (Custom Mode; style rides under both tags and style)
    • GET /api/get?ids= polled until a clip streamings (5s default, poll_interval_secs override, 120-poll backstop); complete accepted as a synonym; unknown statuses keep polling
    • the finished audio_url downloads into a managed mofa_music_*.mp3 artifact; the clip's title · tags ride back as the response text label
  • Auth: the Suno session cookie in the Cookie header (api_key, env fallback SUNO_COOKIE); gateways holding their own cookie work keyless here — availability stays Configured and invoke surfaces any auth error honestly.

config.example.toml documents the setup.

Testing

6 tests in cloud_music_gen: submit-body mapping (standard vs Custom vs instrumental), clip-state mapping (pending/ready/failed, finished-without-URL is a failure not a hang), capability/model guards, and two live mock-gateway lifecycles — poll progression with cookie auth asserted, and a full run downloading real mp3 bytes into an artifact with the title · tags label. Full engine workspace suite green.

🤖 Generated with Claude Code

Capability::MusicGen + ProviderKind::CloudMusicGen. The backend speaks
the gcui-art/suno-api contract (the community de-facto standard):
POST /api/generate (standard) or /api/custom_generate (lyrics/style/
title switch to Custom Mode) → poll GET /api/get?ids= until a clip
streams → download the mp3 into a managed artifact, carrying the clip's
title/tags as the response label. Auth is the Suno session cookie in
the Cookie header; gateways holding their own SUNO_COOKIE work with no
key here. 6 tests: body/clip-state mapping, capability+model guards,
and two live mock-gateway lifecycles (poll progression, cookie attached,
download-to-artifact with title·tags).

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant