craiyon.com APIwww.craiyon.com ↗
Generate AI images from text prompts and search Craiyon's library of existing AI-generated images. Returns base64-encoded image data with metadata.
curl -X POST 'https://api.parse.bot/scraper/a82807dc-7dab-407f-b2e8-dab885cfb875/generate_image' \
-H 'X-API-Key: $PARSE_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "a tree"
}'Generate an AI image from a text prompt. Returns the image as base64-encoded data along with metadata. The image is always generated at auto aspect ratio.
| Param | Type | Description |
|---|---|---|
| model | string | Model to use for generation. Accepted values: auto, art, photo, drawing, none. |
| promptrequired | string | Text description of the image to generate |
| negative_prompt | string | Things to exclude from the generated image |
{
"type": "object",
"fields": {
"image": "object containing id, width, height, content_type, base64_data, and categories",
"model": "string - the model used",
"prompt": "string - the prompt used for generation",
"negative_prompt": "string - the negative prompt used"
},
"sample": {
"data": {
"image": {
"id": "sbyX8a81RVK1LjPjsGrhIg",
"width": 1024,
"height": 1024,
"categories": [
"animals",
"dogs"
],
"base64_data": "UklGRipmAgBXRUJQ...",
"content_type": "image/webp"
},
"model": "auto",
"prompt": "a blue dog",
"negative_prompt": ""
},
"status": "success"
}
}About the craiyon.com API
The Craiyon API exposes 2 endpoints for working with AI-generated images: generate_image creates a new image from a text prompt and returns it as base64-encoded data along with 6 response fields including dimensions, content type, and category tags, while search_images queries an existing library of AI-generated images and returns full metadata including URLs, prompts, style, and aspect ratio for each result.
Image Generation
The generate_image endpoint accepts a required prompt string and two optional parameters: model and negative_prompt. The model field accepts one of five values — auto, art, photo, drawing, or none — letting you steer the visual style of the output. The negative_prompt parameter describes elements to exclude from the result. The response wraps the generated output in an image object containing id, width, height, content_type, base64_data, and categories. The top-level response also echoes back the model, prompt, and negative_prompt used. Aspect ratio is always auto; fixed-ratio generation is not currently supported.
Image Search
The search_images endpoint takes a query string and an optional max_results integer. It returns an images array where each object includes id, prompt, alt, width, height, image_url, categories, style, and aspect_ratio. This is useful for browsing what the Craiyon community has already generated without spending generation time. The response also includes a tags array of related terms and a total_results count.
Data Notes
Generated images come back as base64-encoded strings under base64_data, so they can be decoded and written directly to disk or served inline without a separate download step. The categories field on both endpoints provides classification metadata that can be used for filtering or content moderation downstream.
- Generate placeholder or concept art for design mockups using the
artordrawingmodel variants - Build a prompt-to-image pipeline that stores the returned
base64_datadirectly in a database or object storage - Use
negative_promptto suppress unwanted visual elements like backgrounds or specific colors when generating product imagery - Search existing Craiyon-generated images by keyword using
search_imagesto populate a gallery or inspiration board - Extract
categoriesfrom generated images to apply automated content tagging in a media management workflow - Compare output across the
photo,art, anddrawingmodels for the same prompt to select the best visual style - Use
tagsreturned bysearch_imagesto surface related terms and build an autocomplete or recommendation feature
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Craiyon have an official developer API?+
What does the generate_image endpoint return exactly?+
image object with id, width, height, content_type, base64_data, and categories, plus top-level fields for the model, prompt, and negative_prompt that were used. The image data is base64-encoded, so no separate download URL is provided.Can I generate images at a specific aspect ratio or resolution?+
generate_image endpoint always produces images at auto aspect ratio, and there are no width or height input parameters. You can fork this API on Parse and revise it to add fixed-ratio or resolution parameters if the underlying service exposes that capability.Does search_images return the actual image files or just metadata?+
image_url for each result, not base64 data. Each image object also includes prompt, alt, width, height, categories, style, and aspect_ratio. If you need base64-encoded image data, use generate_image instead.Is there a way to retrieve a user's generation history or saved images?+
generate_image and community image search via search_images, but does not expose any user account, history, or saved collection data. You can fork the API on Parse and revise it to add an endpoint targeting user-specific data if that becomes relevant.