Skip to content

fix: align music CLI and SDK with the current API contract#196

Merged
NianJiuZst merged 1 commit into
mainfrom
codex/align-music-api
Jul 14, 2026
Merged

fix: align music CLI and SDK with the current API contract#196
NianJiuZst merged 1 commit into
mainfrom
codex/align-music-api

Conversation

@NianJiuZst

Copy link
Copy Markdown
Collaborator

Summary

  • accept the official music-2.6-free and music-cover-free models in CLI and SDK validation
  • normalize the SDK's instrumental convenience alias to the official is_instrumental field without sending SDK-only fields to the API
  • require a prompt for instrumental and lyrics-optimizer requests, matching the API contract
  • decode SSE hex audio in SDK streaming instead of yielding raw protocol frames
  • centralize music model lists and update CLI/SDK examples

Root cause

The model allowlists lagged behind the current API, the SDK validated a different field from its documented instrumental alias, and its streaming path bypassed the SSE/hex decoding already used by the CLI.

Impact

Free-tier users can use both supported music models through the CLI. SDK instrumental examples now produce an API-compatible request, and streaming consumers receive audio bytes rather than SSE text.

Official contract: https://platform.minimax.io/docs/api-reference/music-generation

Related to #182.

Validation

  • bun test — 384 passed
  • targeted Music SDK tests — 16 passed
  • bun run typecheck
  • bun run build:dev
  • ESLint on all changed TypeScript files
  • git diff --check

@NianJiuZst NianJiuZst marked this pull request as ready for review July 14, 2026 12:54
@NianJiuZst

Copy link
Copy Markdown
Collaborator Author

Reviewed by GPT-5.6 Sol Ultra — approved, with no issues identified.

@NianJiuZst NianJiuZst merged commit ab29137 into main Jul 14, 2026
3 checks passed
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