{"templateId":"openapi_docs","sharedDataIds":{"openAPIDocsStore":"oas-reference/ai_smile.yaml","sidebar":"sidebar-reference/sidebars.yaml"},"props":{"definitionId":"reference/ai_smile.yaml","dynamicMarkdocComponents":[],"baseSlug":"/reference/ai_smile","seo":{"title":"AI Smile","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"itemId":"","disableAutoScroll":true,"metadata":{"type":"openapi","title":"AI Smile","description":"# overview\nIntroducing Generative AI Smile API, the easy way to turn that frown upside down. This convenient AI smile generator transforms sad or neutral facial expressions into happy, natural looking smiles in just moments. Powered by advanced generative AI, it helps bring warmth and positivity to any photo with a simple and effortless process. Upload an image, let the AI work its magic, and instantly convert your sad face into a cheerful smiley face that spreads happiness everywhere it's shared.\n\nThe AI Smile generator supports two distinct smile styles, giving users more control over the final expression.\n\n1.  **smile_with_teeth_visible**  \n    This option creates a bright, joyful smile with naturally visible teeth. It is ideal for upbeat portraits, social media photos, and situations where a warm and expressive look is desired.\n\n2.  **closed_mouth_smile**  \n    This option produces a subtle, gentle smile with lips closed. It works well for professional photos, formal profiles, or when a calm and natural expression is preferred.\n\nUsers can easily choose the smile type that best matches their photo, mood, or intended use, ensuring realistic and appealing results every time.\n\nWhether you're editing photos, creating fun content, or simply want to add a touch of positivity, Generative AI Smile makes it easy to spread happiness, one smile at a time.\n\nUpload a face. Click once. Smile instantly.\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2024-03-22/5f25b0f7-5d43-421b-ae50-5def0de69f2a.jpg)\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2024-12-16/4f4397e0-9e87-429a-8e39-a9d399b6602b.jpg)\n\n## Integration Guide\nThis guide walks you through:\n\nWorkflow for AI Smile API:\n\n**Endpoint:** `/s2s/v2.0/file/ai-smile`\n\n**Authentication Required:** `Authorization: Bearer YOUR_API_KEY`\n\n**Workflow Steps:**\n\n1. **Image Upload Preparation:**\n   - The process begins with preparing a selfie image.\n\n2. **Initiate AI Task and Obtain Task ID:**\n   - Send the uploaded image(s) along with the chosen effect configuration via an HTTP POST request to `/s2s/v2.0/file/ai-smile`.\n   - Await a unique task ID in the response, which identifies this interaction.\n\n3. **Poll Task Status (Continuous Check):**\n   - Use the obtained `task_id` to periodically poll the task status using an HTTP GET request (e.g., `GET /task/${task_id}`).\n   - Continuously monitor for:\n     - `Task_status = \"success\"` (process completed).\n     - `Task_status = \"error\"` (resolve or retry if applicable).\n   - Update the workflow accordingly once the status transitions to success.\n\nThis structured workflow ensures efficient integration with user inputs, automated monitoring of tasks, and seamless retrieval of results.\n\n\n---\n\n* Authentication\n- Include your API key in the request header using **Bearer Token**:\n    ```\n    Authorization: Bearer YOUR_API_KEY\n    ```\nYou can find your API Key at https://yce.makeupar.com/api-console/en/api-keys/.\n\n\n* 1. Upload an Image\n\nYou may upload a file directly to the server or provide a valid image URL in the AI task payload.\n\n   * Upload Endpoint\n\n```\nPOST /s2s/v2.0/file/ai-smile\n```\n\nAlternatively, skip this step if you already have a public image URL.\n\n---\n\n* 2. Create a Face Lift AI Task and Poll for Results\n\nOnce you have an image and a complete effect setup, create a task. The API processes the request asynchronously. You must poll the task status until it reaches `success` or `error`.\n\n   * Create Task Endpoint\n\n```\nPOST /s2s/v2.0/task/ai-smile\n```\n\n   * Polling Endpoint\n\n```\nGET /s2s/v2.0/task/ai-smile/{task_id}\n```\n\n---\n\n## File Specs & Errors\n\n* AI Smile Specification\n\n**Supported Selfie View**\nOnly single-person images are supported, the image must contain a clearly visible face of sufficient size exceeding 32 x 32 pixels when the long edge is 640, and the capture angles must have a roll within plus or minus 75 degrees and a yaw within plus or minus 90 degrees to avoid face detection failure.\n\n![](https://plugins-media.makeupar.com/strapi/assets/thumbnail_face_reshape_01_85c8ffc055.jpg)\n\n\n---\n\n* Supported Formats & Dimensions\n\n| AI Feature | Supported Dimensions | Supported File Size | Supported Formats|\n|  ----  | ----  | ----  | ----  |\n| AI Smile | long side <= 4096 | < 10MB | jpg/jpeg/png/heic |\n\n\n* Error Codes\n\n| Error Code | Description |\n| ---------- | ----------- |\n| EXCEED_MAX_FILESIZE  | The input file exceeds the maximum allowed size. |\n| INVALID_PARAMETER     | One or more required parameters are missing, empty, or improperly formatted.  |\n| ERROR_DOWNLOAD_IMAGE | The source image could not be downloaded. |\n| ERROR_NO_FACE        | No face was detected in the provided image. |\n| ERROR_INFERENCE       | The inference process failed due to a workflow issue, execution error, encoding error, or missing output image. |\n| UNKNOWN_INTERNAL_ERROR | An unexpected internal error occurred. |\n\n\n* Environment & Dependency\n\n| Sample Code Language / Tool | Recommended Runtime Versions |\n|---|---|\n| cURL | - bash >= 3.2</br>   - curl >= 7.58 (modern TLS/HTTP support)</br>   - jq >= 1.6 (robust JSON parsing) |\n| Node.js (JavaScript) | Node >= 18 (for global fetch) |\n| JavaScript | - Chrome / Edge >= 80</br>   - Firefox >= 74</br>   - Safari >= 13.1 |\n| PHP | PHP >= 7.4 (for modern TLS/compat), ext-curl (recommended) or allow_url_fopen=On + ext-openssl, ext-json |\n| Python | Python >= 3.10 (for f-strings), requests >= 2.20.0 |\n| Java | Java 11+ (for HttpClient), Jackson Databind >= 2.12.0 |\n\n---\n"},"compilationErrors":[],"markdown":{"partials":{},"variables":{"rbac":{"teams":["anonymous"]},"user":{},"remoteAddr":{"hostname":"docs.perfectcorp.com","port":4000,"ipAddress":"216.73.217.15"},"lang":"default_locale","env":{"PUBLIC_REDOCLY_BRANCH_NAME":"master"}}},"pagePropGetterError":{"message":"","name":""}},"slug":"/reference/ai_smile","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}