> ## Documentation Index
> Fetch the complete documentation index at: https://ailabtools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cartoon Yourself API

> Cartoon Yourself API turns portraits into cartoon, anime, Pixar, 3D, pencil, and comic-style images with AI.

export const types = [{
  value: "jpcartoon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/jpcartoon.webp"
}, {
  value: "anime",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/anime.webp"
}, {
  value: "retro_anime_90s",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/retro_anime_90s.webp"
}, {
  value: "shoujo_manga",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/shoujo_manga.webp"
}, {
  value: "black_white_manga",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/black_white_manga.webp"
}, {
  value: "korean_webtoon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/korean_webtoon.webp"
}, {
  value: "hkcartoon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/hkcartoon.webp"
}, {
  value: "hongkong",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/hongkong.webp"
}, {
  value: "amcartoon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/amcartoon.webp"
}, {
  value: "comic",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/comic.webp"
}, {
  value: "classic_cartoon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/classic_cartoon.webp"
}, {
  value: "tccartoon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/tccartoon.webp"
}, {
  value: "ukiyoe_cartoon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/ukiyoe_cartoon.webp"
}, {
  value: "animation3d",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/animation3d.webp"
}, {
  value: "3d_cartoon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/3d_cartoon.webp"
}, {
  value: "3d",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/3d.webp"
}, {
  value: "3d_game",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/3d_game.webp"
}, {
  value: "pixar",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/pixar.webp"
}, {
  value: "pixar_plus",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/pixar_plus.webp"
}, {
  value: "handdrawn",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/handdrawn.webp"
}, {
  value: "sketch",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/sketch.webp"
}, {
  value: "pencil_drawing_2",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/pencil_drawing_2.webp"
}, {
  value: "colored_pencil",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/colored_pencil.webp"
}, {
  value: "watercolor",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/watercolor.webp"
}, {
  value: "gouache",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/gouache.webp"
}, {
  value: "oil_painting",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/oil_painting.webp"
}, {
  value: "pastel_drawing",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/pastel_drawing.webp"
}, {
  value: "ink_wash",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/ink_wash.webp"
}, {
  value: "claborate",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/claborate.webp"
}, {
  value: "paper_cut",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/paper_cut.webp"
}, {
  value: "fashion_illustration",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/fashion_illustration.webp"
}, {
  value: "concept_art",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/concept_art.webp"
}, {
  value: "flat_vector",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/flat_vector.webp"
}, {
  value: "sticker_cartoon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/sticker_cartoon.webp"
}, {
  value: "low_poly",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/low_poly.webp"
}, {
  value: "pixel_art",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/pixel_art.webp"
}, {
  value: "clay_animation",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/clay_animation.webp"
}, {
  value: "felt_doll",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/felt_doll.webp"
}, {
  value: "western",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/western.webp"
}, {
  value: "angel",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/angel.webp"
}, {
  value: "demon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/demon.webp"
}, {
  value: "avatar",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/avatar.webp"
}, {
  value: "cyberpunk",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/cyberpunk.webp"
}, {
  value: "steampunk",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/steampunk.webp"
}, {
  value: "noir_comic",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/noir_comic.webp"
}, {
  value: "bopu_cartoon",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/bopu_cartoon.webp"
}, {
  value: "crayon_childlike",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/crayon_childlike.webp"
}, {
  value: "artstyle",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/artstyle.webp"
}, {
  value: "famous",
  image: "https://ai-resource.ailabtools.com/cartoon-yourself/types/famous.webp"
}];

## Query Task

<Tip>
  This is an asynchronous task API. The submission request returns only `task_id`.

  Use `task_id` to call [Querying Async Task Results](/docs/ai-common/async-task-results/api) and retrieve the final result. Async task results remain available for 24 hours. Query every 5 seconds.
</Tip>

| Field        | Type     | Description        |
| :----------- | :------- | :----------------- |
| `data`       | `object` | Final result data. |
| +`image_url` | `array`  | Result image URL.  |

```json theme={null}
{
  "data": {
    "image_url": ""
  }
}
```

<Tip>
  All result URLs are temporarily available and will expire after 24 hours.
</Tip>

## Submit Task

### `type`

The following enum values are supported for `type`.

<Expandable title="Expressions">
  <div className="mt-2 grid grid-cols-2 lg:grid-cols-4 align-center gap-2">
    {types.map((item) => (
            <div key={item.value} className="rounded-xl">
              <img className="w-full mt-0 mb-2 aspect-square object-contain rounded-xl" src={item.image} alt={item.value} />
              <code className="block break-all text-center text-xs">{item.value}</code>
            </div>
          ))}
  </div>
</Expandable>


## OpenAPI

````yaml POST /api/portrait/effects/portrait-animation
openapi: 3.0.0
info:
  title: AILabAPI
  description: >-
    [<b>AILabTools</b>](https://www.ailabtools.com) is an advanced tool that
    offers a vast array of simple and flexible API endpoints to suit your
    specific needs. With just one [<b>API
    KEY</b>](https://www.ailabtools.com/doc/get-api-key), you can easily call
    any of the endpoints and integrate them quickly into your application or
    workflow, allowing for smooth and efficient operations. 
     
    [<b>AILabTools</b>](https://www.ailabtools.com) is continuously evolving,
    and you can anticipate even more API endpoints being added in the future,
    further enhancing its capabilities and usefulness for your artificial
    intelligence and machine learning requirements.
  version: 1.0.0
servers:
  - url: https://www.ailabapi.com
    description: Production server
security:
  - apiKeyAuth: []
tags:
  - name: AI IMAGE
  - name: AI IMAGE > Image Enhancement
  - name: AI IMAGE > Image Effects
  - name: AI IMAGE > Image Editing
  - name: AI IMAGE > Image Scoring
  - name: AI BACKGROUND REMOVAL
  - name: AI BACKGROUND REMOVAL > Portrait
  - name: AI BACKGROUND REMOVAL > General
  - name: AI PORTRAIT
  - name: AI PORTRAIT > Portrait Effects
  - name: AI PORTRAIT > Portrait Enhance
  - name: AI PORTRAIT > Portrait Editing
  - name: AI PORTRAIT > Portrait Analysis
  - name: AI COMMON
paths:
  /api/portrait/effects/portrait-animation:
    post:
      tags:
        - AI PORTRAIT > Portrait Effects
      summary: Cartoon Yourself
      description: >-
        Cartoon Yourself API turns portraits into cartoon, anime, Pixar, 3D,
        pencil, and comic-style images with AI.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - task_type
                - image
                - type
              properties:
                task_type:
                  type: string
                  enum:
                    - async
                    - sync
                  default: sync
                  description: >-
                    Task Type. 

                    - `async`: Asynchronous tasks. **Recommended for all new
                    tasks and will be enforced in future updates.** 

                    - `sync`: Synchronous tasks.
                image:
                  type: string
                  format: binary
                  description: |-
                    - Image format: `JPEG` `JPG` `PNG` 
                    - Image size: No more than 5 MB. 
                    - Image resolution: Less than 4096x4096px.
                type:
                  type: string
                  description: >-
                    Effects. See [Supported type
                    values](/docs/ai-portrait/effects/portrait-animation/api#type).
                  enum:
                    - jpcartoon
                    - anime
                    - retro_anime_90s
                    - shoujo_manga
                    - black_white_manga
                    - korean_webtoon
                    - hkcartoon
                    - hongkong
                    - amcartoon
                    - comic
                    - classic_cartoon
                    - tccartoon
                    - ukiyoe_cartoon
                    - animation3d
                    - 3d_cartoon
                    - 3d
                    - 3d_game
                    - pixar
                    - pixar_plus
                    - handdrawn
                    - sketch
                    - pencil_drawing_2
                    - colored_pencil
                    - watercolor
                    - gouache
                    - oil_painting
                    - pastel_drawing
                    - ink_wash
                    - claborate
                    - paper_cut
                    - fashion_illustration
                    - concept_art
                    - flat_vector
                    - sticker_cartoon
                    - low_poly
                    - pixel_art
                    - clay_animation
                    - felt_doll
                    - western
                    - angel
                    - demon
                    - avatar
                    - cyberpunk
                    - steampunk
                    - noir_comic
                    - bopu_cartoon
                    - crayon_childlike
                    - artstyle
                    - famous
      responses:
        '200':
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PublicResponseFields'
                  - type: object
                    properties:
                      task_id:
                        $ref: '#/components/schemas/AsyncTaskId'
              examples:
                async:
                  summary: Async
                  value:
                    request_id: ''
                    log_id: ''
                    error_detail:
                      code: ''
                      code_message: ''
                      message: ''
                    task_id: ''
                sync:
                  summary: Sync
                  value:
                    request_id: ''
                    log_id: ''
                    error_detail:
                      code: ''
                      code_message: ''
                      message: ''
                    data:
                      image_url: ''
          description: Success
components:
  schemas:
    PublicResponseFields:
      type: object
      required:
        - request_id
        - log_id
        - error_detail
      properties:
        request_id:
          type: string
          description: Request ID for debugging.
        log_id:
          type: string
          description: Log ID for debugging.
        error_detail:
          $ref: '#/components/schemas/ErrorDetail'
    AsyncTaskId:
      type: string
      description: >-
        Task ID for querying [Querying Async Task
        Results](/docs/ai-common/async-task-results/api).
    ErrorDetail:
      type: object
      required:
        - code
        - code_message
        - message
      properties:
        code:
          type: string
          description: >-
            Error Code. See [Error
            Codes](/docs/response-description#error-codes).
        code_message:
          type: string
          description: Error summary.
        message:
          type: string
          description: Detailed error message.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: ailabapi-api-key
      description: API Key for authentication

````