Skip to main content
POST
Generate Avatar

Endpoint

Request Body

string
required
Text description of the desired avatar. Be specific about appearance, style, setting, and mood.Example: "cyberpunk warrior, neon lights, futuristic city, dramatic lighting"
string
default:"flux"
AI model to use for generation.Options:
  • flux - Fast, 2 credits (standard quality)
  • imagen3 - High quality, 5 credits
  • reality4 - Ultra realistic, 5 credits
string
Elements to avoid in the generation.Example: "blurry, low quality, distorted, extra limbs"
string
default:"1:1"
Output image aspect ratio.Options: 1:1, 16:9, 9:16, 4:3, 3:4
number
default:"10"
How closely to follow the prompt (7-15 recommended).Range: 1-20. Higher values = stricter adherence
number
Random seed for reproducible results. Use same seed with same prompt for identical output.Range: 0 to 2147483647
number
default:"1"
Number of variations to generate simultaneously.Range: 1-4. Each variation costs credits.
string
Apply a predefined style template.Options: professional, anime, fantasy, cyberpunk, renaissance, realistic

Response

string
Unique avatar identifier
string
Current generation status: queued, processing, completed, failed
string
The prompt used for generation
string
AI model used
string
Full resolution image URL (available when status = completed)
string
Thumbnail image URL (available when status = completed)
number
Image width in pixels
number
Image height in pixels
number
Credits deducted for this generation
string
ISO 8601 timestamp of creation

Example Request

Example Response

Processing (Immediate Response)

Completed (After Polling)

Error Responses

Insufficient Credits

Invalid Prompt

Rate Limited

Polling for Completion

After initiating generation, poll the avatar status endpoint:

Batch Generation

Generate multiple variations in parallel:
Each variation in a batch costs credits. batchSize: 4 with model: 'flux' = 8 credits total (4 × 2)

Best Practices

Prompt Engineering: Be specific and descriptive. Good prompts include:
  • Subject/character description
  • Art style or aesthetic
  • Setting and environment
  • Lighting conditions
  • Mood or emotion
Cost Optimization:
  1. Start with flux model (2 credits) for iteration
  2. Switch to premium models once prompt is refined
  3. Use seeds to reproduce good results without regenerating
  4. Batch similar prompts together for efficiency

Authorizations

Authorization
string
header
required

Your Percify API token

Body

application/json
prompt
string
required

Text description of the avatar to generate

Example:

"Professional headshot of a young entrepreneur, confident smile, modern office background, warm lighting"

model
enum<string>
default:flux

AI model to use for generation

Available options:
flux,
imagen3,
reality4
aspectRatio
enum<string>
default:1:1

Output image aspect ratio

Available options:
1:1,
16:9,
9:16,
4:3,
3:4
negativePrompt
string

Elements to avoid in the generation

seed
integer

Seed for reproducible results

Response

Avatar generated successfully

id
string

Unique avatar identifier

imageUrl
string<uri>

URL to the generated avatar image

prompt
string

Prompt used for generation

model
string

AI model used

status
enum<string>

Generation status

Available options:
processing,
completed,
failed
creditsUsed
integer

Credits consumed for this generation

createdAt
string<date-time>