Skip to main content
POST

Overview

This endpoint creates a new look for an existing avatar by editing a source look using AI. The source look is not modified - a new look is created based on it.

Authentication

This endpoint requires API key authentication. Include your API key in the Authorization header.

Request Body

string
required
Unique identifier of the avatar to edit.
string
required
Unique identifier of the source look to use as base for editing.
string
required
Text prompt describing how to edit the look.
string
default:"vertical"
Image format: vertical (9:16) or horizontal (16:9). Defaults to vertical.
string
Avatar style to apply: selfie, podcast, car, iphone, conference, or raw.
array
Additional image URLs to use for editing. The source look’s image is automatically added first if available.
string
default:"2K"
Output image resolution: 2K or 4K. Optional, defaults to 2K. Note that 4K generation costs more credits.
string
URL to receive webhook notifications when generation completes.

Response

string
Unique identifier of the avatar.
string
Unique identifier of the newly created look. This look starts in “pending” status.

Example

Credit Costs

  • Base cost (2K): 2 credits
  • Base cost (4K): 4 credits

Next Steps

  1. Check Status: Use /avatar/status endpoint to monitor the generation progress
  2. List Looks: Use /avatar/list to see all available looks for your avatar

Error Codes

  • MISSING_AVATAR_ID: avatar_id parameter is required
  • MISSING_LOOK_ID: look_id parameter is required
  • INVALID_WEBHOOK_URL: webhook_url must be a valid URL
  • MISSING_PROMPT: prompt parameter is required
  • NO_IMAGE_AVAILABLE: No image available (source look has no thumbnail and images array is empty)
  • INSUFFICIENT_CREDITS: Not enough credits to edit the avatar
  • SPACE_NOT_FOUND: Space doesn’t exist
  • AVATAR_NOT_FOUND: Avatar with specified ID doesn’t exist
  • LOOK_NOT_FOUND: Look with specified ID doesn’t exist
  • FAILED_TO_PERSIST: Error saving new look to database
  • GENERATION_FAILED: Look generation failed (async error sent via webhook)