When to use the API
The API is intended for server-side integrations such as moderation queues, commerce support tools, evidence collection workflows, internal dashboards, plugins, and automated review scripts. API calls use the same ShanHaiYin point balance as the website and mini program, and results use the same report language, request references, and SHA-256 fingerprints.
If you only need to check files occasionally, the web interface is simpler. Use the API when your system needs to submit checks automatically, store results, or attach a report to a business record.
Base information
| Base URL | https://shanhaiyin.com |
|---|---|
| Response format | application/json |
| Authentication | Send an API key in the request headers. Authorization: Bearer is recommended. |
| Billing | Analysis endpoints consume account points. Audio and video are billed from the duration read by the server. |
Create an API key
Sign in and open API access in your account. Each account can keep up to 10 active API keys. You can revoke a key at any time. The full key is shown only once when it is created, so copy it immediately into your server environment or secret manager.
Do not expose an API key in browser code, mini program packages, mobile apps, or public repositories. If a key is leaked, revoke it and create a replacement.
Authentication
Every public API request must include an API key in the request headers. Recommended format:
Authorization: Bearer shy_live_your_key
Content-Type: application/jsonFor file uploads, your HTTP client usually sets the multipart boundary automatically. Send the authorization header with the file form:
Authorization: Bearer shy_live_your_key
Content-Type: multipart/form-dataThe following header is also supported:
X-Shanhaiyin-Api-Key: shy_live_your_keyEndpoint overview and point costs
| Method | Path | Content-Type | Point cost | Purpose |
|---|---|---|---|---|
| POST | /api/v1/images/analyze | multipart/form-data | 1 point / image | Image AI-generation, provenance, and pixel-signal analysis. |
| POST | /api/v1/text/analyze | application/json | 1 point / check | Text AI-writing signal analysis. |
| POST | /api/v1/audio/analyze | multipart/form-data | 3 points / started minute | Create an asynchronous audio analysis job. |
| POST | /api/v1/video/analyze | multipart/form-data | 8 points / started minute | Create an asynchronous video analysis job. |
| GET | /api/v1/media-status/{jobId} | - | No extra charge | Poll the status and result of an audio or video job. |
Audio and video shorter than one minute are billed as one minute. Additional time is rounded up to the next whole minute, based on the duration read by the server.
Image analysis endpoint
| Method | POST |
|---|---|
| Path | /api/v1/images/analyze |
| Content-Type | multipart/form-data |
| Point cost | 1 point / image |
| Purpose | Analyze AI-generation signals, provenance metadata, C2PA / GB 45438 declarations, and pixel-level review signals. |
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
image | file | Yes | Image file to analyze. Current supported formats: JPG / JPEG / PNG / WebP / GIF / BMP, up to 20MB. |
Response example
{
"ok": true,
"provider": "shanhaiyin",
"service": "image-aigc-detector",
"requestId": "SHY-20260819-ABC12345",
"riskLevel": "high",
"modelScore": 96.5,
"detected": true,
"modelDecision": "Block",
"results": [
{
"label": "aigc",
"confidence": 96.5,
"description": "The model found strong AI-generation or deepfake signals.",
"riskLevel": "high"
}
],
"fileHash": "e3566ed2eb18...e0d7c03848",
"detectedAt": "2026-08-19T08:00:00+00:00",
"billing": {
"charged": true,
"channel": "api",
"units": 1
}
}curl example
curl -X POST https://shanhaiyin.com/api/v1/images/analyze \
-H "Authorization: Bearer shy_live_your_key" \
-F "image=@/path/to/image.jpg"Text analysis endpoint
| Method | POST |
|---|---|
| Path | /api/v1/text/analyze |
| Content-Type | application/json |
| Point cost | 1 point / check |
| Purpose | Analyze text for AI-writing, assisted-generation, or machine-rewrite signals. |
Request example
{
"text": "Paste the text you want to check here. The current limit is 350 to 2,000 characters."
}Request fields
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to analyze. Current limit: 350 to 2,000 characters. |
Response notes
The text endpoint returns synchronously. Its response follows the same core shape as image analysis and also includes textHash, textLength, and billingUnits.
curl example
curl -X POST https://shanhaiyin.com/api/v1/text/analyze \
-H "Authorization: Bearer shy_live_your_key" \
-H "Content-Type: application/json" \
-d '{"text":"Paste the text you want to check here. The current limit is 350 to 2,000 characters."}'Audio analysis endpoint
| Method | POST |
|---|---|
| Path | /api/v1/audio/analyze |
| Content-Type | multipart/form-data |
| Point cost | 3 points / started minute |
| Purpose | Upload an audio file and create an asynchronous analysis job. Poll the returned jobId for the final result. |
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
audio | file | Yes | Audio file to analyze. Current supported formats: WAV / MP3 / AAC / FLAC / AMR / 3GP / M4A / WMA / OGG / APE, up to 100MB. |
Job creation response example
{
"ok": true,
"status": "processing",
"jobId": "9f1c4a2b3d4e5f60718293a4b5c6d7e8",
"mediaKind": "audio",
"durationSeconds": 73.42,
"billingMinutes": 2,
"retryAfter": 3,
"billing": {
"charged": true,
"channel": "api",
"units": 6
}
}curl example
curl -X POST https://shanhaiyin.com/api/v1/audio/analyze \
-H "Authorization: Bearer shy_live_your_key" \
-F "audio=@/path/to/audio.mp3"Video analysis endpoint
| Method | POST |
|---|---|
| Path | /api/v1/video/analyze |
| Content-Type | multipart/form-data |
| Point cost | 8 points / started minute |
| Purpose | Upload a video file and create an asynchronous analysis job. Poll the returned jobId for the final result. |
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
video | file | Yes | Video file to analyze. Current supported formats: FLV / MKV / MP4 / RMVB / AVI / WMV / 3GP / TS / MOV / RM / MPEG / MPG, up to 200MB. |
Job creation response example
{
"ok": true,
"status": "processing",
"jobId": "9f1c4a2b3d4e5f60718293a4b5c6d7e8",
"mediaKind": "video",
"durationSeconds": 73.42,
"billingMinutes": 2,
"retryAfter": 3,
"billing": {
"charged": true,
"channel": "api",
"units": 16
}
}curl example
curl -X POST https://shanhaiyin.com/api/v1/video/analyze \
-H "Authorization: Bearer shy_live_your_key" \
-F "video=@/path/to/video.mp4"Check audio or video job status
| Method | GET |
|---|---|
| Path | /api/v1/media-status/{jobId} |
| Authentication | API key header required |
| Point cost | No extra charge |
| Purpose | Poll an audio or video job. Processing responses include a retry hint; completed jobs return the final analysis result. |
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
jobId | string | Yes | Job ID returned when creating an audio or video analysis job. |
Processing response example
{
"ok": true,
"status": "processing",
"jobId": "9f1c4a2b3d4e5f60718293a4b5c6d7e8",
"mediaKind": "video",
"retryAfter": 3
}Completed response example
{
"ok": true,
"provider": "shanhaiyin",
"service": "video-aigc-detector",
"requestId": "SHY-20260819-DEF67890",
"providerTaskId": "w-video-aigc-xxx",
"riskLevel": "high",
"modelScore": 99,
"detected": true,
"modelDecision": "Block",
"fileHash": "4f15e6d23d...87eaf894",
"fileName": "video.mp4",
"results": [
{
"label": "video_aigc",
"confidence": 99,
"description": "The model found strong AI-generated video-frame signals.",
"riskLevel": "high"
}
],
"billing": {
"charged": true,
"channel": "api",
"units": 16
}
}curl example
curl https://shanhaiyin.com/api/v1/media-status/9f1c4a2b3d4e5f60718293a4b5c6d7e8 \
-H "Authorization: Bearer shy_live_your_key"Common response fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded. |
provider | string | Always shanhaiyin for public API responses. |
service | string | Detector service name, such as image-aigc-detector, text-aigc-detector, audio-aigc-detector, or video-aigc-detector. |
requestId | string | Analysis request reference for support, logs, and reports. |
riskLevel | string | Risk level: low, medium, or high. |
modelScore | number | AI-likelihood score from the model or normalized by the service. Range: 0 to 100. |
detected | boolean | Whether AI-generation, synthesis, or strong assisted-editing signals were detected. |
modelDecision | string | Model decision, typically Pass, Review, or Block. |
results | array | Main evidence items. Each item contains label, confidence, description, and riskLevel. |
fileHash / textHash | string | SHA-256 fingerprint of the analyzed file or text, useful for matching a result to the original content. |
billing | object | Point billing data for this request, including charged, channel, and units. |
Error format and common codes
Error format
{
"ok": false,
"code": "INSUFFICIENT_POINTS",
"message": "Your account does not have enough points for this image check."
}| HTTP | code | Description |
|---|---|---|
| 400 | IMAGE_REQUIRED / MEDIA_REQUIRED / TEXT_TOO_SHORT | A required field is missing, or the text is shorter than the current limit. |
| 401 | API_AUTH_REQUIRED | The API key is missing, invalid, revoked, or the account is unavailable. |
| 402 | INSUFFICIENT_POINTS | The account does not have enough points. |
| 413 | IMAGE_TOO_LARGE / MEDIA_TOO_LARGE / TEXT_TOO_LONG | The uploaded file or text exceeds the current limit. |
| 415 | UNSUPPORTED_IMAGE_TYPE / UNSUPPORTED_MEDIA_TYPE | The submitted file type is not currently supported. |
| 422 | MEDIA_DURATION_UNREADABLE | The server could not read the audio or video duration. Check that the file is complete and playable. |
| 429 | GLOBAL_HOURLY_POINT_LIMIT | The global safety limit was reached. Retry later. |
| 502 / 503 | DETECTOR_REQUEST_FAILED / DETECTOR_NOT_CONFIGURED | The detector, cloud task, or upstream model is temporarily unavailable. |
API results are technical references. They should be reviewed together with source files, business records, publication context, and human judgment for high-stakes decisions.
Start
Create an API key first, then make sure your point balance is sufficient. You can buy points from the recharge page.
