Errors

ALLM uses standard HTTP status codes and problem details with stable, machine-readable error codes.

Error shape

Error responses use application/problem+json. Branch on code; use detail for diagnostics, not application logic.

JSON · 404
{
  "type": "https://docs.use-allm.com/errors/deployment-not-found",
  "title": "Deployment not found",
  "status": 404,
  "detail": "The requested deployment does not exist.",
  "code": "DEPLOYMENT_NOT_FOUND"
}

Status codes

StatusCodeWhen it happens
400INVALID_*Malformed JSON, a missing field, or a value outside its allowed range.
401API_KEY_REQUIRED / INVALID_API_KEYMissing, expired, revoked, or unknown project key.
403INSUFFICIENT_SCOPEThe key lacks the endpoint scope.
404*_NOT_FOUNDThe provider, model, or deployment does not exist.
422PRICING_UNAVAILABLE / DECISION_UNAVAILABLEThe request is valid but cannot produce a result.
429QUOTA_EXCEEDEDThe workspace monthly quota has been exceeded.
503API_AUTH_UNAVAILABLEAuthentication or quota storage is temporarily unavailable.

Handle errors

TypeScript
import { ALLM, ALLMError } from "@allm/sdk";

try {
  await allm.pricing.calculate({
    deployment: "dep_missing",
    inputTokens: 1000,
    outputTokens: 100,
  });
} catch (error) {
  if (error instanceof ALLMError) {
    console.error(error.code, error.status, error.requestId);
  }
}

Retry policy

Retry only transport failures, 429, and transient 5xx responses. Use exponential backoff with jitter, honor Retry-After, and cap attempts. A POST is retryable only when the same Idempotency-Key is reused for every attempt. Do not retry validation errors or unavailable pricing without changing the request.