Skip to main content

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.

Error Codes

All API errors follow a consistent format:
{
  "error": true,
  "code": "ERROR_CODE",
  "message": "Human-readable description of the error.",
  "docs": "https://docs.pixcraft.es/errors/ERROR_CODE"
}

Error reference

CodeHTTP StatusDescriptionSolution
MISSING_API_KEY401No Authorization header in the requestAdd Authorization: Bearer YOUR_KEY header
INVALID_API_KEY401The API key was not found in the databaseCheck that you copied the full key correctly
INACTIVE_API_KEY401The key exists but has been deactivatedContact support or create a new key in your dashboard
RATE_LIMIT_EXCEEDED429Monthly API call limit reachedWait for the next billing period or upgrade your plan
INVALID_NICHE400Niche ID doesn’t exist or isn’t on your planCall GET /api/v1/niches to see available niches
INVALID_IMAGE400Image could not be decodedEnsure the image is a valid JPEG, PNG, or WebP
IMAGE_TOO_LARGE400Image exceeds 10MBResize or compress the image before sending
MISSING_REQUIRED_FIELD400A required parameter is missingCheck the endpoint docs for required fields
INVALID_DIMENSIONS400Width or height outside valid rangeDimensions must be between 10 and 1000 cm
PROCESSING_ERROR500Internal error during pattern generationRetry the request. If persistent, contact support

Handling errors in code

JavaScript

const response = await fetch('https://www.pixcraft.es/api/v1/generate', { ... });

if (!response.ok) {
  const error = await response.json();
  switch (error.code) {
    case 'RATE_LIMIT_EXCEEDED':
      // Wait and retry
      break;
    case 'INVALID_IMAGE':
      // Ask user to upload a different image
      break;
    default:
      console.error(`API Error: ${error.code}${error.message}`);
  }
}

Python

response = requests.post('https://www.pixcraft.es/api/v1/generate', ...)

if response.status_code != 200:
    error = response.json()
    if error['code'] == 'RATE_LIMIT_EXCEEDED':
        time.sleep(60)
        # retry
    else:
        raise Exception(f"PixCraft error: {error['code']}{error['message']}")

Getting help

If you encounter a PROCESSING_ERROR that persists after retrying, contact us at hola@pixcraft.es with:
  • Your API key ID (not the full key)
  • The request body you sent
  • The full error response