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_REQUESTMalformed JSON, a missing field, or a value outside its allowed range.
401UNAUTHORIZEDMissing or invalid credentials on a protected request.
403FORBIDDENValid credentials without permission for the requested resource.
404*_NOT_FOUNDThe provider, model, or deployment does not exist.
422PRICING_UNAVAILABLEThe deployment exists, but no applicable rate card can produce a quote.
429RATE_LIMIT_EXCEEDEDThe current API quota has been exceeded.
500INTERNAL_ERRORAn unexpected server error occurred.

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. Do not retry validation errors or unavailable pricing without changing the request.