Musicwire

A deterministic MusicXML validation, MuseScore rendering, and automated QC API. Agents pay per call in USDC via x402 on Base.

Live on Base Loading...

What is Musicwire?

Musicwire is an API that lets AI agents and developers validate, render, and quality-check MusicXML scores with professional results.

Compose Guide

Free MusicXML authoring guide with versioned prompts

Loading...

Validate

Detailed validation with line-level error diagnostics

Loading...

Render

MuseScore rendering with automated QC and multiple output formats

Loading...

Job Status

Poll render jobs to completion and retrieve artifacts

Loading...

Payment uses EIP-3009 x402 with Exact USDC on Base. Charges are only captured after quality control passes - you only pay for valid, successful renders.

How It Works

For Agent Developers

Use the musicwire-mcp npm package for seamless integration with MCP clients like Claude Code and Cursor.

npx -y musicwire-mcp

Or install globally:

npm install -g musicwire-mcp

Then configure your MCP client with:

{
  "mcpServers": {
    "musicwire": {
      "command": "musicwire-mcp",
      "env": {
        "MUSICWIRE_API_URL": "https://musicwire.5432wire.com"
      }
    }
  }
}

Set MUSICWIRE_X402_PRIVATE_KEY in your shell environment with a wallet funded on the network the target deployment advertises: Base mainnet USDC for musicwire.5432wire.com, Base Sepolia test USDC for a local deployment.

Raw HTTP + x402 Flow

Or call the API directly with x402 payment authorization:

# 1. Get a price quote
curl -X POST https://musicwire.5432wire.com/v1/render \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: my-render-001' \
  --data '{"musicxml":"...","formats":["pdf","mp3"]}'

# Returns 402 Payment Required with quote details
# 2. Sign and retry with x402
npx awal x402 pay https://musicwire.5432wire.com/v1/render \
  -X POST \
  -d '{"musicxml":"...","formats":["pdf","mp3"]}' \
  -h '{"content-type":"application/json","Idempotency-Key":"my-render-001"}' \
  --max-amount 500000

See the full documentation for complete examples.

Supported Formats

Musicwire returns MusicXML, NOTICE.txt, and receipt.json with every completed render. Optionally request additional formats:

Format Description
mscz MuseScore project file
pdf Sheet music PDF
svg Vector graphics (page set)
png Raster graphics (page set)
midi MIDI file
mp3 Audio render
wav Uncompressed audio

Quality Guarantees

Every paid render includes automated quality control that verifies:

  • MusicXML parse and semantic validation
  • MuseScore renderer exit code 0
  • All requested artifacts are present
  • Audio containers are valid with non-silent RMS
  • Score duration matches requested constraints (within 10% tolerance)
  • Optional key, tempo, and duration constraints match

Failed QC = No charge. You only pay for successful, validated renders.

Idempotency keys replay the original outcome to the same verified payer, ensuring you're never charged twice for the same request. See the idempotency documentation for the exact replay windows.