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 anIdempotency-Keyso a retriedPOSTis 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
| Code | HTTP | Meaning | What to do |
|---|---|---|---|
missing_api_key | 401 | No API key was sent. | Send Authorization: Bearer sf_live_... |
invalid_api_key | 401 | The key is malformed, unknown, revoked, or its account is suspended. | 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. | 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. | 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. | 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). | Read the message; it names the problem. |
invalid_mode | 400 | mode is not one of auto, lead, melody, piano, band. | Use a listed mode. |
invalid_idempotency_key | 400 | Idempotency-Key is longer than 128 characters. | Use a shorter key such as a UUID. |
missing_file | 400 | A multipart request had no 'file' field. | Send the file in a field named file. |
format_unavailable | 400 | That result format does not exist for this job type. | Use one of the formats the job's result.formats lists. |
not_found | 404 | No such job, or it belongs to another account. | Check the id. |
method_not_allowed | 405 | Wrong HTTP method for the path. | See the endpoint list. |
job_not_ready | 409 | You asked for a result before the job finished. | Poll GET /v1/jobs/{id} until status is done. |
job_failed | 409 | The job failed. Its credits were refunded automatically. | 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. | Retry in a few seconds. |
result_expired | 410 | The result is older than 7 days and is no longer stored. | Download results promptly; resubmit if needed. |
file_too_large | 413 | The file is over 25 MB. | 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. | Use JSON or multipart. |
url_unusable | 422 | The 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_audio | 422 | The audio could not be decoded. Nothing was charged. | 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. | Send part of it using start_seconds and end_seconds. |
unsupported_file | 422 | For scans: PDFs are not supported yet. | Send each page as an image. |
idempotency_key_reuse | 422 | That Idempotency-Key was already used with a different request. | Use a new key for a different request. |
internal | 500 | Something went wrong on our side. You were not charged. | Retry. |
result_unavailable | 502 | The result could not be read right now. | Retry shortly. |
unavailable | 503 | A dependency is briefly unavailable. Nothing was charged. | Retry with backoff. |