tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Introducing the AI Content Recognition Processingc

PDF
Focus Mode
Font Size
Last updated: 2026-01-09 21:05:55

Overview

Cloud Infinite provides a convenient AI processing mechanism that enables a series of AI content recognition processing operations on media stored in COS, including images, text, etc.
The AI content recognition processing mechanism is divided into the following three methods:
Method
Category
Description
Processing during download
Synchronous processing
Add the AI processing parameter after the image's URL.
Processing upon upload
Persistent processing
When uploading images, add the Pic-Operations field in the request header and set the appropriate AI processing parameters.
Processing in the cloud
Persistent processing
Process existing images on COS using the same processing method as processing upon upload, and add the Pic-Operations field in the request header with the appropriate AI processing parameters set.

Processing Method 1: Processing during Download

You can add the AI processing parameters after the image URL to synchronously retrieve the processed image when accessing it.

Request

GET /<ObjectKey>?<AI processing parameter> HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>

Practical Example

GET /<ObjectKey>?ci-process=AISuperResolution HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>

Response

HTTP/1.1 200 OK
Content-Type: image/png
Content-Length: 98645
Date: Tue, 23 Apr 2022 09:06:16 GMT
Status: 200 OK
x-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****

[pic-content]
The processed image is returned directly in the response body.


Processing Method 2: Processing upon Upload

The processing upon upload feature helps users implement image processing during upload. You only need to add the Pic-Operations field in the request header and set the appropriate parameters to achieve AI content recognition processing during image upload, and store the original image and processing results in COS.

Request Sample

PUT /<ObjectKey> HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: GMT Date
Authorization: Auth String
Pic-Operations: <PicOperations>
Note:
Authorization: A request header that carries authentication information and is used to verify the legitimacy of requests. The Pic-Operations header must be included in the signature information. For details, see the Request Signature documentation.

Request Content

Request Header

This API uses common request headers. For details, see Common Request Headers documentation.
In addition to the common request headers, the following headers are required:
Header Name
Description
Type
Pic-Operations
Parameters for image operations
String
Pic-Operations is a JSON format string with the following parameters:
Parameter
Type
Required
Description
is_pic_info
Int
No
Whether to return original image information. 0 means no return, 1 means return. Default is 0.
rules
Array
No
Processing rule. One rule corresponds to one processing result (currently supports up to five rules). Leave blank to skip image processing.
Each item in the rules (JSON array) has the following parameters:
Parameter
Type
Required
Description
bucket
String
No
The name of the destination bucket for storing results, formatted as BucketName-AppId. If not specified, it defaults to the current bucket.
fileid
String
Yes
Storage path and name of the processed file. Name rule description:
For example, the path and name of the source file are: /p1/test1.jpg.
1. Paths starting with / are absolute paths. For example, when the fileid value is /p2/test2.jpg, it means a file named test2.jpg is stored in the p2 folder.
2. Paths not starting with / are relative paths. For example, when the fileid value is p2/test2.jpg, it means a new p2 folder is created in the p1 folder, and then a file named test2.jpg is stored in the p2 folder.
3. Do not end with /, otherwise an empty filename will occur.
4. If you want the repaired image to overwrite the original image, set the fileid field to <ObjectKey>.
rule
String
Yes
Processing parameter, example: ci-process=AIImageColoring.

Practical Example

Request

PUT /<ObjectKey> HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: GMT Date
Authorization: Auth String
Pic-Operations:
{
"is_pic_info": 1,
"rules": [{
"fileid": "exampleobject",
"rule": "ci-process=AIImageColoring"
}]
}

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 645
Date: Tue, 23 Apr 2022 09:06:16 GMT
Status: 200 OK
Server: tencent-ci
x-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****

<UploadResult>
<OriginalInfo>
<Key>ObjectKey</Key>
<Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/filename.jpg</Location>
<ETag>"ed60e3598e6862d8c8443a06acfb2153"</ETag>
</OriginalInfo>
<ProcessResults>
<Object>
<Key>exampleobject</Key>
<Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/exampleobject</Location>
<Format/>
<Size>354256</Size>
<ETag>"521451f63c331becf533e466732c1091"</ETag>
</Object>
</ProcessResults>
</UploadResult>


Processing Method 3: Processing in the Cloud

Request

Request Sample

POST /<ObjectKey>?image_process HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: GMT Date
Authorization: Auth String
Pic-Operations: <PicOperations>
Note:
Authorization: A request header that carries authentication information and is used to verify the legitimacy of requests. The Pic-Operations header must be included in the signature information. For details, see the Request Signature documentation.

Request Header

This API uses common request headers. For details, see Common Request Headers documentation.
In addition to the common request headers, the following headers are required:
Header Name
Description
Type
Pic-Operations
Parameters for image operations
String
Pic-Operations is a JSON format string with the following parameters:
Parameter
Type
Required
Description
is_pic_info
Int
No
Whether to return original image information. 0 means no return, 1 means return. Default is 0.
rules
Array
No
Processing rule. One rule corresponds to one processing result (currently supports five rules). Leave blank to skip image processing.
Each item in the rules (JSON array) has the following parameters:
Parameter Name
Type
Required
Description
bucket
String
No
The name of the destination bucket for storing results, formatted as BucketName-AppId. If not specified, it defaults to the current bucket.
fileid
String
Yes
Storage path and name of the processed file. Name rule description:
For example, the path and name of the source file are: /p1/test1.jpg.
1. Paths starting with / are absolute paths. For example, when the fileid value is /p2/test2.jpg, it means a file named test2.jpg is stored in the p2 folder.
2. Paths not starting with / are relative paths. For example, when the fileid value is p2/test2.jpg, it means a new p2 folder is created in the p1 folder, and then a file named test2.jpg is stored in the p2 folder.
3. Note: Do not end with /, otherwise an empty filename will occur.
4. To overwrite the original image with the repaired image, set the fileid field to <ObjectKey>.
rule
String
Yes
Process parameter, example: ci-process=AIImageColoring.

Practical Example

Request

POST /<ObjectKey>?image_process HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: GMT Date
Content-length: Size
Authorization: Auth String
Pic-Operations:
{
"rules": [{
"fileid": "exampleobject",
"rule": "ci-process=AIImageColoring"
}]
}
The processed image is stored in the bucket, with the value of fileid used as the object name.

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 645
Date: Tue, 23 Apr 2022 09:06:16 GMT
Status: 200 OK
Server: tencent-ci
x-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****

<UploadResult>
<OriginalInfo>
<Key>ObjectKey</Key>
<Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/filename.jpg</Location>
<ETag>"ed60e3598e6862d8c8443a06acfb2153"</ETag>
</OriginalInfo>
<ProcessResults>
<Object>
<Key>exampleobject</Key>
<Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/exampleobject</Location>
<Format/>
<Size>354256</Size>
<ETag>"521451f63c331becf533e466732c1091"</ETag>
</Object>
</ProcessResults>
</UploadResult>


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback