Skip to Content
API referenceError codes

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 }
FieldTypeDescription
successbooleanAlways false for errors
messagestringHuman-readable description of the error
errorstringMachine-readable error code
statusCodenumberHTTP 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 Authorization header
  • 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" }
ErrorDescription
Connection refusedTarget API is unreachable
TimeoutExecution exceeded the configured timeout
Invalid responseTarget API returned unparseable data
Sandbox errorJavaScript tool threw an exception
LLM errorLLM provider returned an error

Models and credentials codes

The Models API and Credentials API use the same envelope with these codes:

CodeStatusMeaning
NO_ROUTE400No model card satisfies the routing policy; the response lists every rejected card with a reason
ROUTE_EXHAUSTEDprovider’sEvery route candidate failed for a provider-side reason; the response lists what was tried
ROUTING_UNAVAILABLE400A routing policy was sent but the catalog module is not wired into this installation
MODEL_NOT_FOUND400The provider does not serve the configured model; the card is marked failed
MODEL_NOT_ALLOWED400The call named a model its connection does not offer (unticked on the connection); nothing was sent to the provider
MODEL_IN_USE409A 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_CALLABLE400A card needs a providerId or an endpointRef.url
MODEL_EXISTS400A card for that provider and vendor id (or that name, for an endpoint) already exists; the message carries its id
MODEL_REQUIRED400POST /model-deployments named neither model nor modelVersionId
REGISTRY_NOT_CONNECTED400The 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_USE409A model on your cloud account that is not shut down still references the version
ADAPTER_UNKNOWN400providerType names no registered adapter
ADAPTER_UNSUPPORTED_SOURCE400The model’s scheme is not one this adapter reads; the response’s accepts array lists what is
ADAPTER_UNSUPPORTED_ARCHITECTURE400The adapter declares a fixed set of architectures and the model’s base isn’t one of them
ADAPTER_UNSUPPORTED_OPERATION400The adapter cannot do this at all (deploy, scale or teardown through custom-endpoint; more than one replica per VM)
ADAPTER_AUTH401The cloud rejected the credential for a model on your cloud account
ADAPTER_ERRORprovider’sThe provider refused the request; lastError on the /model-deployments row carries its message
CONNECTION_VALIDATION_FAILED422The provider rejected the credential; the connection is kept with health failed
USER_CONNECTIONS_DISABLED403Personal connections are off for this organization
CONNECTIONS_PERMISSION_REQUIRED403The action needs connections:manage
CONNECT_STATE_INVALID400The sign-in state is unknown, used, or older than 10 minutes
CONNECT_EXCHANGE_FAILED, CONNECT_DENIED400The provider refused the code exchange, or the user declined
CONNECTOR_UNKNOWN, CONNECTOR_KEY_TAKEN, CONNECTOR_INVALID404, 409, 400Unknown connector key; a custom key that shadows a built-in one; a definition that fails validation
CONNECTION_NOT_GRANTED403The 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_OWNED403, 404, 404, 403, 403The 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']}")