Skip to main content

Error Reference

This page documents the error responses returned by the thig.ai API, including HTTP status codes, application-specific error codes, and troubleshooting tips.

Error Response Format

All API errors return a JSON body with a human-readable message and an optional error code:
{
  "error": "Human-readable error message",
  "code": "ERROR_CODE"
}
The error field is always present. The code field is included when a specific application error code applies. Some endpoints may include additional fields such as details for validation errors.

HTTP Status Codes

CodeMeaningCommon Cause
200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestInvalid input, missing required fields, or malformed JSON
401UnauthorizedMissing or invalid session cookie / API key
403ForbiddenInsufficient role permissions or feature not enabled for your plan
404Not FoundResource does not exist or belongs to a different organization
409ConflictDuplicate resource (e.g., a version with that number already exists)
422Unprocessable EntityRequest body failed schema validation
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server-side error

Error Codes

CodeHTTP StatusDescriptionResolution
UNAUTHORIZED401Missing or invalid session or API keyLog in again or verify your API key is correct
FORBIDDEN403Insufficient role permissions for this actionContact your organization admin for elevated access
RATE_LIMITED429Too many requests in a short periodWait and retry with exponential backoff
VALIDATION_ERROR400Request body failed schema validationCheck required fields, types, and formats against the API Reference
FEATURE_DISABLED403Feature flag not enabled for your planUpgrade your plan or contact support
GENERATION_ERROR500AI provider failed to generate contentRetry the request; if the error persists, try switching to a different AI provider
USAGE_LIMIT_EXCEEDED403Monthly usage quota reached for your planUpgrade your plan or wait for your usage to reset at the next billing cycle
PROVIDER_ERROR502Upstream AI provider returned an errorTry a different AI provider or retry after a brief wait
NOT_FOUND404The requested resource does not existVerify the resource ID and that it belongs to your organization
DUPLICATE409A resource with that identifier already existsUse a different name, key, or version number

SSE Error Events

Streaming endpoints (such as Chat and PRD generation) use Server-Sent Events (SSE) to deliver responses incrementally. When an error occurs during streaming, it is sent as an SSE event rather than an HTTP error status:
data: {"type": "error", "message": "Generation failed", "code": "GENERATION_ERROR"}
Validation errors caught before streaming begins are also delivered as SSE events with the code VALIDATION_ERROR:
data: {"type": "error", "message": "Project ID is required", "code": "VALIDATION_ERROR"}
Your client should listen for events where type is "error" and handle them appropriately — for example, by displaying the message to the user and closing the connection.

Rate Limits

thig.ai uses a dual rate limiting system to protect the platform and ensure fair usage:
  • Tier-based limits — Based on your subscription plan (Free, Pro, Business, Enterprise). These govern monthly AI token usage, project counts, and other resource quotas. See Billing for plan details.
  • Endpoint-based limits — Anti-abuse limits applied per endpoint and per IP address. These prevent excessive request volumes regardless of plan tier.
When you exceed a rate limit, the API returns a 429 status with the RATE_LIMITED error code.
Check the Retry-After header in 429 responses. It indicates how many seconds to wait before retrying. Implement exponential backoff in your integration to handle rate limits gracefully.

Troubleshooting Tips

Common issues and how to resolve them:
  • “401 Unauthorized” on every request — Your session has likely expired. Log out and log back in, or generate a fresh API key from Settings > API Keys.
  • “403 Feature disabled” — The feature you are trying to use is not enabled for your current plan. Check your plan limits and upgrade if needed.
  • “429 Rate limited” — You are sending too many requests. Implement exponential backoff and respect the Retry-After header. Consider batching requests where possible.
  • “500 on AI endpoints” — The AI provider may be experiencing issues. Try switching to a different provider in your project settings or BYOK configuration.
  • “Empty response from AI” — The conversation or PRD content may be too short for the AI to analyze meaningfully. Add more context to your conversation before generating.
  • “Export fails” — Ensure the project has a generated PRD before attempting to export. If exporting to Notion or Google Docs, verify that the integration is connected.
  • “404 on a resource you just created” — The resource may belong to a different organization context. Verify you are authenticated as a member of the correct organization.
  • “409 Conflict on version creation” — A PRD version with that number already exists. The system auto-increments version numbers, but manual creation may cause conflicts. Use the next available version number.