Error codes
When a program’s call to almyty fails, the answer says why in a fixed format: a status number (such as 404 for “not found”) and a message. This page lists those answers and what to do about each, for developers handling errors in their own code. For example, a 401 means the key is missing or wrong, so the script should stop and ask for a new one. If you only use the app, you can skip this page; the app shows the same messages in plain words.
All almyty API errors follow a consistent format with HTTP status codes and structured error responses.
Error response format
{
"success": false,
"message": "Human-readable error description",
"error": "ERROR_CODE",
"statusCode": 400
}| Field | Type | Description |
|---|---|---|
success | boolean | Always false for errors |
message | string | Human-readable description of the error |
error | string | Machine-readable error code |
statusCode | number | HTTP status code |
HTTP status codes
400 Bad Request
The request is malformed or contains invalid data.
{
"success": false,
"message": "Validation failed: name is required",
"error": "BAD_REQUEST",
"statusCode": 400
}Common causes:
- Missing required fields
- Invalid field types (string where number expected)
- Failed schema validation
- Malformed JSON body
401 Unauthorized
Authentication is missing or invalid.
{
"success": false,
"message": "Invalid or expired token",
"error": "UNAUTHORIZED",
"statusCode": 401
}Common causes:
- Missing
Authorizationheader - Expired JWT token
- Invalid token format
- Revoked API key
403 Forbidden
The authenticated user does not have permission for this operation.
{
"success": false,
"message": "Insufficient permissions: requires admin role",
"error": "FORBIDDEN",
"statusCode": 403
}Common causes:
- User role lacks required permissions
- Attempting to access another organization’s resources
- Operation restricted to organization admins
404 Not Found
The requested resource does not exist.
{
"success": false,
"message": "Agent not found",
"error": "NOT_FOUND",
"statusCode": 404
}Common causes:
- Invalid resource ID
- Resource was deleted
- Wrong organization context
409 Conflict
The request conflicts with the current state.
{
"success": false,
"message": "Gateway with endpoint '/my-tools' already exists",
"error": "CONFLICT",
"statusCode": 409
}Common causes:
- Duplicate unique fields (name, endpoint, email)
- Concurrent modification conflicts
422 Unprocessable Entity
The request is well-formed but contains semantic errors.
{
"success": false,
"message": "Pipeline validation failed",
"error": "VALIDATION_ERROR",
"statusCode": 422,
"errors": [
{ "nodeId": "llm_1", "field": "providerId", "message": "Provider not found" }
]
}Common causes:
- Pipeline validation failures
- Invalid schema references
- Business logic violations
429 Too Many Requests
Rate limit exceeded.
{
"success": false,
"message": "Rate limit exceeded. Retry after 30 seconds.",
"error": "RATE_LIMITED",
"statusCode": 429
}The response includes a Retry-After header indicating when to retry.
500 Internal Server Error
An unexpected error occurred on the server.
{
"success": false,
"message": "An unexpected error occurred",
"error": "INTERNAL_ERROR",
"statusCode": 500
}If you encounter 500 errors consistently, contact support with the request details and timestamp.
502 Bad Gateway
The backend service is temporarily unavailable.
503 Service Unavailable
The service is undergoing maintenance or is overloaded.
Tool execution errors
Tool executions return errors in a tool-specific format:
{
"success": false,
"error": "Tool execution failed: Connection refused",
"duration": 5001,
"status": "error"
}| Error | Description |
|---|---|
| Connection refused | Target API is unreachable |
| Timeout | Execution exceeded the configured timeout |
| Invalid response | Target API returned unparseable data |
| Sandbox error | JavaScript tool threw an exception |
| LLM error | LLM provider returned an error |
Models and credentials codes
The Models API and Credentials API use the same envelope with these codes:
| Code | Status | Meaning |
|---|---|---|
NO_ROUTE | 400 | No model card satisfies the routing policy; the response lists every rejected card with a reason |
ROUTE_EXHAUSTED | provider’s | Every route candidate failed for a provider-side reason; the response lists what was tried |
ROUTING_UNAVAILABLE | 400 | A routing policy was sent but the catalog module is not wired into this installation |
MODEL_NOT_FOUND | 400 | The provider does not serve the configured model; the card is marked failed |
MODEL_NOT_ALLOWED | 400 | The call named a model its connection does not offer (unticked on the connection); nothing was sent to the provider |
MODEL_IN_USE | 409 | A change to which models a connection offers would take away a model an agent uses; the body names the models and the agents |
MODEL_NOT_CALLABLE | 400 | A card needs a providerId or an endpointRef.url |
MODEL_EXISTS | 400 | A card for that provider and vendor id (or that name, for an endpoint) already exists; the message carries its id |
MODEL_REQUIRED | 400 | POST /model-deployments named neither model nor modelVersionId |
REGISTRY_NOT_CONNECTED | 400 | The organization has no bucket (registry) connection; only reachable by an s3:// source, and only for the adapters that read one directly (aws-bedrock-import, sagemaker, fireworks, baseten) |
VERSION_IN_USE | 409 | A model on your cloud account that is not shut down still references the version |
ADAPTER_UNKNOWN | 400 | providerType names no registered adapter |
ADAPTER_UNSUPPORTED_SOURCE | 400 | The model’s scheme is not one this adapter reads; the response’s accepts array lists what is |
ADAPTER_UNSUPPORTED_ARCHITECTURE | 400 | The adapter declares a fixed set of architectures and the model’s base isn’t one of them |
ADAPTER_UNSUPPORTED_OPERATION | 400 | The adapter cannot do this at all (deploy, scale or teardown through custom-endpoint; more than one replica per VM) |
ADAPTER_AUTH | 401 | The cloud rejected the credential for a model on your cloud account |
ADAPTER_ERROR | provider’s | The provider refused the request; lastError on the /model-deployments row carries its message |
CONNECTION_VALIDATION_FAILED | 422 | The provider rejected the credential; the connection is kept with health failed |
USER_CONNECTIONS_DISABLED | 403 | Personal connections are off for this organization |
CONNECTIONS_PERMISSION_REQUIRED | 403 | The action needs connections:manage |
CONNECT_STATE_INVALID | 400 | The sign-in state is unknown, used, or older than 10 minutes |
CONNECT_EXCHANGE_FAILED, CONNECT_DENIED | 400 | The provider refused the code exchange, or the user declined |
CONNECTOR_UNKNOWN, CONNECTOR_KEY_TAKEN, CONNECTOR_INVALID | 404, 409, 400 | Unknown connector key; a custom key that shadows a built-in one; a definition that fails validation |
CONNECTION_NOT_GRANTED | 403 | The run’s principal has no way to use this connection; reason says which rule refused |
CONNECTION_GRANT_FORBIDDEN, GRANT_NOT_FOUND, GRANT_PRINCIPAL_NOT_FOUND, GRANT_AGENT_NOT_OWNED, GRANT_WORKSPACE_NOT_OWNED | 403, 404, 404, 403, 403 | The caller may not manage grants on this connection; the grant or the principal does not exist; the agent or workspace is not the caller’s |
Handling errors in code
JavaScript
try {
const response = await fetch("https://api.almyty.com/agents", {
headers: { Authorization: `Bearer ${token}` },
});
if (!response.ok) {
const error = await response.json();
console.error(`Error ${error.statusCode}: ${error.message}`);
if (response.status === 401) {
// Redirect to login
} else if (response.status === 429) {
const retryAfter = response.headers.get("Retry-After");
// Wait and retry
}
}
} catch (networkError) {
console.error("Network error:", networkError);
}Python
import requests
response = requests.get(
"https://api.almyty.com/agents",
headers={"Authorization": f"Bearer {token}"}
)
if not response.ok:
error = response.json()
print(f"Error {error['statusCode']}: {error['message']}")