Skip to content

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 error and error_description.
  • File operations answer some errors with {"detail": ...}, and a code, when there is one, is in detail.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:

StatusCodeMeaningWhat to do
401unauthorizedNo access token was sent.Send the access token in the Authorization header.
401invalid_tokenThe access token is expired or invalid.Exchange your credential for a new access token.
401credential_revokedThe credential behind the token was revoked.Create a new credential.
403not_publicThe endpoint is not part of the public API.Use an operation from the API reference.
403insufficient_scopeThe token lacks a scope. The WWW-Authenticate header names it.Add the scope, then exchange again.
403organization_mismatchThe token is pinned to another organization.Use a token for that organization.
403organization_requiredA file operation was called with a token pinned to no organization.Pin the credential, or pass organization_id at exchange.
429rate_limitedThe credential used up this minute’s requests.Wait for Retry-After seconds.
503revocation_unavailableBiocompile could not check whether the credential is revoked.Retry after Retry-After seconds.
503rate_limit_unavailableThe rate limit could not be checked.Retry after Retry-After seconds.

Request errors

After the access checks, the operation itself can refuse the request:

StatusCodeMeaning
400bad_requestThe request is malformed.
400invalid_cursorThe cursor is not one the API returned.
403forbiddenYour own permissions do not allow this, whatever the token’s scopes. This includes an organization you are not a member of.
404not_foundThe resource does not exist, or you cannot see it.
405method_not_allowedThe method is not supported on this path.
409conflictThe request conflicts with the resource’s current state.
413payload_too_largeThe request body is larger than 1 MiB. Upload files separately and pass their IDs.
415unsupported_media_typeThe body is not JSON.
422validation.failedOne 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:

StatusRetry
401 unauthorized or invalid_tokenOnce, after exchanging for a new access token
401 credential_revokedNever
400, 403, 404, 405, 409, 413, 415 and 422Never without changing the request
429After Retry-After seconds
503 and other 5xxAfter 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:

HeaderMeaning
RateLimit-LimitRequests allowed per minute
RateLimit-RemainingRequests left in this minute
RateLimit-ResetSeconds until the budget resets

A few habits keep a script under the limit:

  • Slow down before RateLimit-Remaining reaches 0.
  • Fetch larger pages with limit instead 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.

Controller: Biocompile, Inc.

Your first project starts here.

Free to start, with credits included.

We use this address to prefill your signup. A founder may email you once to help you get started. No newsletter. Privacy Policy

Already have an account? Sign in