Errors

Every error has the same shape. Branch on code, show message to humans.

{
  "error": {
    "code": "insufficient_credits",
    "message": "This job needs 60 credits and the account has 10. Buy credits at https://www.roovemusic.com/scoreflip/developers/console.",
    "credits_required": 60,
    "credits_available": 10,
    "buy_url": "https://www.roovemusic.com/scoreflip/developers/console"
  }
}

Retrying

  • 429 and 5xx: retry with exponential backoff, honouring Retry-After. Use an Idempotency-Key so a retried POST is never charged twice.
  • 402: do not retry. Buy credits first.
  • 4xx other than 429: the request itself needs to change.
  • Anything that fails before a job starts has charged nothing. A job that fails later is refunded automatically.

All error codes

CodeHTTPMeaningWhat to do
missing_api_key401No API key was sent.Send Authorization: Bearer sf_live_...
invalid_api_key401The key is malformed, unknown, revoked, or its account is suspended.Create a new key in the ScoreFlip app (Settings, Developer API).
rate_limited429More than 120 requests a minute on one key, or too many failed authentication attempts.Wait for the Retry-After header (seconds), then retry.
insufficient_credits402The account has fewer bought credits than the job costs. Nothing was charged.Buy credits in the ScoreFlip app (Settings, Developer API). The error carries credits_required, credits_available and buy_url.
cost_exceeds_max_credits422The job costs more than the max_credits you set. Nothing was charged.Raise max_credits or send less audio.
invalid_request400The body is not valid for this endpoint (wrong type, unknown field, both url and base64, and so on).Read the message; it names the problem.
invalid_mode400mode is not one of auto, lead, melody, piano, band.Use a listed mode.
invalid_idempotency_key400Idempotency-Key is longer than 128 characters.Use a shorter key such as a UUID.
missing_file400A multipart request had no 'file' field.Send the file in a field named file.
format_unavailable400That result format does not exist for this job type.Use one of the formats the job's result.formats lists.
not_found404No such job, or it belongs to another account.Check the id.
method_not_allowed405Wrong HTTP method for the path.See the endpoint list.
job_not_ready409You asked for a result before the job finished.Poll GET /v1/jobs/{id} until status is done.
job_failed409The job failed. Its credits were refunded automatically.Check the job's error message; resubmit if it was transient.
idempotency_in_progress409A request with the same Idempotency-Key is still being processed.Retry in a few seconds.
result_expired410The result is older than 7 days and is no longer stored.Download results promptly; resubmit if needed.
file_too_large413The file is over 25 MB.Trim it, or send part of the audio with start_seconds and end_seconds.
unsupported_media_type415Content-Type is not application/json or multipart/form-data.Use JSON or multipart.
url_unusable422The url could not be fetched: not public https, blocked address, error response, or too large.Use a public https link, or upload the file directly.
unreadable_audio422The audio could not be decoded. Nothing was charged.Send MP3, WAV, M4A, FLAC or OGG.
audio_too_long422The audio is over the per-job limit (15 minutes for transcription, 10 for stems). Nothing was charged.Send part of it using start_seconds and end_seconds.
unsupported_file422For scans: PDFs are not supported yet.Send each page as an image.
idempotency_key_reuse422That Idempotency-Key was already used with a different request.Use a new key for a different request.
internal500Something went wrong on our side. You were not charged.Retry.
result_unavailable502The result could not be read right now.Retry shortly.
unavailable503A dependency is briefly unavailable. Nothing was charged.Retry with backoff.