Page options
Biocompile API errors, retries and rate limits
Last updated
On this page
The Biocompile API reports every error with a standard HTTP status and a JSON body that names
a stable code. Write your error handling against the code, not against the human-readable
text, which may change. Each credential may make 600 requests a minute, and the response
headers say how many are left.
Error responses
Errors are problem documents, sent as application/problem+json:
{
"type": "https://docs.biocompile.com/errors/insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "This token lacks the scope(s): runs:execute.",
"instance": "/api/v1/organizations/<organization id>/executables/<executable id>/invoke"
}
code is the field to rely on. detail explains the error to a person, and a validation
error adds errors, with one entry per invalid field.
Two kinds of answer use a different body:
- The token endpoint answers in the OAuth format, with
erroranderror_description. - File operations answer some errors with
{"detail": ...}, and a code, when there is one, is indetail.code.
Messages are in English. Send Accept-Language: de to get them in German. The language you
chose in the app does not apply to API calls.
Access errors
Every call passes the same access checks before it runs:
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 401 | unauthorized | No access token was sent. | Send the access token in the Authorization header. |
| 401 | invalid_token | The access token is expired or invalid. | Exchange your credential for a new access token. |
| 401 | credential_revoked | The credential behind the token was revoked. | Create a new credential. |
| 403 | not_public | The endpoint is not part of the public API. | Use an operation from the API reference. |
| 403 | insufficient_scope | The token lacks a scope. The WWW-Authenticate header names it. | Add the scope, then exchange again. |
| 403 | organization_mismatch | The token is pinned to another organization. | Use a token for that organization. |
| 403 | organization_required | A file operation was called with a token pinned to no organization. | Pin the credential, or pass organization_id at exchange. |
| 429 | rate_limited | The credential used up this minute’s requests. | Wait for Retry-After seconds. |
| 503 | revocation_unavailable | Biocompile could not check whether the credential is revoked. | Retry after Retry-After seconds. |
| 503 | rate_limit_unavailable | The rate limit could not be checked. | Retry after Retry-After seconds. |
Request errors
After the access checks, the operation itself can refuse the request:
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | The request is malformed. |
| 400 | invalid_cursor | The cursor is not one the API returned. |
| 403 | forbidden | Your own permissions do not allow this, whatever the token’s scopes. This includes an organization you are not a member of. |
| 404 | not_found | The resource does not exist, or you cannot see it. |
| 405 | method_not_allowed | The method is not supported on this path. |
| 409 | conflict | The request conflicts with the resource’s current state. |
| 413 | payload_too_large | The request body is larger than 1 MiB. Upload files separately and pass their IDs. |
| 415 | unsupported_media_type | The body is not JSON. |
| 422 | validation.failed | One or more fields are invalid, and errors lists them. |
An operation can return a more specific code of its own, such as project_read_only. Treat a
code you do not know by its status.
When to retry
Retry only the errors that can pass on a second attempt:
| Status | Retry |
|---|---|
401 unauthorized or invalid_token | Once, after exchanging for a new access token |
401 credential_revoked | Never |
| 400, 403, 404, 405, 409, 413, 415 and 422 | Never without changing the request |
| 429 | After Retry-After seconds |
| 503 and other 5xx | After Retry-After seconds, with exponential backoff and a cap on attempts |
When you retry an invocation, send the same idempotency_key in the body every time, so the
work starts once.
Rate limits
Each credential has a budget of 600 requests a minute, which resets at the start of each minute. Every access token exchanged from the same personal access token or service account key shares that budget. Every response carries its current state:
| Header | Meaning |
|---|---|
RateLimit-Limit | Requests allowed per minute |
RateLimit-Remaining | Requests left in this minute |
RateLimit-Reset | Seconds until the budget resets |
A few habits keep a script under the limit:
- Slow down before
RateLimit-Remainingreaches 0. - Fetch larger pages with
limitinstead of many small ones. - Poll Runs and conversation turns no more than every few seconds.
- Give separate jobs separate credentials, so one busy job cannot use up another’s budget.
The token endpoint has its own protection. After 50 failed exchanges from one address in 15
minutes, it answers 429 with slow_down for the rest of that window.
Common questions
What is the Biocompile API rate limit?
600 requests a minute for each credential. All access tokens exchanged from one personal access token or service account key share it.
Should my script retry a 403 error?
No. A 403 means the token lacks a scope, the organization differs, or you lack permission.
Fix the credential or the request first.
Why does the API answer 404 for a project I know exists?
The token cannot see it. Either you cannot open the project in the app, or a service account was not granted it.
Related
Was this page helpful?
Something wrong or missing?