Provider Name | Capability | Typical Use Case |
zhuque-text | AIGC text detection | Determines whether the text is AI-generated and provides segment tags and percentages. Applicable to scenarios such as AI content moderation and originality detection. |
zhuque-image | AIGC image detection | Determines whether the image is AI-generated and provides a confidence score. Applicable to scenarios such as AI image content moderation and copyright protection. |



Dimension | Sync Mode | Async Mode |
Submission Header | No special Header | Work-Mode: async |
Query Header | Not required. | Work-Infer-Action: query |
Requests | Once | One submission + N queries |
Response content | Directly returns the business result JSON | The outer layer returns {TaskId, Status, Output}, where Output is a stringified JSON that requires secondary parsing by the client. |
Client blocking | The client is blocked for the entire inference duration. | The response is returned immediately upon submission, and queries can be processed asynchronously. |
Typical Latency (Reference) | Text within approximately 10 seconds, images within approximately 5 seconds | Submission takes < 1 second; results are typically ready within 1 to 5 seconds. |
Selection Recommendations | Real-time single request, low concurrency, code simplicity prioritized | Batch tasks, long processing time, and client blocking is not desired |
Item | Value |
Gateway domain | <your-gateway-domain> (Obtain after creating the gateway). |
Protocol | HTTPS |
Text detection route | /v1/providers/zhuque-text/classify |
Image detection route | /v1/providers/zhuque-image/classify |
Header | Value | Description |
Authorization | Bearer <API_KEY> | API Key obtained from the EdgeOne AI gateway |
Content-Type | application/json | Request body format |
zhuque-image is invoked, images must be larger than 300×300 pixels, with a size limit of -10 MB. Supported formats are jpg, png, and webp.Parameter | Position | Type | Required | Description |
text | Body | string | Yes | Text content to be detected |
is_merge | Body | bool | No | Whether to merge paragraphs. The default value is true. When set to false, confidence is output independently for each paragraph. |
curl -X POST "https://<your-gateway-domain>/v1/providers/zhuque-text/classify" \\-H "Authorization: Bearer <API_KEY>" \\-H "Content-Type: application/json" \\-d '{"text": "hello world","is_merge": true}'
{"status": "success","softmax_confidence": 0.9274,"ratio_confidence": 1.0,"labels_ratio": {"0": 0.0001, "1": 0.0001, "2": 0.9999},"segment_labels": [{"text": "hello world", "label": 2, "conf": 0.9274, "order": 1, "position": [0, 11]}],"msg": ""}
Field | Type | Description |
status | string | Inference status, where success indicates success. |
labels_ratio | object | The proportion of each content type. "0" indicates the proportion of human (Human) content, "1" indicates the proportion of AI content, "2" indicates the proportion of suspected AI content. All values are within the range of [0, 1]. |
ratio_confidence | float | The overall proportion of suspected AI content. A higher value indicates a greater likelihood of being AI-generated, while a lower value indicates a greater likelihood of being human-generated. |
segment_labels | array | The type tag and AI confidence level for each segment. |
softmax_confidence | float | The overall AI confidence level. A higher value indicates a greater likelihood of being AI-generated, while a lower value indicates a greater likelihood of being human-generated. |
msg | string | Error message, which is empty under normal conditions. |
Parameter | Position | Type | Required | Description |
imageUrl | Body | string | Required (choose one) | A public network-accessible image URL |
imageBase64 | Body | string | Required (choose one) | The Base64-encoded content of the image |
curl -X POST "https://<your-gateway-domain>/v1/providers/zhuque-image/classify" \\-H "Authorization: Bearer <API_KEY>" \\-H "Content-Type: application/json" \\-d '{"imageUrl": "https://example.com/path/to/image.jpg"}'
{"status": "success","data": {"confidence": 0.1484},"message": ""}
Field | Type | Description |
status | string | Inference status, where success indicates success. |
data.confidence | number | The confidence level that the image is AI-generated. The value ranges from 0 to 1, where a value closer to 1 indicates a higher probability of being AI-generated. |
message | string | Error message, which is empty under normal conditions. |
import jsonimport urllib.requestGATEWAY = "https://<your-gateway-domain>"API_KEY = "<API_KEY>"HEADERS = {"Authorization": f"Bearer {API_KEY}","Content-Type": "application/json",}def classify_sync(provider: str, payload: dict) -> dict:req = urllib.request.Request(f"{GATEWAY}/v1/providers/{provider}/classify",data=json.dumps(payload).encode("utf-8"),headers=HEADERS,method="POST",)with urllib.request.urlopen(req, timeout=30) as resp:return json.loads(resp.read().decode("utf-8"))if __name__ == "__main__":text_result = classify_sync("zhuque-text", {"text": "hello world"})print("text =>", json.dumps(text_result, ensure_ascii=False, indent=2))img_result = classify_sync("zhuque-image",{"imageUrl": "https://example.com/path/to/image.jpg"},)print("image =>", json.dumps(img_result, ensure_ascii=False, indent=2))
Work-Mode: async.curl -X POST "https://<your-gateway-domain>/v1/providers/zhuque-text/classify" \\-H "Authorization: Bearer <API_KEY>" \\-H "Work-Mode: async" \\-H "Content-Type: application/json" \\-d '{"text":"hello world"}'
curl -X POST "https://<your-gateway-domain>/v1/providers/zhuque-image/classify" \\-H "Authorization: Bearer <API_KEY>" \\-H "Work-Mode: async" \\-H "Content-Type: application/json" \\-d '{"imageUrl": "https://example.com/path/to/image.jpg"}'
{"TaskId": "s1-b9d37cd7-a778-4216-82c5-ea9f2c491c11"}
TaskId to poll for results. The query request must include the Header Work-Infer-Action: query.curl -X GET "https://<your-gateway-domain>/v1/providers/zhuque-text/query/<TaskId>" \\-H "Authorization: Bearer <API_KEY>" \\-H "Work-Infer-Action: query"
{"TaskId": "s1-b9d37cd7-a778-4216-82c5-ea9f2c491c11","Status": "SUCCEEDED","Output": "{\\"labels_ratio\\":{\\"0\\":0.0001,\\"1\\":0.0001,\\"2\\":0.9999},\\"ratio_confidence\\":1,\\"segment_labels\\":[{\\"conf\\":0.9274,\\"label\\":2,\\"order\\":1,\\"position\\":[0,11],\\"text\\":\\"hello world\\"}],\\"softmax_confidence\\":0.9274,\\"status\\":\\"success\\"}"}
{TaskId, Status, Output}, where Output is a stringified JSON that requires an additional JSON parse (json.loads / JSON.parse) on the client side. In synchronous mode, there is no such encapsulation.Status | Description |
QUEUED / PROCESSING | The task is in progress. Continue polling. |
SUCCEEDED | The task succeeded. The Output field contains the business result. |
FAILED | The task failed. Stop polling and handle the error. |
import jsonimport timeimport urllib.requestGATEWAY = "https://<your-gateway-domain>"API_KEY = "<API_KEY>"AUTH = {"Authorization": f"Bearer {API_KEY}"}def classify_async(provider: str, payload: dict, poll_interval: float = 1.0) -> dict:submit_headers = {**AUTH, "Work-Mode": "async", "Content-Type": "application/json"}req = urllib.request.Request(f"{GATEWAY}/v1/providers/{provider}/classify",data=json.dumps(payload).encode("utf-8"),headers=submit_headers,method="POST",)with urllib.request.urlopen(req, timeout=15) as resp:task_id = json.loads(resp.read().decode("utf-8"))["TaskId"]query_headers = {**AUTH, "Work-Infer-Action": "query"}while True:req = urllib.request.Request(f"{GATEWAY}/v1/providers/{provider}/query/{task_id}",headers=query_headers,method="GET",)with urllib.request.urlopen(req, timeout=15) as resp:result = json.loads(resp.read().decode("utf-8"))status = result.get("Status")if status == "SUCCEEDED":result["Output"] = json.loads(result["Output"])return resultif status == "FAILED":raise RuntimeError(f"task failed: {result}")time.sleep(poll_interval)if __name__ == "__main__":print(json.dumps(classify_async("zhuque-text", {"text": "hello world"}), ensure_ascii=False, indent=2))
TaskId to call the /query/<TaskId> endpoint for querying, and you must include the Header Work-Infer-Action: query.HTTP Status Code | Error Message | Meaning | Troubleshooting Suggestion |
401 | invalid api key | Incorrect or Invalid API Key | Verify that the Key in the Authorization Header is correct. |
403 | provider_not_allowed | The gateway is not authorized for this Provider. | Check the spelling of the provider name (it should be zhuque-text or zhuque-image). |
404 | - | Path or TaskId does not exist. | Check whether the URL contains the /v1/providers/ prefix, and verify that the TaskId is correct during queries. |
429 | - | Rate limiting triggered | Reduce concurrency or increase retry backoff |
5xx | - | Upstream inference service exception or timeout | Retry later; if the issue persists, contact us. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback