Documentation Index
Fetch the complete documentation index at: https://docs.pixcraft.es/llms.txt
Use this file to discover all available pages before exploring further.
Generate Pattern
Authentication
Bearer token. Example:
Bearer px_live_your_keyRequest body
Base64-encoded image data. Provide either
image or image_url, not both.URL of the image to process. Provide either
image or image_url, not both.Target niche ID. Use
GET /api/v1/niches to see available options.Target width in centimeters (10–1000).
Target height in centimeters (10–1000).
Width of each unit in cm. Defaults to the niche’s default.
Height of each unit in cm. Defaults to the niche’s default.
Maximum number of colors in the palette. If set, the palette is trimmed to this count.
Color catalog to use. Currently:
"default" or "custom" (uses your API key’s custom colors).Example request
Response
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean | Always true on success |
niche | string | The niche used for generation |
dimensions.cols | number | Number of columns in the grid |
dimensions.rows | number | Number of rows in the grid |
dimensions.total_units | number | Total units (cols × rows) |
materials | array | Colors used with quantities and percentages |
assembly_guide | array | Step-by-step assembly instructions. Direction depends on niche: row-by-row (top→bottom), column-by-column (left→right, for curtains), or bottom-to-top (for LEGO/rugs). Check assemblyDirection in /api/v1/capabilities. |
color_summary | array | absent | Color-grouped position summary (only for crossstitch and embroidery niches) |
difficulty | string | Automatically calculated difficulty: easy, medium, or hard. Based on volume (total units), color diversity, and fragmentation (color changes per row). Weights vary per niche. |
usage | object | Current API usage after this call |
Common errors
| Code | Description |
|---|---|
MISSING_REQUIRED_FIELD | niche, width_cm, or height_cm is missing |
INVALID_NICHE | Niche does not exist or is not on your plan |
INVALID_IMAGE | Image could not be decoded |
IMAGE_TOO_LARGE | Image exceeds 10MB |
INVALID_DIMENSIONS | Width or height outside 10–1000 cm |
PROCESSING_ERROR | Internal error during generation |