Skip to main content
POST
https://api.pikzels.com
/
v1
/
persona
curl --location --request POST 'https://api.pikzels.com/v1/persona' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "My Character",
  "training_data": "https://example.com/training-images.zip"
}'
{
  "status": "queued",
  "id": "abc123def456"
}
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 persona model (maximum 25 characters)
training_data
string
required
URL to a publicly accessible zip file containing your training images

Image Requirements

  • File Format: PNG or JPEG only
  • Image Count: 1-20 images (if you include more than 20, only the first 20 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: Images are analyzed and prepared for training
  3. Training: The AI model learns from your images
  4. Ready: Persona is available for use in generation
curl --location --request POST 'https://api.pikzels.com/v1/persona' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "My Character",
  "training_data": "https://example.com/training-images.zip"
}'
{
  "status": "queued",
  "id": "abc123def456"
}

Using Your Trained Persona

Once training is complete, use your persona ID in generation endpoints:
{
  "prompt": "epic adventure scene",
  "format": "16:9", 
  "model": "pkz-3",
  "persona": "abc123def456"
}

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