# ScoreFlip API: full documentation > ScoreFlip's API turns audio into sheet music (MusicXML + MIDI), splits songs into stems, and reads photos of printed sheet music. It is paid with credits: there is no free tier, credits never expire, and failed jobs are refunded. Live prices: https://api.scoreflip.roovemusic.com/api/v1/pricing/credits. Base URL: https://api.scoreflipml.roovemusic.com. Human docs: https://www.roovemusic.com/scoreflip/developers. OpenAPI 3.1: https://www.roovemusic.com/scoreflip/developers/openapi.json. MCP server (Streamable HTTP): https://api.scoreflipml.roovemusic.com/mcp. ## Quickstart 1. A human signs in to the ScoreFlip app (Google or Apple), opens Settings, then Developer API (https://www.roovemusic.com/scoreflip/developers/console links there), buys credits (card via Paddle or Flutterwave, or crypto) and creates an API key (sf_live_..., shown once). 2. Send the key as `Authorization: Bearer ` (or `X-API-Key`). 3. POST a job, poll it, download the result: ```bash # 1. Start a job (this spends credits; max_credits caps the cost) curl -X POST https://api.scoreflipml.roovemusic.com/v1/transcriptions \ -H "Authorization: Bearer $SCOREFLIP_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com/my-recording.mp3", "mode": "auto", "max_credits": 200}' # 2. Poll until status is "done" curl https://api.scoreflipml.roovemusic.com/v1/jobs/JOB_ID \ -H "Authorization: Bearer $SCOREFLIP_API_KEY" # 3. Download the score curl "https://api.scoreflipml.roovemusic.com/v1/jobs/JOB_ID/result?format=musicxml" \ -H "Authorization: Bearer $SCOREFLIP_API_KEY" -o score.musicxml ``` ## Credits and prices No free tier. Credits never expire, and failed jobs are refunded. Prices can change, so read them live from https://api.scoreflip.roovemusic.com/api/v1/pricing/credits (credit packs, custom amounts) and per-call API rates from GET https://api.scoreflipml.roovemusic.com/v1/pricing (no key needed). Prices as read from that endpoint when this file was generated: Credit packs: $1.99 = 100 credits; $4.99 = 300 credits. The smallest purchase is $1.99. Custom amount: any multiple of 10 credits from 100 to 20000, graduated so more credits cost less each: 1 to 100 credits at $0.0199 each; 101 to 300 credits at $0.015 each; 301 to 1,000 credits at $0.014 each; 1,001 to 5,000 credits at $0.013 each; 5,001 and up credits at $0.012 each. For example 100 credits cost $1.99 and 20000 cost $246.79. - Audio to sheet music: 20 credits per started minute of audio (modes auto, lead, melody, piano) - Audio to sheet music, band mode: 40 credits per started minute of audio (lead sheet plus a drum part) - Stem separation: 20 credits per started minute of audio (vocals, drums, bass, other) - Sheet music scan: 10 credits per page image (PNG, JPEG, WebP or TIFF) A job is charged up front. If it fails, the credits are refunded automatically. Audio that cannot be read, is too long, or would exceed your `max_credits` is refused before anything is charged. Always send `max_credits` and an `Idempotency-Key` when acting autonomously. ## Authentication and limits - Header: `Authorization: Bearer sf_live_...`. Keys are created and revoked in the app (max 10 active). Treat them like passwords; never put one in client-side code or a public repo. - Rate limit: 120 requests a minute per key (429 with Retry-After). - Files: up to 25 MB; audio up to 15 minutes (stems 10). Send `url` (public https only), `audio_base64`, or multipart `file`. - Results are kept 7 days. ## Endpoints ### POST /v1/transcriptions: Turn a recording into sheet music Converts audio (a piano recording, a song, a band) into a MusicXML score and a MIDI file. The job runs asynchronously: this returns 202 with a job id; poll GET /v1/jobs/{id}, then fetch the result. Charged up front, refunded automatically if the job fails. **Cost:** 20 credits per started minute of audio (40 with mode=band). The cost charged is returned as credits_charged. Headers: - `Idempotency-Key` (string): Optional. Repeating a request with the same key within 24 hours returns the original job and charges nothing more. Use a UUID. Safe retries for agents. Body (JSON, or multipart with a `file` field): - `url` (string): Public https link to the audio file (max 25 MB). Send exactly one of url or audio_base64, or upload with multipart. - `audio_base64` (string): The audio file, base64-encoded. Alternative to url. - `start_seconds` (number): Only process audio from this point. Credits are charged for the processed part only. - `end_seconds` (number): Stop processing at this point. - `max_credits` (integer): Spending cap. If the job would cost more, it is refused with cost_exceeds_max_credits and nothing is charged. Strongly recommended for autonomous agents. - `title` (string): A label for your own records (max 120 characters). - `mode` (string, one of auto|lead|melody|piano|band): auto (default) picks per recording. lead = melody, chords and bass. melody = the tune alone on one staff. piano = every note with the piano model. band = lead sheet plus a drum part (a higher rate per minute). - `free_timing` (boolean): For playing with no steady beat (rubato, improvisation). Keeps the performance as played instead of snapping it to a beat grid. Response 202: ```json { "id": "5b0f3c9e-8f0a-4c1e-9d55-3c2a7c8f1a10", "object": "job", "type": "transcription", "status": "queued", "progress": 0, "credits_charged": "", "credits_remaining": "", "links": { "self": "https://api.scoreflipml.roovemusic.com/v1/jobs/5b0f3c9e-8f0a-4c1e-9d55-3c2a7c8f1a10" } } ``` ### POST /v1/stems: Separate a song into stems Splits a song into vocals, drums, bass and other. Asynchronous, like transcriptions. The result lists a download link for each stem. **Cost:** 20 credits per started minute of audio. Headers: - `Idempotency-Key` (string): Optional. Repeating a request with the same key within 24 hours returns the original job and charges nothing more. Use a UUID. Safe retries for agents. Body (JSON, or multipart with a `file` field): - `url` (string): Public https link to the audio file (max 25 MB). Send exactly one of url or audio_base64, or upload with multipart. - `audio_base64` (string): The audio file, base64-encoded. Alternative to url. - `start_seconds` (number): Only process audio from this point. Credits are charged for the processed part only. - `end_seconds` (number): Stop processing at this point. - `max_credits` (integer): Spending cap. If the job would cost more, it is refused with cost_exceeds_max_credits and nothing is charged. Strongly recommended for autonomous agents. - `title` (string): A label for your own records (max 120 characters). Response 202: ```json { "id": "5b0f3c9e-8f0a-4c1e-9d55-3c2a7c8f1a10", "object": "job", "type": "stems", "status": "queued", "progress": 0, "credits_charged": "", "credits_remaining": "", "links": { "self": "https://api.scoreflipml.roovemusic.com/v1/jobs/5b0f3c9e-8f0a-4c1e-9d55-3c2a7c8f1a10" } } ``` ### POST /v1/scans: Read a photo or scan of sheet music Reads one page of printed sheet music into MusicXML (optical music recognition). One request per page. PDFs are not supported yet; send page images. **Cost:** 10 credits per page image. Headers: - `Idempotency-Key` (string): Optional. Repeating a request with the same key within 24 hours returns the original job and charges nothing more. Use a UUID. Safe retries for agents. Body (JSON, or multipart with a `file` field): - `url` (string): Public https link to a PNG, JPEG, WebP or TIFF image (max 25 MB). Send exactly one of url or image_base64, or upload with multipart. - `image_base64` (string): The image, base64-encoded. Alternative to url. - `max_credits` (integer): Spending cap (see transcriptions). - `title` (string): A label for your own records. Response 202: ```json { "id": "5b0f3c9e-8f0a-4c1e-9d55-3c2a7c8f1a10", "object": "job", "type": "scan", "status": "queued", "progress": 0, "credits_charged": "", "credits_remaining": "", "links": { "self": "https://api.scoreflipml.roovemusic.com/v1/jobs/5b0f3c9e-8f0a-4c1e-9d55-3c2a7c8f1a10" } } ``` ### GET /v1/jobs/{id}: Check a job Returns the job's status: queued, processing, done or failed. Poll every 2 to 5 seconds. A typical 3-minute transcription takes 30 to 90 seconds. A failed job has already been refunded. Response 200: ```json { "id": "5b0f3c9e-8f0a-4c1e-9d55-3c2a7c8f1a10", "object": "job", "type": "transcription", "status": "done", "progress": 100, "credits_charged": "", "created_at": "2026-11-26T10:15:00Z", "expires_at": "2026-12-03T10:15:00Z", "result": { "url": "https://api.scoreflipml.roovemusic.com/v1/jobs/5b0f3c9e-8f0a-4c1e-9d55-3c2a7c8f1a10/result", "formats": [ "musicxml", "midi", "json" ], "expires_at": "2026-12-03T10:15:00Z" } } ``` ### GET /v1/jobs/{id}/result: Download a finished result Returns the result of a done job in the format you ask for. musicxml and midi return the file itself (content types application/vnd.recordare.musicxml+xml and audio/midi). json returns everything the job produced, including tempo, key and time signature. Query: - `format` (string, one of musicxml|midi|json): Default json. Transcriptions support all three, scans support musicxml and json, stems support json (which holds the stem download links). Response 200: ```json { "midi": "", "musicXml": "", "key_id": "a1b2c3d4e5f6", "buy_url": "https://www.roovemusic.com/scoreflip/developers/console" } ``` ### GET /v1/pricing: Read live per-call rates Current credit rates per call, and a link (purchase_pricing_url) to the credit pack and custom-amount prices at https://api.scoreflip.roovemusic.com/api/v1/pricing/credits. No API key needed, so an agent can quote costs before an account exists. No API key required. Response 200: ```json { "object": "pricing", "free_tier": false, "rates": { "transcription": { "credits": 20, "per": "started minute of audio" }, "stems": { "credits": 20, "per": "started minute of audio" }, "scan": { "credits": 10, "per": "page image" } }, "purchase_pricing_url": "https://api.scoreflip.roovemusic.com/api/v1/pricing/credits" } ``` ## Examples ### Python ```python import os, time, uuid, requests API = "https://api.scoreflipml.roovemusic.com" H = {"Authorization": f"Bearer {os.environ['SCOREFLIP_API_KEY']}"} job = requests.post(f"{API}/v1/transcriptions", headers={**H, "Idempotency-Key": str(uuid.uuid4())}, json={"url": "https://example.com/my-recording.mp3", "max_credits": 200}) job.raise_for_status() job = job.json() print("charged", job["credits_charged"], "credits;", job["credits_remaining"], "left") while job["status"] in ("queued", "processing"): time.sleep(3) job = requests.get(f"{API}/v1/jobs/{job['id']}", headers=H).json() if job["status"] == "done": xml = requests.get(f"{API}/v1/jobs/{job['id']}/result", params={"format": "musicxml"}, headers=H) open("score.musicxml", "wb").write(xml.content) else: print("failed (credits refunded):", job["error"]["message"]) ``` ### JavaScript ```javascript const API = "https://api.scoreflipml.roovemusic.com"; const headers = { Authorization: `Bearer ${process.env.SCOREFLIP_API_KEY}` }; let res = await fetch(`${API}/v1/transcriptions`, { method: "POST", headers: { ...headers, "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID() }, body: JSON.stringify({ url: "https://example.com/my-recording.mp3", max_credits: 200 }), }); if (!res.ok) throw new Error((await res.json()).error.message); let job = await res.json(); while (job.status === "queued" || job.status === "processing") { await new Promise((r) => setTimeout(r, 3000)); job = await (await fetch(`${API}/v1/jobs/${job.id}`, { headers })).json(); } if (job.status === "done") { const xml = await fetch(`${API}/v1/jobs/${job.id}/result?format=musicxml`, { headers }); console.log(await xml.text()); } ``` ## MCP server for agents Remote MCP server, Streamable HTTP, stateless: POST JSON-RPC to https://api.scoreflipml.roovemusic.com/mcp. Discovery (initialize, tools/list) needs no key; tools/call needs the API key and spends the same credits. ```json { "mcpServers": { "scoreflip": { "url": "https://api.scoreflipml.roovemusic.com/mcp", "headers": { "Authorization": "Bearer sf_live_YOUR_KEY" } } } } ``` Tools: - `get_pricing`: Current rates, and where to see pack prices. Works without a key. - `get_balance`: Credits left on the key's account. - `transcribe_audio` (spends credits): Audio URL to sheet music (MusicXML + MIDI). Returns a job id. - `split_stems` (spends credits): Audio URL to vocals, drums, bass, other. Returns a job id. - `scan_sheet_music` (spends credits): Image URL of one printed page to MusicXML. Returns a job id. - `get_job`: Status of a job. - `get_result`: The finished result as MusicXML text, base64 MIDI, or JSON. ## Errors Every error is JSON: `{"error": {"code": "...", "message": "..."}}`. - `missing_api_key` (401): No API key was sent. Fix: Send Authorization: Bearer sf_live_... - `invalid_api_key` (401): The key is malformed, unknown, revoked, or its account is suspended. Fix: Create a new key in the ScoreFlip app (Settings, Developer API). - `rate_limited` (429): More than 120 requests a minute on one key, or too many failed authentication attempts. Fix: Wait for the Retry-After header (seconds), then retry. - `insufficient_credits` (402): The account has fewer bought credits than the job costs. Nothing was charged. Fix: Buy credits in the ScoreFlip app (Settings, Developer API). The error carries credits_required, credits_available and buy_url. - `cost_exceeds_max_credits` (422): The job costs more than the max_credits you set. Nothing was charged. Fix: Raise max_credits or send less audio. - `invalid_request` (400): The body is not valid for this endpoint (wrong type, unknown field, both url and base64, and so on). Fix: Read the message; it names the problem. - `invalid_mode` (400): mode is not one of auto, lead, melody, piano, band. Fix: Use a listed mode. - `invalid_idempotency_key` (400): Idempotency-Key is longer than 128 characters. Fix: Use a shorter key such as a UUID. - `missing_file` (400): A multipart request had no 'file' field. Fix: Send the file in a field named file. - `format_unavailable` (400): That result format does not exist for this job type. Fix: Use one of the formats the job's result.formats lists. - `not_found` (404): No such job, or it belongs to another account. Fix: Check the id. - `method_not_allowed` (405): Wrong HTTP method for the path. Fix: See the endpoint list. - `job_not_ready` (409): You asked for a result before the job finished. Fix: Poll GET /v1/jobs/{id} until status is done. - `job_failed` (409): The job failed. Its credits were refunded automatically. Fix: Check the job's error message; resubmit if it was transient. - `idempotency_in_progress` (409): A request with the same Idempotency-Key is still being processed. Fix: Retry in a few seconds. - `result_expired` (410): The result is older than 7 days and is no longer stored. Fix: Download results promptly; resubmit if needed. - `file_too_large` (413): The file is over 25 MB. Fix: Trim it, or send part of the audio with start_seconds and end_seconds. - `unsupported_media_type` (415): Content-Type is not application/json or multipart/form-data. Fix: Use JSON or multipart. - `url_unusable` (422): The url could not be fetched: not public https, blocked address, error response, or too large. Fix: Use a public https link, or upload the file directly. - `unreadable_audio` (422): The audio could not be decoded. Nothing was charged. Fix: Send MP3, WAV, M4A, FLAC or OGG. - `audio_too_long` (422): The audio is over the per-job limit (15 minutes for transcription, 10 for stems). Nothing was charged. Fix: Send part of it using start_seconds and end_seconds. - `unsupported_file` (422): For scans: PDFs are not supported yet. Fix: Send each page as an image. - `idempotency_key_reuse` (422): That Idempotency-Key was already used with a different request. Fix: Use a new key for a different request. - `internal` (500): Something went wrong on our side. You were not charged. Fix: Retry. - `result_unavailable` (502): The result could not be read right now. Fix: Retry shortly. - `unavailable` (503): A dependency is briefly unavailable. Nothing was charged. Fix: Retry with backoff. ## FAQ **Is there a free tier for the ScoreFlip API?** No. The API is paid with credits from the first request. The smallest purchase is $1.99. Credits never expire. Current prices are always at https://api.scoreflip.roovemusic.com/api/v1/pricing/credits. **How do I pay for API credits?** Sign in to the ScoreFlip app, open Settings and choose Developer API. Pick a credit pack or enter any custom number of credits (100 to 20,000) and pay by card (Paddle or Flutterwave, chosen automatically, with bank transfer where Flutterwave offers it) or crypto where available. Credits appear within seconds. There is no subscription. **What does an API call cost?** Credits are charged per started minute of audio for audio to sheet music and stem separation, and per page for scanning sheet music. The exact rates are listed on the credits and pricing page and returned live by GET /v1/pricing. The cost of each job is returned as credits_charged. **What happens if a job fails?** Credits are refunded automatically and the job status becomes failed with a message. Audio the service cannot read, and files over the limits, are refused before anything is charged. **Can an AI agent use ScoreFlip?** Yes. ScoreFlip publishes an OpenAPI 3.1 spec, an llms.txt and llms-full.txt, and a remote MCP server at /mcp, so agents in Claude, Cursor, ChatGPT-style clients and custom frameworks can transcribe audio, split stems and scan sheet music as tools. Spending is capped per call with max_credits. **What formats do I get back?** MusicXML (opens in MuseScore, Finale, Sibelius, Dorico) and MIDI for transcriptions, MusicXML for scans, and stem download links for stem separation. A JSON result adds tempo, key and time signature. **How long are results stored?** 7 days. Download what you need; after that the result is gone and you would resubmit the job. **Is it secure?** Keys are 256-bit random values stored only as hashes, shown once, revocable instantly, and limited to 120 requests a minute each. URLs you submit are fetched only from public https addresses. Billing fails closed: a request that cannot be charged is refused.