{"templateId":"api_docs","sharedDataIds":{"apiDocsStore":"api-docs-reference/ai_teeth_whitening.yaml","sidebar":"sidebar-reference/sidebars.yaml"},"props":{"definitionId":"reference/ai_teeth_whitening.yaml","settings":{"baseUrlPath":"/reference/ai_teeth_whitening"},"disableAutoScroll":true,"seo":{"title":"AI Teeth Whitening","description":"YouCam API documentation by Perfect Corp. Learn how to use Skin analysis API, Virtual try-on API, Image editing API, and Video generative AI APIs.","siteUrl":"https://docs.perfectcorp.com","keywords":"AI Skin Analysis, AI Clothes, AI Hairstyle, AI Outfits","image":"/assets/favicon.cd6fa4d833b2a573b3c6dae68386b293da205b203402cb0c97b80bd2acc07ea2.8351e24f.png"},"dynamicMarkdocComponents":[],"metadata":{"type":"openapi","title":"AI Teeth Whitening","version":"","description":"# Overview\n**AI Teeth Whitening API**\n\nThe AI Teeth Whitening API provides an advanced, automated solution for enhancing smiles in photos. Using intelligent image processing, it brightens teeth naturally and accurately, creating polished, professional results within seconds.\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2023-07-28/f05fda4d-8ca8-4661-b4b5-135067280a10.jpg)\n\n\n\n\n**How It Removes Yellow Teeth in Photos**\n\n**Smart Whitening**  \nThe API automatically detects teeth and applies a natural-looking whitening effect without making the image appear artificial.\n\n**Adjustable Levels**  \nA built-in adjustment feature allows users to control the degree of whitening, from a subtle enhancement to a more pronounced, camera-ready finish.\n\n\n\n**Key Features**\n\n**Quick and Easy Enhancement**  \nAchieve a noticeably brighter smile in just a few seconds.\n\n**Accurate AI Detection**  \nAdvanced detection ensures that only teeth are modified, maintaining a realistic and balanced appearance.\n\n**Adjustable Whitening Intensity**  \nUsers can fine-tune the whitening strength to match their preferred style.\n\n**Natural Results with Advanced Algorithms**\n\nThe AI Teeth Whitening API uses sophisticated algorithms designed to identify teeth precisely and apply whitening effects that remain true to life. Users can refine the intensity to achieve a subtle, natural improvement, ensuring that the final result looks authentic and visually appealing.\n\n---\n\n## Integration Guide\n\n* Take a Selfie\n\n    *   Face the camera directly with proper lighting.\n    *   Use the JS Camera Kit to capture the photo.\n\n* Retrieve upload URLs and File IDs via ***/s2s/v2.0/file*** API\n\n    Upload the following files using the upload URLs returned in the file API response:\n    *   Your selfie photo\n\n* Execute AI Task ***/s2s/v2.0/task/teeth-whiten***\n\n    Run the AI task using file IDs or image URLs as the input source. Configure the effect parameters as desired.\n\n* Poll Task Status\n\n    Use the returned **task\\_id** to monitor task progress.  \n    Poll **GET /s2s/v2.0/task/teeth-whiten/{task_id}** to check the engine's status.  \n    The task will remain in a **“running”** state until it is completed. No units are consumed while the task is running.\n\n\n\n* **Usage demonstration**\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2022-05-13/26c04462-d183-4392-937b-f6173ff9e814.jpg)\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-07-01/webp_a4cd3779-2966-4b8f-888e-032dffc003c0.webp)\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-11-13/webp_5824c85f-813e-4c14-b036-38cba206ee0b.webp)\n\n## File Specs & Errors\n* Supported Formats & Dimensions\n\n|Type|Supported Dimensions|Supported File Size|Supported Formats|\n|  ----  | ----  | ----  | ----  |\n|AI Teeth Whitening|Selfie Image:<br>    *   Long side ≤ 1920 px <br>    *   Short side ≥ 320 px |< 10MB|jpg/png|\n\n\n* Error Codes\n\n|Error Code|Description|\n|  ----  | ----  |\n| error_exceed_max_image_size | If the longer side of an image exceeds 1920 pixels |\n|error_below_min_image_size|If your image is smaller than 320 pixels in width or height, it's too small to use|\n|error_face_position_invalid|Your face needs to be fully visible in the image, without any parts cut off|\n|error_face_position_too_small|The face in your photo is too small to analyze properly|\n|error_face_position_out_of_boundary|Your face is either too large or partially outside the edges of the photo|\n|error_insufficient_lighting|The lighting is too dim, which makes analysis difficult|\n|error_face_angle_invalid|Your face angle isn't quite right. For front-facing shots, keep your head within 10 degrees of straight. For side-facing shots, the angle should be more than 15 degrees|\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\n## Unit Consumption\n\n| AI Feature | Unit Consumed |\n|---|---|\n| AI Teeth Whitening V1.0 | 1 |\n\n---\n"},"compilationErrors":[],"markdown":{"partials":{},"variables":{"rbac":{"teams":["anonymous"]},"user":{},"remoteAddr":{"hostname":"docs.perfectcorp.com","port":4000,"ipAddress":"216.73.216.170"},"lang":"default_locale","env":{"PUBLIC_REDOCLY_BRANCH_NAME":"master"}}},"pagePropGetterError":{"message":"","name":""}},"slug":"/reference/ai_teeth_whitening","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}