All Products
Search
Document Center

AI Guardrails:Request syntax

Last Updated:Mar 31, 2026

The AI Guardrails API accepts HTTP and HTTPS POST requests. Request parameters are JSON-formatted and sent in the request body. The clientInfo query parameter is passed in the URL query string.

Request structure

All requests use the following structure:

{protocol}://{endpoint}/{resource-path}?{query-string}
ComponentDescription
protocolhttp or https. Use https for sensitive data.
endpointThe AI Guardrails API endpoint. For example, green.cn-shanghai.aliyuncs.com.
resource-pathThe operation path. For example, green/image/scan for synchronous image moderation.
query-stringQuery parameters. Pass the clientInfo parameter here.

Example: synchronous image moderation request (unencoded)

http://green.cn-shanghai.aliyuncs.com/green/image/scan?clientInfo={"ip":"127.0.0.2","userId":"120234234","userNick":"Mike","userType":"others"}

Communication protocols

Both HTTP and HTTPS are supported. Use HTTPS when transmitting sensitive data.

Request parameters

Each request must include two sets of parameters:

Parameter typeLocationDescription
Common request parametersURL query string (clientInfo)Required for all operations. See Common request parameters.
Service request parametersRequest body (JSON)Operation-specific. See the description of each operation.

Encoding

Requests and responses are encoded in UTF-8.