AI Text-to-Image API
This API endpoint allows you to generate images using the Stable JustPump AI Text-to-Image model. The service accepts text prompts and returns generated images.
API Endpoint
POST https://ai-image.justpump.pro
Request Format
Headers
Content-Type
application/json
Yes
Request Body
{
"prompt": "string"
}
prompt
string
Yes
Text description of the image you want to generate
Response Format
Success Response
On success, the API returns a PNG image with the following headers:
Status: 200 OK
Content-Type: image/png
Access-Control-Allow-Origin: *
The response body contains the binary image data.
Error Responses
Invalid Method (405)
{
"message": "Please use POST method"
}
Missing Prompt (400)
{
"error": "Missing prompt in request body",
"example": {
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"prompt": "your prompt here"
}
}
}
Server Error (500)
{
"error": "Error generating image",
"message": "Error details..."
}
CORS Support
The API supports Cross-Origin Resource Sharing (CORS) with the following configurations:
Allowed Origins:
*
(all origins)Allowed Methods:
POST, OPTIONS
Allowed Headers:
Content-Type
Max Age: 86400 seconds (24 hours)
Error Handling
The API implements robust error handling for various scenarios:
Invalid HTTP methods
Missing or invalid request body
Missing prompt parameter
Model generation failures
Server-side errors
Best Practices
Prompts
Be specific and detailed in your prompts
Include style descriptions if needed
Keep prompts clear and concise
Error Handling
Always implement proper error handling
Check response status codes
Handle binary image data appropriately
Performance
Consider implementing caching for repeated prompts
Be mindful of request frequency
Handle timeouts gracefully
Limitations
Maximum request body size may be limited
Generation time may vary based on prompt complexity
Support
For API support or to report issues, please contact the development team or create an issue in the repository.
Last updated