ShanHaiYin

ShanHaiYin API Documentation

Create API keys to connect ShanHaiYin image, text, audio, and video checks to your server-side tools and review workflows.

Updated: August 19, 2026

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 URLhttps://shanhaiyin.com
Response formatapplication/json
AuthenticationSend an API key in the request headers. Authorization: Bearer is recommended.
BillingAnalysis 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/json

For 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-data

The following header is also supported:

X-Shanhaiyin-Api-Key: shy_live_your_key

Endpoint overview and point costs

MethodPathContent-TypePoint costPurpose
POST/api/v1/images/analyzemultipart/form-data1 point / imageImage AI-generation, provenance, and pixel-signal analysis.
POST/api/v1/text/analyzeapplication/json1 point / checkText AI-writing signal analysis.
POST/api/v1/audio/analyzemultipart/form-data3 points / started minuteCreate an asynchronous audio analysis job.
POST/api/v1/video/analyzemultipart/form-data8 points / started minuteCreate an asynchronous video analysis job.
GET/api/v1/media-status/{jobId}-No extra chargePoll 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

MethodPOST
Path/api/v1/images/analyze
Content-Typemultipart/form-data
Point cost1 point / image
PurposeAnalyze AI-generation signals, provenance metadata, C2PA / GB 45438 declarations, and pixel-level review signals.

Request fields

FieldTypeRequiredDescription
imagefileYesImage 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

MethodPOST
Path/api/v1/text/analyze
Content-Typeapplication/json
Point cost1 point / check
PurposeAnalyze 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

FieldTypeRequiredDescription
textstringYesText 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

MethodPOST
Path/api/v1/audio/analyze
Content-Typemultipart/form-data
Point cost3 points / started minute
PurposeUpload an audio file and create an asynchronous analysis job. Poll the returned jobId for the final result.

Request fields

FieldTypeRequiredDescription
audiofileYesAudio 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

MethodPOST
Path/api/v1/video/analyze
Content-Typemultipart/form-data
Point cost8 points / started minute
PurposeUpload a video file and create an asynchronous analysis job. Poll the returned jobId for the final result.

Request fields

FieldTypeRequiredDescription
videofileYesVideo 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

MethodGET
Path/api/v1/media-status/{jobId}
AuthenticationAPI key header required
Point costNo extra charge
PurposePoll an audio or video job. Processing responses include a retry hint; completed jobs return the final analysis result.

Path parameters

FieldTypeRequiredDescription
jobIdstringYesJob 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

FieldTypeDescription
okbooleanWhether the request succeeded.
providerstringAlways shanhaiyin for public API responses.
servicestringDetector service name, such as image-aigc-detector, text-aigc-detector, audio-aigc-detector, or video-aigc-detector.
requestIdstringAnalysis request reference for support, logs, and reports.
riskLevelstringRisk level: low, medium, or high.
modelScorenumberAI-likelihood score from the model or normalized by the service. Range: 0 to 100.
detectedbooleanWhether AI-generation, synthesis, or strong assisted-editing signals were detected.
modelDecisionstringModel decision, typically Pass, Review, or Block.
resultsarrayMain evidence items. Each item contains label, confidence, description, and riskLevel.
fileHash / textHashstringSHA-256 fingerprint of the analyzed file or text, useful for matching a result to the original content.
billingobjectPoint 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."
}
HTTPcodeDescription
400IMAGE_REQUIRED / MEDIA_REQUIRED / TEXT_TOO_SHORTA required field is missing, or the text is shorter than the current limit.
401API_AUTH_REQUIREDThe API key is missing, invalid, revoked, or the account is unavailable.
402INSUFFICIENT_POINTSThe account does not have enough points.
413IMAGE_TOO_LARGE / MEDIA_TOO_LARGE / TEXT_TOO_LONGThe uploaded file or text exceeds the current limit.
415UNSUPPORTED_IMAGE_TYPE / UNSUPPORTED_MEDIA_TYPEThe submitted file type is not currently supported.
422MEDIA_DURATION_UNREADABLEThe server could not read the audio or video duration. Check that the file is complete and playable.
429GLOBAL_HOURLY_POINT_LIMITThe global safety limit was reached. Retry later.
502 / 503DETECTOR_REQUEST_FAILED / DETECTOR_NOT_CONFIGUREDThe 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.

Create an API key