POST
/
streaming
/
ai
/
tasks
Create AI-task
curl --request POST \
  --url https://api.gcore.com/streaming/ai/tasks \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://demo-files.gvideo.io/ai_demo_subtitles_nudity_detection.mp4",
  "task_name": "transcription|content-moderation",
  "audio_language": "ger",
  "category": "nsfw"
}'
{
  "task_id": "aafe70c6-0000-0000-0000-327b65f7670f"
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Body

application/json
task_name
enum<string>
required

Name of the task to be performed

url
string
required

URL to the MP4 file to analyse. File must be publicly accessible via HTTP/HTTPS.

audio_language
string

Language in original audio (transcription only). This value is used to determine the language from which to transcribe. If this is not set, the system will run auto language identification and the subtitles will be in the detected language. The method also works based on AI analysis. It's fairly accurate, but if it's wrong, then set the language explicitly. Additionally, when this is not set, we also support recognition of alternate languages in the video (language code-switching). Language is set by 3-letter language code according to ISO-639-2 (bibliographic code). We can process languages:

  • 'afr': Afrikaans
  • 'alb': Albanian
  • 'amh': Amharic
  • 'ara': Arabic
  • 'arm': Armenian
  • 'asm': Assamese
  • 'aze': Azerbaijani
  • 'bak': Bashkir
  • 'baq': Basque
  • 'bel': Belarusian
  • 'ben': Bengali
  • 'bos': Bosnian
  • 'bre': Breton
  • 'bul': Bulgarian
  • 'bur': Myanmar
  • 'cat': Catalan
  • 'chi': Chinese
  • 'cze': Czech
  • 'dan': Danish
  • 'dut': Nynorsk
  • 'eng': English
  • 'est': Estonian
  • 'fao': Faroese
  • 'fin': Finnish
  • 'fre': French
  • 'geo': Georgian
  • 'ger': German
  • 'glg': Galician
  • 'gre': Greek
  • 'guj': Gujarati
  • 'hat': Haitian creole
  • 'hau': Hausa
  • 'haw': Hawaiian
  • 'heb': Hebrew
  • 'hin': Hindi
  • 'hrv': Croatian
  • 'hun': Hungarian
  • 'ice': Icelandic
  • 'ind': Indonesian
  • 'ita': Italian
  • 'jav': Javanese
  • 'jpn': Japanese
  • 'kan': Kannada
  • 'kaz': Kazakh
  • 'khm': Khmer
  • 'kor': Korean
  • 'lao': Lao
  • 'lat': Latin
  • 'lav': Latvian
  • 'lin': Lingala
  • 'lit': Lithuanian
  • 'ltz': Luxembourgish
  • 'mac': Macedonian
  • 'mal': Malayalam
  • 'mao': Maori
  • 'mar': Marathi
  • 'may': Malay
  • 'mlg': Malagasy
  • 'mlt': Maltese
  • 'mon': Mongolian
  • 'nep': Nepali
  • 'dut': Dutch
  • 'nor': Norwegian
  • 'oci': Occitan
  • 'pan': Punjabi
  • 'per': Persian
  • 'pol': Polish
  • 'por': Portuguese
  • 'pus': Pashto
  • 'rum': Romanian
  • 'rus': Russian
  • 'san': Sanskrit
  • 'sin': Sinhala
  • 'slo': Slovak
  • 'slv': Slovenian
  • 'sna': Shona
  • 'snd': Sindhi
  • 'som': Somali
  • 'spa': Spanish
  • 'srp': Serbian
  • 'sun': Sundanese
  • 'swa': Swahili
  • 'swe': Swedish
  • 'tam': Tamil
  • 'tat': Tatar
  • 'tel': Telugu
  • 'tgk': Tajik
  • 'tgl': Tagalog
  • 'tha': Thai
  • 'tib': Tibetan
  • 'tuk': Turkmen
  • 'tur': Turkish
  • 'ukr': Ukrainian
  • 'urd': Urdu
  • 'uzb': Uzbek
  • 'vie': Vietnamese
  • 'wel': Welsh
  • 'yid': Yiddish
  • 'yor': Yoruba
subtitles_language
string

Indicates which language it is clearly necessary to translate into. If this is not set, the original language will be used from attribute "audio_language". Please note that:

  • transcription into the original language is a free procedure,
  • and translation from the original language into any other languages is a "translation" procedure and is paid. More details in POST /ai/tasks#transcribe. Language is set by 3-letter language code according to ISO-639-2 (bibliographic code).
client_user_id
string

Meta parameter, designed to store your own identifier. Can be used by you to tag requests from different end-users. It is not used in any way in video processing.

Maximum length: 256
client_entity_data
string

Meta parameter, designed to store your own extra information about a video entity: video source, video id, etc. It is not used in any way in video processing. For example, if an AI-task was created automatically when you uploaded a video with the AI auto-processing option (transcribing, translationing), then the ID of the associated video for which the task was performed will be explicitly indicated here. Meta parameter, designed to store your own extra information about a video entity: video source, video id, etc. It is not used in any way in video processing. For example, if an AI-task was created automatically when you uploaded a video with the AI auto-processing option (nudity detection, etc), then the ID of the associated video for which the task was performed will be explicitly indicated here.

Maximum length: 4096
category
enum<string>

Model for analysis (content-moderation only). Determines what exactly needs to be found in the video.

Available options:
sport,
weapon,
nsfw,
hard_nudity,
soft_nudity,
child_pornography

Response

Response returns ID of the created AI task. Using this AI task ID, you can check the status and get the video processing result. Look at GET /ai/results method.

task_id
string<uuid>
required

ID of the created AI task, from which you can get the execution result