API Reference

Gitruck Cloud public APIs share a consistent HTTP + JSON design across user info, file management, task management, and media processing. This page summarizes the conventions that apply to the whole API surface.

Base Information

ItemValue
Base URLhttps://api.ai-mcn.tv:10000
ProtocolHTTPS
Data FormatJSON, except file upload which uses multipart/form-data
AuthenticationRaw API key passed in the Authorization header

Authentication Rule

Every business API expects:

Authorization: YOUR_API_KEY

⚠️ Warning: The current backend does not parse a Bearer prefix. If you send Authorization: Bearer YOUR_API_KEY, authentication will fail.

Request Conventions

  • File upload: POST /base/file/upload with multipart/form-data
  • Most other APIs: application/json
  • Media processing APIs follow an async task flow: create task, then query task
  • Time fields are returned as ISO 8601 style strings

Unified Response Shape

{
  "code": 200,
  "msg": "success",
  "data": {}
}
FieldTypeDescription
codenumberBusiness code. Success is usually 200
msgstringStatus message or error detail
dataobject / string / nullResponse payload. Some successful APIs return an empty string

Task Statuses

StatusDescription
createdTask created but not yet queued
queuedTask is in queue
processingTask is running
completedTask finished successfully
failedTask failed
cancelledTask was cancelled

File Lifecycle

  • Uploaded files are retained for 60 days
  • Re-uploading the same file can hit deduplication and reuse an existing record
  • Expired files can be renewed or uploaded again

Media File Limits

Audio and video tasks check the input file before the task is created. If a requirement below is not met, the request returns the matching error code; no task is created and nothing is charged:

ItemRequirementError code if not met
File integrityThe file can be parsed and decoded6017 / 6021
DurationGreater than 0 and no longer than 2 hours6019
Video resolutionWidth and height are both 4000 px or less. Common 3840×2160 video is accepted; 4096×2160 exceeds the limit6022
Video frame rate120 fps or less6023

Variable-frame-rate videos such as meeting and screen recordings (where the nominal frame rate differs greatly from the actual average) are accepted: before the task runs, the video is converted to a constant frame rate (the nearest standard rate, such as 24, 25 or 30 fps). This adds some conversion time (about 3–10 minutes for a 49-minute recording in our tests, depending on server load). Other video tasks submitted for the same file within 60 days reuse the converted copy. If the conversion fails, the task fails with 6047 and the credits are refunded.

Image tasks read only the file header at task creation; pixel data is not decoded. A file that isn't a recognizable image (such as a web page saved as .jpg, random bytes, or a file whose header is cut off) returns 6017; no task is created and nothing is charged. An image whose header is intact but whose pixel data is truncated or damaged (typically after an interrupted download or upload) passes this check and the task is created; the task then fails with 6021 during execution, the credits are refunded, and it is not retried. If the extension doesn't match the actual format and the API can't read that format (for example, the extension is .jpg but the content is AVIF), the task fails with 6017 during execution, the error message names the actual format, and the credits are refunded. In Vertical Stitch and Smart Collage, if any one image can't be read, the whole task fails.

Some APIs have stricter limits. For example, video super resolution supports videos up to 1 minute, and the raft algorithm in watermark removal supports videos up to 20 minutes. See each API's documentation for details.

Common Error Codes

Error CodeHTTP StatusDescriptionResolution
400400Invalid request parameters or bodyCheck JSON shape and parameter types
401401Unauthenticated requestCheck the Authorization header
413413Payload too largeReduce file size or request size
415415Unsupported Content-TypeUse application/json or multipart/form-data
6001400Unsupported file typeUse a supported media extension
6002413File exceeds size limitUpload a file within 20 GB
6004404File not foundVerify the file_id
6006404Task not foundVerify the task_id
6007400Task cannot be cancelled in current stateOnly created / queued tasks can be cancelled
6013400Missing required parameterAdd the missing field
6014400File type does not match the taskUse a compatible file type
6015400Unsupported language codeUse a supported language code
6016400Invalid task parameter type or valueCheck enums and parameter types
6017400Media file cannot be parsed: the file is corrupted or malformedRe-export the file with an editing or transcoding tool and upload it again
6019400Media duration is 0 or longer than 2 hoursTrim the media and retry
6021400Media integrity check failed: some positions cannot be decoded, or the end of the file is incompleteUse another source file, or re-export a complete file and upload it again
6022400Video resolution exceeds the limit: width or height is greater than 4000 px (video super resolution checks the upscaled resolution)Scale the video so that width and height are both 4000 px or less, or lower the output multiplier
6023400Video frame rate exceeds 120 fpsConvert the video to 120 fps or less (such as 60 fps) and upload it again
6047—Converting a variable-frame-rate video to a constant frame rate failed (during task execution: the task fails, credits are refunded, and the code is returned in the task result's error_code)Export a constant-frame-rate MP4 and submit again
6201402Insufficient quotaPurchase quota or recharge
6202402Insufficient balanceRecharge in the Dashboard
6502401Authentication failedPass the raw API key in the Authorization header
500500Internal server errorRetry later or contact support

API Categories