Craiyon APIcraiyon.com ↗
Generate AI images from text prompts and search Craiyon's gallery via API. Returns base64 image data, dimensions, categories, URLs, and related tags.
What is the Craiyon API?
The Craiyon API exposes 2 endpoints that let you generate AI images from text descriptions and search a library of previously created AI-generated images. The generate_image endpoint returns a base64-encoded image along with its dimensions, content type, and categories. The search_images endpoint queries the Craiyon gallery and returns up to 100 results per request, each with a direct image URL, prompt text, style, aspect ratio, and category data.
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"
}'Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace craiyon-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Craiyon AI Image Search — discover AI-generated images by text query."""
from parse_apis.craiyon_ai_image_search_api import Craiyon, NotFoundError
client = Craiyon()
# Search for cat-themed AI-generated images, capped at 5 total results
for image in client.images.search(query="cat", max_results=5, limit=5):
print(image.prompt[:60], image.width, image.height, image.style)
# Drill into the first result of a different search
result = client.images.search(query="sunset landscape", limit=1).first()
if result:
print(result.id, result.alt[:80])
print("Categories:", result.categories)
print("URL:", result.image_url)
# Typed error handling around a search call
try:
for img in client.images.search(query="cyberpunk neon city", max_results=3, limit=3):
print(img.prompt[:50], img.aspect_ratio)
except NotFoundError as exc:
print(f"Search failed: {exc}")
print("Exercised: images.search (multiple queries, limit, max_results, field access)")
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 API
Image Generation
The generate_image endpoint accepts a required prompt string and two optional parameters: model and negative_prompt. The model parameter accepts five values — auto, art, photo, drawing, and none — letting you control the visual style of the output. Use negative_prompt to steer the generator away from unwanted subjects or styles. The response includes an image object with id, width, height, content_type, base64_data, and categories, so the image data is immediately usable without an additional download step. Generation always uses an auto aspect ratio.
Gallery Search
The search_images endpoint takes a query string and an optional max_results integer (1–100). Results are ranked by relevance and each image object in the images array carries id, prompt, alt, width, height, image_url, categories, style, and aspect_ratio. The response also includes a tags array of related strings and a total_results count, which makes it straightforward to build browse or autocomplete features on top of existing Craiyon-generated content.
Data Shape Notes
The two endpoints serve distinct use cases: generate_image produces new content returned as raw base64 data, while search_images retrieves pre-existing images as hosted URLs. The categories field appears in both endpoint responses, enabling consistent filtering or labeling across generated and discovered images. The style and aspect_ratio fields are only present in search results, not in the generation response.
The Craiyon API is a managed, monitored endpoint for craiyon.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when craiyon.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official craiyon.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Generating on-demand illustrations for blog posts using a specific
modeltype likedrawingorart - Building an image discovery UI that queries the Craiyon gallery by topic and displays results with their original
prompttext - Filtering generated or found images by
categoriesto organize content by theme - Using
negative_promptto exclude specific visual elements when generating product concept art - Populating a mood board tool with images from
search_imagesresults, sorted by relevance - Logging generated image metadata including
id,width, andheightfor an asset management pipeline - Surfacing related
tagsfrom search results to suggest alternative queries in a creative tool
| 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 | 100 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 generate_image return and what formats are supported?+
image object containing base64_data (the raw image encoded as a base64 string), content_type, width, height, id, and categories. The aspect ratio is always auto — the endpoint does not accept width, height, or aspect ratio parameters.Does search_images support pagination or cursor-based browsing?+
max_results parameter but does not expose a page offset, cursor, or continuation token. Deep pagination through the full gallery is not currently supported. You can fork this API on Parse and revise it to add an offset or page parameter if your use case requires it.Can I retrieve a user's saved or liked images through this API?+
What is the difference between the `style` field in search results and the `model` parameter in generation?+
style field in search_images results is a descriptive label attached to existing images in the gallery. The model parameter in generate_image controls which generation model is used for new output, accepting auto, art, photo, drawing, or none. They are independent fields with no guaranteed mapping between them.