[ MUSIC THAT LEAVES THE CHAT ]

Make music. Then let someone hear it.

musicwire turns a complete MusicXML score into audio you can play, MIDI you can edit, and a receipt that records the render. This page is for the agent doing the work and the human listening to the result.

[ QUICKSTART ]

Connect, request, pay, receive, listen.

  1. Connect your agent

    Use the MCP server when your agent supports MCP. Add this connection to its project configuration, then configure that client with a funded x402 buyer wallet. The public service URL is explicit so your agent reaches musicwire.

    {
      "mcpServers": {
        "musicwire": {
          "command": "npx",
          "args": ["-y", "musicwire-mcp"],
          "env": { "MUSICWIRE_API_URL": "https://musicwire.5432wire.com" }
        }
      }
    }

    Hosted MCP clients such as Claude Connectors and Smithery connect over Streamable HTTP at the same domain. Musicwire does not hold a buyer wallet for that endpoint. Paid tools quote with the same x402 challenge as the HTTPS API.

    https://musicwire.5432wire.com/mcp

    For plain HTTPS, read the live machine-readable manifest first:

    curl https://musicwire.5432wire.com/manifest
  2. Ask for a complete score

    Tell the agent what to write, or provide your own MusicXML. The free compose guide gives an agent a versioned authoring prompt and quality bar.

    curl 'https://musicwire.5432wire.com/v1/compose-guide?style=waltz&key=C%20major&tempo=96'
  3. Request a render

    Ask for mp3 so a human can listen and midi so they can continue editing. The worked examples below use those formats.

  4. Authorize the quoted payment

    A paid request first receives an exact x402 quote. An x402-aware MCP client handles that retry. With plain HTTPS, use an x402 buyer to sign and retry the identical request.

  5. Receive and listen

    Poll the returned job until it is completed. Open the MP3 link in a browser or audio player. Download the MIDI into a DAW or notation editor. Keep the receipt with the final work.

[ WORKED EXAMPLES ]

Hear what agents can make.

Nine complete miniatures show the range from a happy solo piano piece to a house/EDM drop. Every sample below has passed musicwire's real render and audio quality checks.

[ LISTENING GALLERY ]

Nine complete scores, ready to hear and reuse.

For humans

Press play first. Each miniature is roughly a minute of written music, with its own musical shape and a self-hosted MP3. Download or open the score only if you want to see how the sound was made.

For agents

Expand a score to copy the exact MusicXML, then submit it verbatim with formats:["mp3","midi"]. These are complete testable inputs, not prompts or partial fragments.

01 - solo

Moonlit Thread

For humans

Restless, lyrical violin in D minor - 46 seconds.

Production recipe: Chamber lyric at 84 BPM for solo violin. A rising call opens, a higher sequential answer develops it, then the line settles quietly home.

For agents

Compose-guide note: The minor-mode rise creates tension and the soft return resolves it. Keep the climb, answer, and release when adapting the tempo or key.

Copy the full MusicXML
Loading MusicXML…
Download MusicXML
Copy the exact render request
Loading request…

02 - solo

Sunroom Parade

For humans

Bright, happy piano in C major - 50 seconds.

Production recipe: Happy salon piano at 96 BPM. A buoyant C-major opening becomes a higher middle strain, then a familiar cadence returns with a soft smile.

For agents

Compose-guide note: Major triads, a skip in the top voice, and a lift in register make the optimism audible. Preserve that rising middle section instead of looping one progression.

Copy the full MusicXML
Loading MusicXML…
Download MusicXML
Copy the exact render request
Loading request…

03 - solo

Cedar Lantern

For humans

Warm fingerstyle classical guitar in E minor - 46 seconds.

Production recipe: Reflective E-minor fingerstyle guitar at 84 BPM. Open-string arpeggios introduce the harmony, the answer reaches wider, and the final E is left ringing.

For agents

Compose-guide note: Broken chords and ringing open strings fit a guitar more naturally than piano blocks. Vary the harmonic path before the final tonic so the ending feels earned.

Copy the full MusicXML
Loading MusicXML…
Download MusicXML
Copy the exact render request
Loading request…

04 - solo

Daybreak Kite

For humans

Airy, playful flute in D major - 49 seconds.

Production recipe: Buoyant D-major flute at 88 BPM. A breath precedes the opening call, the melody launches higher in the middle, and descends to a light landing.

For agents

Compose-guide note: A rest and short phrases imply breath, while the upper-register crest makes the title feel airborne. Retain those breathing points when rewriting the melody.

Copy the full MusicXML
Loading MusicXML…
Download MusicXML
Copy the exact render request
Loading request…

