zoice/avatar-edit

Add new images to existing avatar profiles.

Zoice Avatar Edit API Docs

Zoice Avatar Edit API endpoint generates ultra-realistic images to be added to your selected avatar. Besides a base image and a prompt, you can also optionally add multiple reference images, aspect ratio and resolution option to ensure the AI generates the desired image for your avatar.

API Request

The API endpoint handles heavy media rendering tasks asynchronously using a fast queue-based system, and the request immediately returns a request_id. Use the request_id to poll the status of the generation and return the result after the task is completed.

Sending Request

bash
curl -X POST "https://api.zoice.com/v1/run/zoice/avatar-edit" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ZOICE_API_KEY" \
  -d '{
    "avatar_id": "ad4ed5d7-22eb-...",
    "base_image_url": "https://storage.zoice.com/......png",
    "reference_image_urls": [
      "https://storage.zoice.com/......png"
    ],
    "image_prompt": "Make the avatar look happy.",
    "aspect_ratio": "9:16",
    "resolution": "1k"
  }'

Response Format

json
{
  "request_id": 'd1f47b9c-6387-49d0-a403-...',
  "status": 'processing',
}

Polling and Output

After submitting an asynchronous API request, you can use the request_id obtained from the response to further poll for the status of the generation and ultimately retrieve the result after the completion. Use the /v1/fetch/request_id endpoint to perform this operation.

Polling Request

bash
curl -X GET "https://api.zoice.com/v1/fetch/{request_id}" \
  -H "Authorization: Bearer $ZOICE_API_KEY"

Polling Response

typescript
{
  "status": 'success',
  "request_id": 'd1f47b9c-6387-49d0-a403-...',
  "type": "image",
  "output": {
	"credits": 20,
    "result": "https://storage.zoice.com/...png"
  }
}

Schema

Input

Parameter

Type

Required

Default

Range

Description

avatar_id

string (uuid)

Yes

-

-

Avatar ID of the desired avatar profile.

base_image_url

string (url)

Yes

-

-

An existing image of the avatar profile to be used as base reference.

reference_image_urls

string[]

No

-

-

Array of reference image urls to be used as references for image generation

image_prompt

string

Yes

-

-

Prompt text to guide the generation.

aspect_ratio

string

No

1:1

"1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"

The aspect ratio of the image.

resolution

string

No

1k

"1k", "2k", "4k"

The resolution of the image.

Output

Field

Type

Description

status

string

The status of the API request.

enums: "success", "processing", "failed"

request_id

string (uuid)

A unique identifier generated for tracking this specific request.

type

string

The type of media content being processed.

enums: "video", "image", "audio", "voice_profile", "avatar_profile"

output

object

An object containing the generated media url and metadata.

output.credits

number

Credits used for generation.

output.result

string (url)

The secure HTTP URL where the generated asset can be downloaded.