Errors

All non-2xx responses from the WithGiga API use a consistent error envelope.

Error format

{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable explanation of what went wrong",
    "hint": "Optional suggestion for how to fix it",
    "requestId": "uuid-for-support"
  }
}
Include the requestId when contacting support — it lets us trace the exact request in our logs.

Error codes

400 Bad Request

CodeDescription
INVALID_REQUESTThe request body or query parameters are malformed or missing required fields
INVALID_FIELDA specific field value is invalid — check the hint for the field name
UNSUPPORTED_PLATFORMThe requested platform or template does not exist

401 Unauthorized

CodeDescription
UNAUTHORIZEDNo Authorization header, or the API key is missing
INVALID_API_KEYThe API key is malformed or has been revoked

402 Payment Required

CodeDescription
INSUFFICIENT_CREDITSYour credit balance is too low to complete the request — top up at billing

403 Forbidden

CodeDescription
FORBIDDENYour API key does not have permission to access this resource
PLAN_LIMIT_EXCEEDEDThe requested action requires a higher plan tier

404 Not Found

CodeDescription
RESOURCE_NOT_FOUNDThe requested resource (deployment, audit, file, etc.) does not exist or belongs to another account

429 Too Many Requests

CodeDescription
RATE_LIMITEDExceeded 60 requests/minute — check Retry-After header
CONCURRENCY_LIMIT_EXCEEDEDYou’ve reached your plan’s concurrent agent limit

500 Internal Server Error

CodeDescription
INTERNAL_ERRORAn unexpected server-side error — retry with backoff; contact support if persistent
SANDBOX_FAILEDThe E2B sandbox failed to provision — the requestId can help diagnose

Handling errors in code

const res = await fetch("https://api.withgiga.ai/api/deployments/start", {
  method: "POST",
  headers: { Authorization: `Bearer ${apiKey}` },
  body: JSON.stringify({ ... })
});

if (!res.ok) {
  const { error } = await res.json();
  console.error(`[${error.code}] ${error.message}`);
  // handle specific codes
  if (error.code === "INSUFFICIENT_CREDITS") {
    // prompt user to top up
  }
}

Retry guidance

StatusRetry?Notes
400NoFix the request before retrying
401 / 403NoCheck your API key and permissions
402NoAdd credits before retrying
404NoVerify the resource ID
429YesWait for Retry-After seconds
500YesRetry with exponential backoff (1s, 2s, 4s, …)