Error codes
Detailed descriptions of API error codes.
Quick reference
400means the request shape or values are invalid.401usually means the API key is missing or invalid.402with"Insufficient credits remaining"means the workspace is out of credits.403on/archiveusually means thegammaIdis a web app URL slug instead of the API file ID.403onDELETE /gammas/{gammaId}means the API key owner is not a workspace admin.403onGET /gammas/{gammaId}/analytics,/analytics/cards, or/analytics/viewersmeans the API key owner lacks at least edit permission on the Gamma.404on generation polling usually means thegenerationIdis wrong or unavailable.429means you should slow down and retry later.
Example error response
{
"message": "Invalid API key.",
"statusCode": 401
}Error Code Reference
400
Input validation errors
Invalid parameters detected. Check the error details for specific parameter requirements.
401
Invalid API key
The provided API key is invalid or not associated with an eligible account.
402
Insufficient credits remaining
Your workspace does not have enough credits. Purchase more at gamma.app/settings/billing or enable auto-recharge.
403
Forbidden
Access denied. You do not have permission for this resource, or the requested feature is not available on your plan.
403
Access denied. You must have edit permission to archive this gamma.
The gammaId is wrong (web app URL slug instead of API file ID), the Gamma is not in the API key's workspace, or the key owner lacks edit permission.
403
Access denied - workspace admin role required
DELETE /gammas/{gammaId} requires a workspace admin role on the API key's workspace.
404
Generation ID not found. generationId: xxxxxx
The specified generation ID could not be located. Check and correct your generation ID.
429
Too many requests
Too many requests have been made. Retry after the rate limit period.
500
An error occurred while generating the gamma.
An unexpected error occurred while generating the gamma. Contact support with the x-request-id header for troubleshooting assistance.
502
Bad gateway
The request could not be processed due to a temporary gateway issue. Try again.
Troubleshooting Tips
400 - Input validation errors
Check that all required fields are present (
inputTextorpagesforPOST /generations;promptandgammaIdforPOST /generations/from-template;exportAsforPOST /gammas/{gammaId}/export)Verify enum values match exactly (e.g.,
presentationnotPresentation)Ensure
inputTextis between 1 and 400,000 charactersCheck that
numCardsis within your plan’s limits
Related
Warnings for non-fatal response warnings
Poll for results if your error happens during generation status checks
Get Help if you need support escalation
401 - Invalid API key
Verify your API key starts with
sk-gamma-Check that the key hasn’t been revoked
Ensure the header is
X-API-KEY(case-sensitive)
403 - Archive access denied
Verify you are using the
gammaIdfrom the generation poll response, not the slug from the web app URL.The API file ID typically starts with
g_. The URL slug (e.g.bc7s74ruzod20f4) will not work.Confirm the Gamma belongs to the same workspace as the API key.
Check that the API key owner has edit permission on the Gamma.
402 - Insufficient credits
Check
credits.remainingoncompletedandfailedpoll responses to monitor your balanceEnable auto-recharge to avoid interruptions
In automated workflows, check the remaining balance after each completed generation before starting another
Last updated
Was this helpful?