Skip to main content
POST
https://api.pikzels.com
/
v1
/
style
curl --location --request POST 'https://api.pikzels.com/v1/style' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Cyberpunk Aesthetic",
  "training_data": "https://example.com/style-references.zip"
}'
{
  "status": "queued",
  "id": "xyz789ghi012"
}
Training can take up to 3 minutes. Unlike other endpoints, training returns immediately with a status - you must poll the GET endpoint to check progress.
name
string
required
Name for your style model (maximum 25 characters)
training_data
string
required
URL to a publicly accessible zip file containing your style reference images

Image Requirements

  • File Format: PNG or JPEG only
  • Image Count: 1-3 images (if you include more than 3, only the first 3 will be used)
  • Individual File Size: Maximum 8MB per image
  • Total Zip Size: Maximum 200MB

Training Process

  1. Upload: Zip file is downloaded and validated
  2. Processing: Style elements are analyzed and extracted
  3. Training: The AI model learns the artistic style
  4. Ready: Style is available for use in generation
curl --location --request POST 'https://api.pikzels.com/v1/style' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Cyberpunk Aesthetic",
  "training_data": "https://example.com/style-references.zip"
}'
{
  "status": "queued",
  "id": "xyz789ghi012"
}

Style Training Tips

Use images that share consistent visual elements like color palettes, lighting, or artistic techniques.
Choose reference images that clearly demonstrate the style you want to replicate.
High-resolution, well-composed reference images produce better style training results.

Using Your Trained Style

Once training is complete, use your style ID in generation endpoints:
{
  "prompt": "futuristic cityscape",
  "format": "16:9", 
  "model": "pkz-3",
  "style": "xyz789ghi012"
}

Common Errors

All errors return this JSON structure:
{
  "error": {
    "code": "ERROR_CODE_HERE",
    "message": "Human readable message",
    "details": "Additional context"
  }
}
Status CodeCodeDescription
400BAD_REQUESTInvalid or missing fields
400CONTENT_POLICY_VIOLATIONRequest violates content policy
401INVALID_AUTH_HEADERInvalid API Key
402INSUFFICIENT_BALANCENot enough credits
429CONCURRENT_LIMIT_EXCEEDEDToo many concurrent requests
500INTERNAL_ERRORServer problem
503MAINTENANCE_ACTIVEUnder maintenance

Endpoint-Specific Errors

Status CodeCodeDescription
400INVALID_TRAINING_DATACorrupted zip, wrong format, or inaccessible URL

Next Steps