05 - solo

Echoes Without Words

For humans

Wordless synthesized choir voice (Ahh) in A minor - 48 seconds.

Production recipe: Still choral meditation at 80 BPM for a synthesized Ahh sound. Two long cells establish the idea, one crest widens it, and the final A fades.

For agents

Compose-guide note: Long legato notes make a synthesized choir sound intentional rather than lyric-bearing. Keep it wordless and label the voice honestly when adapting this texture.

Copy the full MusicXML
Loading MusicXML…
Download MusicXML
Copy the exact render request
Loading request…

06 - ensemble

Winter Window

For humans

Intimate string quartet in G minor - 51 seconds.

Production recipe: G-minor string quartet at 76 BPM: two violins, viola, and cello. A close texture supports the first motif, the center opens the register, and all four settle to G.

For agents

Compose-guide note: Give Violin I the changing line, inner strings harmonic motion, and cello the floor. Distinct roles make an ensemble sound like conversation rather than four copies.

Copy the full MusicXML
Loading MusicXML…
Download MusicXML
Copy the exact render request
Loading request…

07 - ensemble

Bright Map

For humans

Buoyant flute, clarinet, bassoon, and piano in B-flat major - 46 seconds.

Production recipe: Neoclassical travel sketch at 84 BPM for flute, clarinet, bassoon, and piano. The flute maps the route, winds color the middle, and a compact tutti cadence closes.

For agents

Compose-guide note: Keep the flute light, the bassoon low, and piano harmonic rather than melodic. The contrast of high route and low foundation creates the sense of motion.

Copy the full MusicXML
Loading MusicXML…
Download MusicXML
Copy the exact render request
Loading request…

08 - ensemble

Lantern Call

For humans

Driving house/EDM with synth bass, lead, pad, and drum kit in C minor - 46 seconds.

Production recipe: Dark, uplifting house/EDM at 126 BPM in C minor for synth lead, synth bass, synth pad, and a house drum kit. Pads open the room, a four-on-the-floor groove establishes the pulse, an ascending eight-bar build drops to a two-bar break, then the full hook lands hard.

For agents

Compose-guide note: This is the electronic-genres proof: give the bass and kick the same quarter-note grid, let the lead climb to create tension, and remove that foundation briefly before restoring every layer at the drop. Keep those roles and the contrast will survive a new key, tempo, or synth sound.

Copy the full MusicXML
Loading MusicXML…
Download MusicXML
Copy the exact render request
Loading request…

09 - ensemble

After Hours Signal

For humans

Easy-swing alto sax, piano, bass, and drumset in F major - 46 seconds.

Production recipe: Relaxed F-major easy swing at 104 BPM for alto sax, piano, acoustic bass, and drumset. Sax states the head, rhythm section opens it up, then it cools into F.

For agents

Compose-guide note: Give sax the hook, piano compact changes, bass a walking line, and drums a pulse. Independent roles make the groove readable even in a short arrangement.

Copy the full MusicXML
Loading MusicXML…
Download MusicXML
Copy the exact render request
Loading request…
A

[ SINGLE INSTRUMENT ]

Solo piano in C major

Save this as solo-piano.musicxml. It is a short, complete two-bar piano phrase at 96 BPM.

<?xml version="1.0" encoding="UTF-8"?>
<score-partwise version="4.0">
  <work><work-title>Small Steps</work-title></work>
  <identification><creator type="composer">Your agent</creator></identification>
  <part-list>
    <score-part id="P1"><part-name>Piano</part-name></score-part>
  </part-list>
  <part id="P1">
    <measure number="1">
      <attributes><divisions>1</divisions><key><fifths>0</fifths><mode>major</mode></key><time><beats>4</beats><beat-type>4</beat-type></time><clef><sign>G</sign><line>2</line></clef></attributes>
      <direction placement="above"><direction-type><metronome><beat-unit>quarter</beat-unit><per-minute>96</per-minute></metronome></direction-type><sound tempo="96"/></direction>
      <note><pitch><step>C</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>E</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>G</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><rest/><duration>1</duration><type>quarter</type></note>
    </measure>
    <measure number="2">
      <note><pitch><step>G</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>E</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>D</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>C</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <barline location="right"><bar-style>light-heavy</bar-style></barline>
    </measure>
  </part>
</score-partwise>

Render, pay, and get the result

Create the JSON request from the file, then use your x402 buyer to submit it. Keep one idempotency key for safe retries of this same request.

node -e 'const fs=require("fs"); console.log(JSON.stringify({musicxml:fs.readFileSync(process.argv[1],"utf8"),formats:["mp3","midi"]}))' solo-piano.musicxml > request.json

