Error codes
Sample error response
{"message":"Invalid API key.", "statusCode":401}
Status Code | Message | Description |
---|---|---|
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 a Pro account. |
404 | Generation ID not found. generationId: xxxxxx | The specified generation ID could not be located. Check and correct your generation ID. |
422 | Failed to generate text. Check your inputs and try again. | Generation produced an empty output. Review your input parameters and ensure your instructions are clear. |
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. |
Warnings
In some cases, we may return warnings in response to a generation request. Warnings are returned if there were conflicting or ignored parameters in your API call. For example, if you specified preserve
in textMode
and at the same time used brief
in textOptions.amount
, Gamma would respect the instruction to preserve your text and would ignore the request for the generated text to be brief. For transparency, the API would return a warning informing you that we ignored the textOptions.amount
parameter.
Some additional scenarios where warnings would be returned are illustrated below.
Conflicting format and dimensions
{
"format": "presentation",
"inputText": "Best hikes in the United States",
"pageOptions": {
"dimensions": "1x1"
}
}
{"generationId":"xxxxxxxxxx","warnings":"cardOptions.dimensions 1x1 is not valid for format presentation. Valid dimensions are: [ 16x9, 4x3, fluid ]. Using default: fluid."}
Conflicting image source and model
{
"format": "presentation",
"inputText": "Best hikes in the United States",
"imageOptions": {
"source": "pictographic",
"model": "flux-1-pro"
}
}
{"generationId":"xxxxxxxxxx","warnings":"imageOptions.model and imageOptions.style are ignored when imageOptions.source is not aiGenerated."}