API reference

Errors and limits

The error format deepflock uses, every error code, and how rate limits work.

Error format

Errors use the same shape as OpenAI, so SDKs raise their usual exceptions:

JSON
{
  "error": {
    "message": "Invalid or missing API key.",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}
FieldMeaning
messageA sentence for humans. It may change; do not match on it.
typeThe broad kind of error.
codeA short, stable code for your code to check. Some 400 errors have no code (null).

Error codes

StatusTypeCodeMeaning
400invalid_request_errornullThe body is not JSON, or messages is missing or empty.
400invalid_request_errorunsupported_parameterA field we do not support, for example n other than 1, or tools.
400invalid_request_errorcontext_length_exceededThe prompt is longer than the model allows.
401authentication_errorinvalid_api_keyMissing, wrong or deleted key.
402insufficient_quotainsufficient_fundsYour balance cannot cover the reservation (prompt + max_tokens).
402insufficient_quotakey_limitThis key has reached its spending limit.
403permission_errormodel_not_allowedYour key is not allowed to use this model.
404invalid_request_errormodel_not_foundThe model id does not exist or is not available.
404invalid_request_errornot_foundUnknown endpoint.
429rate_limit_errorrate_limit_exceededToo many requests for this key. Sent with Retry-After.
502server_errorflock_failedThe flock failed while answering and no other flock could take over.
503server_errorno_capacityNo flock is free for this model right now. Sent with Retry-After.

If a flock fails after a streamed answer has started, the stream carries one last event with an error object (code flock_failed) instead of a normal finish.

What to do

StatusRetry?
400, 401, 403, 404No. Fix the request, the model id or the key.
402No. Add credit, raise the key's limit or lower max_tokens.
429Yes, after the number of seconds in the Retry-After header.
502Yes, with back-off: 1 s, 2 s, 4 s.
503Yes, after the number of seconds in the Retry-After header.

Rate limits

Each key has a requests-per-minute limit (60 by default). GET /v1/me shows it as rpm. Over the limit you get 429 with a Retry-After header that says how many seconds to wait.

A flock has a fixed number of Macs, so it can only serve so many requests at once. When every flock for a model is busy, you get 503 with the code no_capacity and a short Retry-After, rather than a long wait.

Speed

A flock is a row of Macs in different homes. Each answer has to travel the whole row for every word, so speed depends on the trips between Macs. The only numbers we publish are measured ones, with their setup. See Our acceleration for the measured table. Long prompts are the slowest part of a flock.

View as MarkdownUpdated 2026-12-01