npx awal x402 pay https://musicwire.5432wire.com/v1/render \
  -X POST -d "$(cat request.json)" \
  -h '{"content-type":"application/json","Idempotency-Key":"solo-piano-001"}' \
  --max-amount 1000000 --json

The successful submission returns a job immediately. Its fields look like this:

{
  "job_id": "a-render-job-id",
  "status": "queued",
  "estimated_seconds": 25,
  "price_usd": "live quoted price",
  "payment": { "status": "verified_pending_qc", "capture_policy": "capture_only_after_qc_pass" },
  "poll_url": "/v1/jobs/a-render-job-id"
}

Poll until status is completed, then open the .mp3 artifact URL. That is the moment the human hears the piece.

curl https://musicwire.5432wire.com/v1/jobs/a-render-job-id
B

[ ENSEMBLE ]

Violin and cello in two parts

Parts are declared in part-list and written separately by their IDs. Save this as violin-cello.musicxml.

<?xml version="1.0" encoding="UTF-8"?>
<score-partwise version="4.0">
  <work><work-title>Two Voices</work-title></work>
  <identification><creator type="composer">Your agent</creator></identification>
  <part-list>
    <score-part id="P1"><part-name>Violin</part-name></score-part>
    <score-part id="P2"><part-name>Violoncello</part-name></score-part>
  </part-list>
  <part id="P1"><measure number="1">
    <attributes><divisions>1</divisions><key><fifths>0</fifths><mode>major</mode></key><time><beats>4</beats><beat-type>4</beat-type></time><clef><sign>G</sign><line>2</line></clef></attributes>
    <direction placement="above"><direction-type><metronome><beat-unit>quarter</beat-unit><per-minute>84</per-minute></metronome></direction-type><sound tempo="84"/></direction>
    <note><pitch><step>E</step><octave>5</octave></pitch><duration>2</duration><type>half</type></note>
    <note><pitch><step>G</step><octave>5</octave></pitch><duration>2</duration><type>half</type></note>
    <barline location="right"><bar-style>light-heavy</bar-style></barline>
  </measure></part>
  <part id="P2"><measure number="1">
    <attributes><divisions>1</divisions><key><fifths>0</fifths><mode>major</mode></key><time><beats>4</beats><beat-type>4</beat-type></time><clef><sign>F</sign><line>4</line></clef></attributes>
    <note><pitch><step>C</step><octave>3</octave></pitch><duration>2</duration><type>half</type></note>
    <note><pitch><step>G</step><octave>2</octave></pitch><duration>2</duration><type>half</type></note>
    <barline location="right"><bar-style>light-heavy</bar-style></barline>
  </measure></part>
</score-partwise>

The request is the same. The service automatically applies the ensemble price when the score has more than one part.

node -e 'const fs=require("fs"); console.log(JSON.stringify({musicxml:fs.readFileSync(process.argv[1],"utf8"),formats:["mp3","midi"]}))' violin-cello.musicxml > request.json

npx awal x402 pay https://musicwire.5432wire.com/v1/render \
  -X POST -d "$(cat request.json)" \
  -h '{"content-type":"application/json","Idempotency-Key":"violin-cello-001"}' \
  --max-amount 1000000 --json

When it completes, play the .mp3 and import the .midi to continue editing the score.

[ AUDIO QUALITY ]

Natural endings are allowed. Extra audio is not.

For humans

Musicwire compares the MP3 length with the score's playback length. MuseScore adds a small natural ending after the final note, so every MP3 has a three-second allowance plus 10% of the score duration. Scores that name a sustained instrument or section, including violin, cello, Wind, Woodwind, Brass, Strings, organ, or voice, receive up to 3.25 seconds instead.

This only allows a normal release tail. Audio that runs longer than that limit still fails quality control, returns failed_not_charged, and is never captured.

For agents

Declare each part with a truthful part-name or instrument-name. Musicwire uses those declared instruments to select the bounded tail allowance, then rejects any MP3 longer than score_duration + allowance + 10%.

<score-part id="P1">
  <part-name>Violin</part-name>
</score-part>

[ AFTER THE RUN ]

Give the human the right file.

Listen

Open the MP3 artifact URL in a browser or audio player. Download it before the job's expires_at time.

Keep editing

Import MIDI into a DAW or notation app. MusicXML is always included as the source score.

Keep proof

Save receipt.json with the audio. It records the paid render and its quality outcome. NOTICE.txt carries the soundfont attribution plus the render receipt ID and the free verification URL.

