BeefAPI

Errors and limits

Read the HTTP status first, then the JSON body. Copy the request id from the error message when you ask for help.

Model calls use the error object below. Account endpoints under /api use { "success": false, "message": "..." } instead. Request shapes are in API reference.

Error body

A failed model call returns JSON of this form:

{
  "error": {
    "message": "Invalid token (request id: ...)",
    "type": "new_api_error",
    "code": ""
  }
}

Read error.message, error.type, and error.code. code is a string when the failure has a named reason, such as model_not_found or insufficient_user_quota. It can be empty, as in the missing-key example above. type is often new_api_error or invalid_request_error.

The message includes a request id. Keep that value.

HTTP status

Status Meaning
401 Missing or invalid API key (model calls), or missing system access token (account calls)
403 The credential was accepted, but this request is not allowed
404 The model ID is not in the set available to this key (model_not_found)
429 Too many requests for the current limit
5xx The upstream model call failed or timed out

Insufficient USD credit is a separate failure. Look for insufficient_user_quota in error.code, then add credit on Billing.

401 Unauthorized

Missing or wrong API key:

{
  "error": {
    "message": "Invalid token (request id: ...)",
    "type": "new_api_error",
    "code": ""
  }
}

Check:

  1. The value is the full sk-... key copied from API keys, not typed by hand.
  2. OpenAI-compatible calls send Authorization: Bearer sk-....
  3. Anthropic-compatible calls send x-api-key: sk-... plus anthropic-version.
  4. The OpenAI base URL is https://global.beefapi.com/v1 (with /v1). The Anthropic base URL is https://global.beefapi.com (no /v1).
  5. Shell environment variables still pointing at another provider are not overriding the key or base URL.

Account calls without a system access token return 401 with { "success": false, "message": "Unauthorized, not logged in and no access token provided" }. Those calls also need New-Api-User set to your user ID from Account settings.

403 Forbidden

The key or token was recognized, but the request is not allowed. The account may be blocked, or this key may not be permitted to make that call.

Do not retry a 403 in a tight loop. Confirm the key on API keys, then send one test request.

404 and model_not_found

This is the usual cause: the model string is not in the set available to this API key. A typo has the same result.

{
  "error": {
    "message": "The model \"gpt-5-6-sol\" does not exist or you do not have access to it.",
    "type": "invalid_request_error",
    "code": "model_not_found"
  }
}

Fix:

  1. Copy the model ID from GET /v1/models using that same key. See API reference.
  2. Compare it with the model field you sent. Hyphens, dots, and suffixes must match exactly.
  3. Public prices on Pricing list catalog names. Your key may not include every public name.

429 Too Many Requests

Requests beyond your limit return 429. This is a rate or concurrency limit, not a missing-credit error.

Wait, then retry with backoff. If the response includes Retry-After, wait at least that long. Lower parallel callers in your client and send one request to confirm the path still works.

Insufficient credit

When remaining USD credit cannot cover the request, the body uses code insufficient_user_quota. Add prepaid credit on Billing, then retry.

API keys spend account USD credit. Empty credit fails the request.

Timeouts and 5xx

A long or failed upstream call can return 500, 502, 503, 504, or 524. Treat it as a failed request.

Retry only when sending the same request twice is acceptable. Space retries out (backoff). Do not retry 401, 403, or 404 this way. A completed request that you send again can be charged again.

If timeouts persist, shorten the prompt or switch to a lighter model from GET /v1/models. Current route health is on Status.

Where to look first

Open Usage. Each recorded request shows time, request ID, model, token count, and USD cost.

Compare that row with the request id in the error message. Public prices are on Pricing. Service status is on Status.

Get help

Email [email protected]. Include:

  • The client or SDK you used
  • The model ID
  • The HTTP status
  • The full error JSON, including the request id
  • Whether you called /v1/chat/completions, /v1/responses, /v1/messages, or /api/user/self

Do not send API keys or system access tokens.