This section as Markdown: View Download

Error Reference

Understand API error responses, error codes, and how to handle them.

Response Format

When an API request fails, the response includes result: false and an errors array:

{
  "result": false,
  "errors": [
    {
      "code": 97,
      "message": "Insufficient balance"
    }
  ]
}

All API responses return HTTP 200. Use the result field and error code to determine success or failure.

Error Codes

Error codes indicate the category of the problem. Use these for conditional logic in your application.

Code Category Description
0 General Server-side errors, validation failures, missing parameters
1 Not Found / Client Resource not found or not accessible
96 Concurrency Limit Too many concurrent tasks for your balance. See Concurrency Limits
97 Insufficient Balance Not enough funds to run the model
98 Authentication Required Sign in required to access this model
99 Token Invalid Bearer token missing, invalid, or expired

Authentication Errors

Returned when API key or bearer token authentication fails. All return HTTP 401.

Error Code Message
API key not found 0 Project authorization is not founded.
Signature required 0 Project requires signature authentication. x-signature and x-nonce headers are required.
Invalid signature 0 Project authorization is not valid.
IP not allowed 0 Requested ip {ip} is not allowed.
Key creator left the team 0 The person who created this API key is no longer in its team. Ask a team admin for a new key.
Team change with an API key 0 API keys can't manage teams or organizations. Sign in and try again.
Bearer token missing 99 Authorization bearer token is not founded in headers.
Bearer token invalid 99 Authorization bearer token is invalid.
Bearer token expired 99 Authorization bearer token expired.
Endpoint not found 0 Parsing url error. (HTTP 404)

Signature Auth Errors

If your project uses signature-based authentication, ensure all three headers are present and the signature is computed correctly:

x-api-key: YOUR_API_KEY
x-signature: HMAC-SHA256(key=API_KEY, message=API_SECRET + NONCE)
x-nonce: Unix timestamp or random integer

See Authentication for details.

IP Whitelist Errors

If your project has an IP whitelist configured, requests from unlisted IPs will be rejected. Use * in the whitelist to allow all IPs.

Team API Key Errors

A team project's API key works only while the user who created the project is an active member of the team or the organization owner. Once they leave the team, requests with the key fail with "The person who created this API key is no longer in its team." Public endpoints such as Tool/List and Agent/List still answer, as if the request had no key. Switch to a key from a project that an active member created.

Creating, changing, deleting or restoring organizations and teams, managing members and invitations, and moving projects, agents or credit need a signed-in user, in the dashboard or with a Bearer token. With an API key, these calls fail with "API keys can't manage teams or organizations." See Team API Access.

Studio and the Workflow Agent are stricter: the user who created the key's project must be an active member of the team, and being the organization owner is not enough. When that user is the organization owner but not a member of the team, requests to them fail with HTTP 403:

Error Code Message
Not a team member 0 You must be a member of this team to perform this action

Run Errors

Returned by POST /Run/{owner}/{model}.

Balance & Limits

Error Code Message Action
Insufficient balance 97 Insufficient balance Add funds: minimum $0.50 required ($10 for training)
Concurrent task limit 96 You have reached your concurrent task limit. With your current balance of ${balance}, you can run up to {maxConcurrent} tasks at the same time. Add funds to increase your limit. Wait for a task to finish, or add funds. See Concurrency Limits
Sign in required 98 sign in to run this model Model requires a registered account

Validation Errors

Error Code Message
Missing parameter 0 Request parameter [{name}] required
Invalid number 0 Request parameter [{name}] must be integer or float
Out of range 0 Request parameter [{name}] must be between {min} and {max}
File required 0 Request files [{name}] required
Invalid request body 0 Request parameters are invalid.

Model Access Errors

Error Code Message
Model not accessible 1 tool-not-accessible
Model not found 1 slug-owner-project-not-exist
Account suspended 0 Your account has been suspended. Please contact support if you believe this is a mistake.
Permission denied 0 You don't have any permission for this action.
Model blocked by your team 0 This model is not available for your team

Training Model Errors

Error Code Message
Invalid model name 0 Your model name should be contain (A-Z) (0-9) (-) (_) (.)
Reserved name 0 This name is not allowed
Name taken 0 This model name is already in use

Task Errors

Returned by POST /Task/Detail, POST /Task/Cancel, POST /Task/Kill, and POST /Task/InputOutputDelete.

Error Code Message Endpoint
Task not found 0 task-not-founded Detail
Task not found 1 There is no task yet. Cancel
Task not found 0 There is no task yet. Kill, InputOutputDelete
Missing identifier 0 Request parameter [taskid or tasktoken] required Detail
Missing identifier 0 taskid or socketaccesstoken is required Kill
Not cancellable 1 Task is not in a cancellable state. Cancel
Kill failed 1 Task could not be killed: {reason} Kill
Task not completed 0 Task must be completed or cancelled before deleting files InputOutputDelete
Permission denied 0 You don't have any permission for this action. Detail, Cancel

Error Handling

Always check result first, then inspect the code in the errors array:

const data = await response.json();

if (!data.result) {
  const error = data.errors[0];
  switch (error.code) {
    case 96:
      console.log('Concurrent limit — wait for a task to finish');
      break;
    case 97:
      console.log('Insufficient balance — add funds');
      break;
    case 98:
      console.log('Sign in required');
      break;
    default:
      console.log('Error:', error.message);
  }
}

Retry Strategy

Code Retryable Strategy
0 (validation) No Fix the request parameters
0 (server) Yes Retry with exponential backoff
1 No Check model slug or task token
96 Yes Wait for a running task to complete
97 No Add funds, then retry
98 No Sign in or use authenticated credentials
99 No Check your API key or bearer token