# Create Photo Avatar

Generates a personalized AI avatar based on text prompts, and attribute inputs.

Also Read: How to [create personalized AI avatar](https://www.heygen.com/avatars/ai-photo-avatar) from photos online.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "heygen-api",
    "version": "4.0.8"
  },
  "servers": [
    {
      "url": "https://api.heygen.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header",
        "x-default": "<your-api-key>"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v2/photo_avatar/photo/generate": {
      "post": {
        "summary": "Generate photo avatar photos",
        "description": "Effortlessly create personalized AI avatars from photos",
        "operationId": "generate-photo-avatar-photos",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name to assign to the generated avatar. "
                  },
                  "age": {
                    "type": "string",
                    "enum": [
                      "Young Adult",
                      "Early Middle Age",
                      "Late Middle Age",
                      "Senior",
                      "Unspecified"
                    ],
                    "description": "Age group for the avatar's appearance. "
                  },
                  "gender": {
                    "type": "string",
                    "enum": [
                      "Woman",
                      "Man",
                      "Unspecified"
                    ],
                    "description": "Gender identity of the avatar. "
                  },
                  "ethnicity": {
                    "type": "string",
                    "enum": [
                      "White",
                      "Black",
                      "Asian American",
                      "East Asian",
                      "South East Asian",
                      "South Asian",
                      "Middle Eastern",
                      "Pacific",
                      "Hispanic",
                      "Unspecified"
                    ],
                    "description": "Ethnic background for facial and skin tone characteristics. "
                  },
                  "orientation": {
                    "type": "string",
                    "enum": [
                      "square",
                      "horizontal",
                      "vertical"
                    ],
                    "description": "Image orientation for the generated avatar. "
                  },
                  "pose": {
                    "type": "string",
                    "enum": [
                      "half_body",
                      "close_up",
                      "full_body"
                    ],
                    "description": "Framing or body coverage in the avatar. "
                  },
                  "style": {
                    "type": "string",
                    "enum": [
                      "Realistic",
                      "Pixar",
                      "Cinematic",
                      "Vintage",
                      "Noir",
                      "Cyberpunk",
                      "Unspecified"
                    ],
                    "description": "Visual or artistic style of the generated avatar. "
                  },
                  "appearance": {
                    "type": "string",
                    "description": "Text prompt describing the avatar's appearance, such as clothing, mood, lightning, etc. Maximum 1000 characters. "
                  },
                  "callback_url": {
                    "type": "string",
                    "description": "URL to notify when video rendering is complete, useful when your callback endpoint is dynamic and each video requires a separate callback. Using a webhook endpoint is still the recommended approach, as it provides more customization options such as secrets, event filtering, and more. If both `webhook` and `callback_url` are used, events will be sent to both endpoints."
                  },
                  "callback_id": {
                    "type": "string",
                    "description": "Custom ID for callback purposes. Returned in the status/webhook payload for tracking."
                  }
                },
                "required": [
                  "name",
                  "age",
                  "gender",
                  "ethnicity",
                  "orientation",
                  "pose",
                  "style",
                  "appearance"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Avatar generation initiated successfully - Expand to view the detailed response schema.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "error": null,
                      "data": {
                        "generation_id": "c3r57aed16664bffbef37a2f985191e6"
                      }
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Displays error message when the request fails; null if the request is successful."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "generation_id": {
                          "type": "string",
                          "example": "51be01eda38e4c2b9836f06957f66b7d",
                          "description": "Unique identifier of the generated AI avatar. "
                        }
                      },
                      "description": "Contains the generation ID of the avatar. "
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```