# Run an AI Image Extender task.

Please refer to the polling guide for checking task status. The API takes 3 key parameters: input image, pivot point, and output image.

Endpoint: POST /s2s/v2.0/task/out-paint
Security: BearerAuthenticationV2

## Security:

  - `BearerAuthenticationV2` (unknown)
    http bearer

## Request fields (application/json):

  - `output_width` (integer, required)
    Output image width. value range: [1 - 4096]
    Example: 960

  - `output_height` (integer, required)
    Output image height. value range: [1 - 4096]
    Example: 1280

  - `input_x` (integer, required)
    Source image left position in output image, where The indices are ordered from top to bottom, and from left to right. value range: [0 - 4096]
    Example: 240

  - `input_y` (integer, required)
    Source image top position in output image, where The indices are ordered from top to bottom, and from left to right. value range: [0 - 4096]
    Example: 320

  - `input_width` (integer, required)
    Source image width, input_x + input_width must <= output_width. value range: [1 - 4096]
    Example: 480

  - `input_height` (integer, required)
    Source image height, input_y + input_height must <= output_height. value range: [1 - 4096]
    Example: 640

  - `crop_input_x` (integer, required)
    Crop source image from x, where The indices are ordered from top to bottom, and from left to right. value range: [0 - 4096]
    Example: 0

  - `crop_input_y` (integer, required)
    Crop source image from y, where The indices are ordered from top to bottom, and from left to right. value range: [0 - 4096]
    Example: 0

  - `crop_input_width` (integer, required)
    Crop source image with width crop_input_width. value range: [1 - 4096]
    Example: 480

  - `crop_input_height` (integer, required)
    Crop source image with height crop_input_height. value range: [1 - 4096]
    Example: 640

  - `src_file_url` (string, required)
    Url of the file to run task. The url should be publicly accessible.
    Example: https://example.com/selfie.jpg

  - `src_file_id` (string, required)
    ID of file to run task. File ID from upload file API.
    Example: pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE=

## Response 200:

  - `200` (unknown)
    Successful execution of the task

## 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 30 days.
    Example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe

## Response 400:

  - `400` (unknown)
    Failed execution of task

## Response 401:

  - `401` (unknown)
    Invalid API Key or Inactive API Key or Expired API Key

## 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"

## Response 429:

  - `429` (unknown)
    Too many requests within a given amount of time