A completed job includes MusicXML, NOTICE.txt, and receipt.json automatically. Artifact links are available until the completed job's expires_at timestamp. Save any file you need before then.

[ VERIFY IT CAME FROM US ]

Every artifact is attributed and provable.

Every rendered artifact carries embedded musicwire attribution plus its render receipt ID, without altering the audio samples or MIDI events:

  • MP3: encoded-by, comment, and copyright metadata
  • MIDI: copyright and text meta events
  • MusicXML: musicwire software metadata

Each completed render also includes NOTICE.txt with that receipt ID and the free verification URL. Embedded tags are useful attribution but can be removed by a determined party. The durable signed hash receipt is the provenance proof: calculate the SHA-256 of an unmodified file and submit it to the free POST /v1/provenance/verify endpoint. A changed file has a different hash and cannot be verified as the original musicwire output.

shasum -a 256 output.mp3

curl -s -X POST https://musicwire.5432wire.com/v1/provenance/verify \
  -H 'content-type: application/json' \
  -d '{"sha256":"64-character-lowercase-hex-hash"}'

A matching response includes rendered_by_musicwire: true, the receipt ID, render time, signed receipt, and matching artifact record. An unknown hash returns { "rendered_by_musicwire": false }.

[ DISCOVERY FLOW ]

Probe, get the 402 challenge, pay, get the result.

For humans

You never need to know the price in advance. Send any request without a payment to POST /v1/validate or POST /v1/render - even with an empty or missing body - and musicwire answers 402 Payment Required with a quote listing the price, network, asset, and receiving address. Pay that quote with any standard x402 client and repeat the request; the body is only validated after a payment is presented, and a rejected body never charges you.

For agents

# Hosted MCP: initialize and list tools are free. A paid tool call
# without Payment-Signature returns HTTP 402 with the same quote as
# the HTTPS API. Retry the identical MCP request after signing.
curl -si -X POST https://musicwire.5432wire.com/mcp \
  -H 'accept: application/json, text/event-stream' \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

# 1. Probe a priced route. Any unpaid request returns the 402 challenge;
#    the Payment-Required header carries the machine-readable quote.
curl -si -X POST https://musicwire.5432wire.com/v1/validate

# 2. Or read the requirements with standard x402 buyer tooling.
npx -y awal x402 details https://musicwire.5432wire.com/v1/validate --json

# 3. Sign the quote and retry with payment in one step.
npx -y awal x402 pay https://musicwire.5432wire.com/v1/validate \
  -X POST -d '{"musicxml":"<your complete MusicXML document>"}'

# 4. Read the result. 200 means valid and settled after QC; 422 with
#    status failed_not_charged means QC failed and nothing was charged.

The same flow applies to POST /v1/render. A probe without a readable score is quoted the solo base price; probing with your real request body returns the exact price tier your payment must match.

[ CONCISE REFERENCE ]

The endpoints you will use.

GET /v1/compose-guide Loading...

Returns the agent authoring prompt and MusicXML quality bar.

POST /v1/validate Loading...

Checks MusicXML and returns detailed errors when the score is invalid.

POST /v1/render Loading...

Requires JSON with musicxml and a non-empty formats list. Returns an asynchronous job.

GET /v1/jobs/{id} Loading...

Returns status, quality result, receipt, expiry, and artifact URLs.

POST /v1/provenance/verify

Free. Submit { "sha256": "..." } to check a file hash against musicwire's signed render receipts.

POST /mcp

Streamable HTTP MCP. The same tools as npx -y musicwire-mcp: compose guide, validate, render, job status, and provenance verify. Validate and render return HTTP 402 until the caller retries with an x402 Payment-Signature. Poll musicwire_get_job with repeated short calls here rather than one long wait_for_completion hold; the gateway in front of this endpoint times out requests after roughly 29 seconds while the render continues and stays pollable.

GET /manifest

Live machine-readable capabilities, prices, formats, and payment network.

Useful statuses and errors

Response What to do
402 Authorize the exact quoted x402 payment, then retry the same request.
422 For validation, read the line-level errors. For a render, correct the MusicXML and try again.
completed Open the audio artifact and save the files you need.
failed_not_charged The render did not pass. Read its error. Payment is not captured.
409 The Idempotency-Key was already used with a different payload. Retry the original body or pick a new key. No payment is charged.
429 Slow down and retry after one minute.

Use an Idempotency-Key on paid requests. Reusing it with the same verified payer and identical payload returns the original outcome and does not create another charge or job. Read retry_policy, max_generation_seconds, pay_with, and refund_policy from /manifest or /.well-known/x402 before paying.