API overview

更新时间:
复制 MD 格式

This topic lists the content detection API operations that you can call in AI Guardrails.

Overview

This topic is for users who call API operations by sending HTTP or HTTPS POST requests. If you use a software development kit (SDK), you can skip this topic.

A request URL consists of different parameters and has a fixed request structure. The URL includes common parameters, your signature, and API-specific parameters. Each API document provides a sample request URL for your reference. For readability, these sample URLs are not encoded. You must encode the URL before you send a request. After your request is authenticated using your signature, a response is returned. If the call succeeds, the response parameters are returned. If the call fails, an error message is returned. You can analyze and troubleshoot issues based on common and API-specific error codes.

Note

We recommend that you use an SDK to avoid manual signature authentication and to easily call API operations and manage resources.

Concurrency limit

The concurrency limit is the number of content items (images, videos, text, and audio) that can be detected concurrently. For information about the concurrency limits for API calls, see the Pricing page.

Note
  • To change the default concurrency limit, contact us through Online Service. Additional fees are charged for increasing the default concurrency limit.

  • By default, detecting content in multiple scenarios for the same object counts as one concurrent task. For example, if you detect pornographic content and terrorist content in the same image, the concurrency is 1.

Content moderation (machine-assisted moderation)

Service

Interface

Description

Image moderation

/green/image/scan

Submits a synchronous image moderation task to detect non-compliant or undesirable content in an image.

/green/image/asyncscan

Submits an asynchronous image moderation task to detect non-compliant or undesirable content in an image.

/green/image/results

Queries the result of an asynchronous image moderation task.

/green/image/feedback

Submits feedback on the result of an image moderation task.

Video moderation

/green/video/syncscan

Submits a synchronous video moderation task to detect pornography, terrorist and political content, text that violates regulations, undesirable scenes, and logos in a video.

/green/video/asyncscan

Submits an asynchronous video moderation task to detect pornography, terrorist and political content, text that violates regulations, undesirable scenes, and logos in a video.

/green/video/results

Queries the result of an asynchronous video moderation task.

/green/video/cancelscan

Cancels a video stream moderation task.

/green/video/feedback

Submits feedback on the result of a video moderation task.

Text moderation

/green/text/scan

Submits a synchronous text moderation task to detect non-compliant content, such as pornographic content, advertisements, spam, political content, and abuse, in Chinese or English text.

/green/text/feedback

Submits feedback on the result of a text moderation task.

Audio moderation

/green/voice/syncscan

Submits a synchronous audio moderation task to detect non-compliant content in audio files or audio streams.

/green/voice/asyncscan

Submits an asynchronous audio moderation task to detect non-compliant content in audio files or audio streams.

/green/voice/results

Queries the result of an asynchronous audio moderation task.

/green/voice/cancelscan

Cancels an audio moderation task.

File moderation

/green/file/asyncscanv2

Submits an asynchronous file moderation task. This operation parses the images and text in the file and detects non-compliant content in them separately.

/green/file/results

Submits results for asynchronous text detection.

Manual review

API

Description

/green/image/manual/asyncScan

Use the manual image review feature if you require high accuracy and recall rates.

/green/video/manual/asyncScan

Use the manual video review feature if you require high accuracy and recall rates.

/green/text/manual/asyncScan

Use the manual text review feature if you require high accuracy and recall rates.

/green/voice/manual/asyncScan

Use the manual audio review feature if you require high accuracy and recall rates.

Image and text OCR

Service

Interface

Description

General image and text OCR

/green/image/scan

Submits a synchronous OCR task to detect text in an image.

/green/image/asyncscan

Submits an asynchronous OCR task to detect text in an image.

/green/image/results

Queries the result of an asynchronous OCR task.

Structured card and certificate OCR

/green/image/scan

Submits a synchronous structured OCR task to detect text in images of certificates.

/green/image/asyncscan

Submits an asynchronous structured OCR task to detect text in images of certificates.

/green/image/results

Queries the result of an asynchronous structured card and certificate OCR task.

Facial recognition

Service

API

Description

Facial attribute detection

/green/face/detect

Submits a facial attribute detection task to detect facial attributes in an image. These attributes include face blur, face angle, face position, smile level, and whether the person is wearing glasses, a mask, or a hat. It also detects beards, bangs, and hair type.

Face comparison

/green/image/scan

Submits a synchronous face comparison task to perform a 1:1 comparison and detect the similarity between two faces.

/green/image/asyncscan

Submits an asynchronous face comparison task to perform a 1:1 comparison.

/green/image/results

Queries the result of an asynchronous face comparison task.

Custom face search

Interface

Description

/green/image/scan

Submits a custom face search task.

This operation searches a specified face database for the input face image and returns the top 5 most similar individuals, sorted by similarity in descending order.

/green/sface/person/add

Creates an individual and adds the individual to a specified group.

/green/sface/person/update

Sets the information for an individual, including the name and remarks.

/green/sface/person/update

Retrieves the information for an individual, including the name, related faces, and the group to which the individual belongs.

/green/sface/person/delete

Deletes an individual.

/green/sface/face/add

Adds a set of face information for a specified individual.

/green/sface/face/delete

Deletes the face information of a specified individual.

/green/sface/groups

Retrieves a list of all groups.

/green/sface/group/persons

Retrieves a list of individuals in a specified group.

/green/sface/person/groups/add

Adds group information to add an individual to a specified group.

/green/sface/person/groups/delete

Removes group information to remove an individual from a specified group.