# Run an AI Studio task.

Please refer to the polling guide for checking task status. Requires a source image, template ID, and output count configuration.

Endpoint: POST /s2s/v2.0/task/ai-studio
Security: BearerAuthenticationV2

## Request fields (application/json):

  - `output_count` (integer, required)
    The number of generated images. It must be between 1 to 200.
    Example: 20

## Response 200 fields (application/json):

  - `status` (integer)
    Response status
    Example: 200

  - `data` (object)

  - `data.task_id` (string)
    ID of this task. Task result is valid to query by this ID for 24 hours.
    Example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe

## Response 400 fields (application/json):

  - `status` (integer)
    Response status
    Example: 400

  - `error` (string)
    Error message
    Example: The operation could not be completed

  - `error_code` (string)
    Error code:
* CreditInsufficiency - Insufficient unit to run
* BadRequest - Unexpected request parameter
* InvalidStyleGroup - Invalid style group id
* InvalidStyle - Invalid style id
* InvalidParameters - Invalid request parameters
    Enum: "CreditInsufficiency", "InvalidStyleGroup", "InvalidStyle", "BadRequest", "InvalidParameters"

## Response 401 fields (application/json):

  - `status` (integer)
    Response status
    Example: 401

  - `error_code` (string)
    Error code:
* InvalidApiKey - API Key is not given or not valid
* InactiveApiKey - API Key is inactivated
* ExpiredApiKey - API Key is expired
    Enum: "InvalidApiKey", "InactiveApiKey", "ExpiredApiKey"

