Documentation / ConvertConvert image by uploading
This is a REST API provided by uploading the original image to convert an image in AVIF format.Request
curl -x POST  
        https://avif-service-api.kokoon.cloud/avif/convert-direct
     -H "Authorization: <api_key>"
     -F "file_0=@example.jpeg"
     -F "convert_option=@convert_option.json;type=application/json"
List of request parameters (multipart/form-data format)
| Parameter name | Type | Description | 
|---|
| file_0 | Image/PNG, Image/JPEG, Image/GIF, Image/WEBP | The file of the original image. (File) | 
| convert_option | File/JSON | As a JSON file defining the options to be converted, Convert with avid as much as the number of options in the compression_ratios array. | 
convert_option.json
{
  "compression_ratios" : ["level0", "level1", "level2", "level3"]
}
| Key | Type | Description | 
|---|
| compression_ratios | level0, level1, level2, level3 | This is a list of options when converting to avif. Up to 4, level0/level1/level2/level3 are the possible options, and if the compression_ratios parameter is not included in the request, ["level1"] is applied as default.
  Regarding the value of levelN, the smaller the N, the lower the compression rate, but the better the image quality. | 
Response
{
  "id": "823f2450-2323-ds3f-ff3242ddsv2"
}
List of response parameters
| Response field | Type | Description | 
|---|
| id | string | conversion id | 
Response error
| Error name | Status | Description | 
|---|
| Insufficient storage | 507 | If the quota assigned to user (api-key) is exceeded. | 
| Too many request | 429 | In case the number of concurrent avif-converts in the entire server is exceeded. | 
| Forbidden | 403 | - 1. When providing images outside the range of 64x64<= size <= 8192x8192
 - 2. When providing image files with extensions other than supported
 - 3. This error occurs when other invalid options are provided.
 
  |