• Home
  • Search
  • AI Services
  • Models
  • Writing
  • Multimedia Creation
  • Translation & Others
Home›Developer Center›MYAI168 Chat API Guide

MYAI168 Chat API Guide

API DocumentationAPI Quick StartOpenAI ChatGPT APIAnthropic (Claude) APIGoogle Gemini APIGoogle Search APIGoogle News APIOpenRouter APIAPI Pricing
CLI & Agent Guidescc-switch macOScc-switch Windowscc-switch LinuxOpenCode macOSOpenCode WindowsOpenCode LinuxOpenClaw macOSOpenClaw WindowsOpenClaw LinuxHermes Agent macOSHermes Agent WindowsHermes Agent LinuxClaude Code CLI macOSClaude Code CLI WindowsClaude Code CLI LinuxCodex CLI macOSCodex CLI WindowsCodex CLI Linux
MYAI168 API & MCPMYAI168 Chat API GuideMYAI168 MCP CLIMYAI168 MCP Web & App
No matching questions on this page.Search the whole site
Quick start and common parameters

MYAI168 Chat API Guide

This page shows how to call the site chat endpoint for each use case: text chat, image recognition, image generation, speech recognition, speech generation and video generation. The module lists and curl examples in each section are generated from the modules currently enabled on this site; modules that are not enabled are not shown.

Every use case calls the same endpoint; only module and its parameters change:

POST https://www.myai168.com/en/ai/chat/chat

Authentication

Authenticate with your developer API key in the Authorization: Bearer YOUR_API_KEY header (the X-Dev-Key header is also accepted). Replace YOUR_API_KEY in the examples with your own key. Get a key at: https://www.myai168.com/en/ai/user/developer

Request format

Send the request as a form: use application/x-www-form-urlencoded for text-only requests (curl --data-urlencode) and multipart/form-data when uploading files (curl -F, with @ before the file name). Add -N to curl so the stream prints in real time.

On this site the total size of one request, including all uploaded files, is limited to 512 MB; larger requests are rejected with HTTP 413.

Common parameters

ParameterTypeRequiredDescription
modulestringrequiredModule code. default means the default model of this site; the codes available for each use case are listed in the sections below.
inputstringdepends on the moduleThe question, instruction or content for the module. Required for text chat and all generation use cases; not needed for speech recognition.
upload_file[]filedepends on the moduleUploaded files; repeat the field to upload several files (multipart/form-data). Image recognition and speech recognition require a file.
session_snintegeroptionalConversation id. Omit it on the first call; modules that support continuous conversation emit data: {"session_sn": N} in the stream — send the same value back on every follow-up call.
search_internetbooleanoptionalSet to true to let the model search the web before answering (only on models that support web search; each search is billed).
effortstringoptionalReasoning effort (reasoning models only; accepted values depend on the model, the model default applies when omitted).
displaystringoptionalSet to summarized to append a summary of the thinking process to the reply (only on reasoning models that support it; the default omitted hides it).
param2 / param3 / param4stringdepends on the moduleModule-specific parameters (for example the language for speech recognition or the voice for speech generation); see each section.

Image and video generation modules accept additional fields (for example quality, aspect_ratio, resolution, duration) described in their sections; fields a module does not use are ignored.

Module codes available on this site

Show all 116 module codes
Module codeName
searchSearch
defaultSite Default Model
agentAI Agent
gemini_4_argonGoogle Gemini 4 Argon
gemini_3_8_flashGoogle Gemini 3.8 Flash
gemini_3_8_liveLive Voice Conversation gemini-3.8-live
gemini_3_8_live_extended_thinkingLive Voice Conversation gemini-3.8-live-extended-thinking
gemini_3_6_flashGoogle Gemini 3.6 Flash
gemini_3_5_flash_liteGoogle Gemini 3.5 Flash Lite
gemini_3_1_proGoogle Gemini 3.1 Pro
gemini_3_1_flash_liveLive Voice Conversation gemini-3.1-flash-live
gemini_3_1_flash_liteGoogle Gemini 3.1 Flash Lite
claude_fable_5_1Anthropic Claude Fable 5.1
claude_fable_5Anthropic Claude Fable 5
claude_opus_5_5Anthropic Claude Opus 5.5
claude_opus_5Anthropic Claude Opus 5
claude_opus_4_8Anthropic Claude Opus 4.8
claude_sonnet_5_5Anthropic Claude Sonnet 5.5
claude_sonnet_5Anthropic Claude Sonnet 5
claude_haiku_5_5Anthropic Claude Haiku 5.5
claude_haiku_4_5Anthropic Claude Haiku 4.5
gpt_6_astraOpenAI GPT-6 Astra
gpt_6_1_solOpenAI GPT-6.1 Sol
gpt_6_solOpenAI GPT-6 Sol
gpt_6_lunaOpenAI GPT-6 Luna
openai_decisionsOpenAI Decisions
gpt_5_6_solOpenAI GPT-5.6 Sol
gpt_5_6_terraOpenAI GPT-5.6 Terra
gpt_5_6_lunaOpenAI GPT-5.6 Luna
chatgpt_5_5OpenAI ChatGPT 5.5
chatgpt_5_4_miniOpenAI ChatGPT 5.4 mini
chatgpt_5_4_nanoOpenAI ChatGPT 5.4 nano
perplexity_sonar_deep_researchPerplexity Sonar Deep Research
perplexity_sonar_reasoning_proPerplexity Sonar Reasoning Pro
perplexity_sonar_proPerplexity Sonar Pro
grok_4_7xAI Grok 4.7
grok_4_6xAI Grok 4.6
grok_4_5xAI Grok 4.5
muse_spark_1.3Meta Muse Spark 1.3
kimi_k3Kimi K3
glm_5_2GLM 5.2
qwen3.5_397b_a17bQwen 3.5 397B A17B
knowledge_chunkKnowledge Chunk Splitter
meeting_minutesMeeting Minutes
notesNote Organizer
slide_outlineSlide Outline
slide2Slide Generation 2
slideSlide Generation
editorAI Copywriter / Copywriting
official_documentOfficial Document Writing
chatpdfChat with PDF (Text Only)
homeworkHomework Assistant
social_media_content_improverSocial Post Optimization
contractContract Review
reportReport Generation
webpage_summaryWebpage Summary
google_searchGoogle Search
google_newsGoogle News
paperPaper Writing
speech_to_textSpeech Recognition
gpt_transcribeSpeech Recognition gpt_transcribe
whisper_1Speech Recognition whisper_1
gpt_4o_transcribe_diarizeMulti-Speaker Speech Recognition
programmingProgramming Assistant
planProject Plan Writing
news_reportPress Release
news_oral_reportOral News Broadcast Script
ocrImage OCR
document_ocr_to_mdDocument OCR to Markdown
document_ocr_to_docxDocument OCR to DOCX
gai_article_detectorAI Content Detector
summary_500500-Word Summary
summary_10001000-Word Summary
writing_optimizerWriting Optimization
essay_gradingEssay Grading
zenrowsWeb Crawler
get_textDocument Text Extraction
gpt_image_2_5_flareGPT Image 2.5 Flare Generation
gpt_image_2_5_sunburstGPT Image 2.5 Sunburst Generation
gemini_nano_banana_2_1Nano Banana 2.1
nano_banana_proNano Banana Pro
nano_banana_3_1_flashNano Banana 3.1 Flash
image_to_promptImage-to-Prompt
gemini_omni_flash_1_1Gemini Omni Flash 1.1 Video Generation
musicMusic Generation
music_extendExtend Song
music_coverSong Restyle
music_voiceSing with Your Voice
music_stemsVocal & Instrumental Separation
change_clothesAI Change Clothes
seedream_5_0BytePlus Seedream 5.0 Pro Text-to-Image
seedance_2_5seedance 2.5 Generate Video
seedance_2_0seedance 2.0 Generate Video
cheer_videoCheer Video Generation
christmas_videoChristmas Video Generation
rich_new_year_videoNew Year Video Generation
gemini_3_8_flash_ttsGoogle Gemini 3.8 Flash Text to Speech
gemini_3_8_flash_lite_ttsGoogle Gemini 3.8 Flash-Lite Text to Speech
gemini_2_5_flash_ttsGoogle Gemini 2.5 Flash Text to Speech
gemini_2_5_pro_ttsGoogle Gemini 2.5 Pro Text to Speech
text_to_speech_byteplusBytePlus Seed-TTS
seedaudio_1_0BytePlus SeedAudio 1.0 Audio Generation
voice_replicationBytePlus Voice Cloning
translate_to_tcTranslate to Traditional Chinese
translate_to_englishTranslate to English
english_grammaEnglish Grammar Check
speak_femaleMultilingual Voice Tutor (Female) - Sophie
speak_maleMultilingual Voice Tutor (Male) - Alex
travel_translatorTravel Translator
gemini_3.5_live_translateLive Voice Translation gemini-3.5-live-translate
gpt_live_transcribeLive Transcription gpt_live_transcribe
sc2tcSimplified to Traditional
tc2scTraditional to Simplified
simplified_chinese_detectorSimplified Chinese Detector
check_typoTypo Checker
health_educationHealth Education

Billing and errors

Every successful call is billed to your account credits according to the model pricing, and the reply ends with a usage summary; failed or interrupted calls are never charged. Errors are returned as text inside the stream with HTTP 200 (for example an invalid key, insufficient credits or a module that is not enabled), not as HTTP error codes; a request larger than the size limit is rejected with HTTP 413.

SituationMessage in the streamWhere it appears
Missing or invalid keyA "Log in" linkhtml event
The key has reached its credit limitAPI key credit limit reached!html event
API access is not enabled on this siteThis site does not provide API access.html event
Insufficient creditsPlease top up! / Insufficient credits. Please top up!html event
The model service is temporarily unavailable, or the model rejected the requestA text message explaining the reason (service errors start with ERROR! and include the UTC time)Text chunks

None of these cases is charged. Suggested handling: if the stream ends without any reply text or output file, treat the content of the html events as the failure reason; the wording follows the site language, so do not match whole sentences exactly.

Text chat

Questions, writing, translation, programming and other text work all use text chat: put a text model code in module and your question in input; the reply is streamed piece by piece.

default means the default model of this site. To use a specific model, replace it with any code in the “Module codes available on this site” list of the quick start section.

Basic conversation

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=default" \
  --data-urlencode "input=Hello, please introduce yourself."

Search the web before answering

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=default" \
  --data-urlencode "search_internet=true" \
  --data-urlencode "input=Summarize today's top technology news."

search_internet only takes effect on modules that support web search; each search is billed.

Continue a conversation (session_sn)

On the first call, omit session_sn. Read the data: {"session_sn": N} event from the stream and save the value, then send it back on every follow-up call of the same conversation.

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=default" \
  --data-urlencode "input=Recommend three books about time management."
curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=default" \
  --data-urlencode "session_sn=YOUR_SESSION_SN" \
  --data-urlencode "input=Which one is best for beginners?"

Replace YOUR_SESSION_SN with the value returned by the first call.

Reasoning effort (effort)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=claude_opus_5_5" \
  --data-urlencode "effort=high" \
  --data-urlencode "input=Prove that the square root of 2 is irrational."

effort sets how hard a reasoning model thinks (common values: low, medium, high; some models also accept minimal, xhigh, max). Accepted values depend on the model; the model default applies when omitted. display set to summarized appends a summary of the thinking process to the reply on models that support it.

Decisions (predicate, choice, score)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=openai_decisions" \
  --data-urlencode "param2=choice" \
  --data-urlencode "param3=Which department should handle this complaint?" \
  --data-urlencode "param4=billing|Payments, invoices and refunds
technical|Problems using the product
shipping|Delivery and tracking
other|Anything else" \
  --data-urlencode "input=I was charged twice for my order."
curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "module=openai_decisions" \
  -F "param2=predicate" \
  -F "param3=Does this photo show a damaged product?" \
  -F "upload_file[]=@photo.jpg"

param2 is the question type (predicate, choice, score), param3 is the question or condition, and param4 lists the options (choice) or levels (score) one per line as value|description. The reply is a table with the probability of each option and a confidence value. Upload images with upload_file[] to evaluate pictures; when param3 is omitted, the input text is used as the question and the images as the evidence.

Image recognition

Upload an image and ask about it in input; a module that accepts images answers based on the picture (describing it, reading text, analysing charts and so on). Upload images in the upload_file[] field of a multipart/form-data request.

Ask a question about an image

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "module=default" \
  -F "input=What is in this picture? Please describe it in detail." \
  -F "upload_file[]=@photo.jpg"

Repeat upload_file[] to send several images in one call. Accepted formats, image count and size limits depend on the module.

Extract the text in an image (OCR)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "module=ocr" \
  -F "input=Extract all the text in this image." \
  -F "upload_file[]=@scan.png"

C# example (ocr.cs)

using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        string url = "https://www.myai168.com/en/ai/chat/chat";
        string imagePath = "scan.png";

        using var http = new HttpClient { Timeout = TimeSpan.FromMinutes(10) };
        http.DefaultRequestHeaders.Authorization =
            new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");

        using var form = new MultipartFormDataContent();
        form.Add(new StringContent("ocr"), "module");
        form.Add(new StringContent("Extract all the text in this image."), "input");
        form.Add(new ByteArrayContent(await File.ReadAllBytesAsync(imagePath)),
                 "upload_file[]", Path.GetFileName(imagePath));

        using var request = new HttpRequestMessage(HttpMethod.Post, url) { Content = form };
        using var response = await http.SendAsync(
            request, HttpCompletionOption.ResponseHeadersRead);
        response.EnsureSuccessStatusCode();

        var text = new StringBuilder();
        var notice = new StringBuilder();
        using var reader = new StreamReader(
            await response.Content.ReadAsStreamAsync(), Encoding.UTF8);
        string? line;
        while ((line = await reader.ReadLineAsync()) != null)
        {
            if (!line.StartsWith("data: "))
            {
                continue;
            }
            using var doc = JsonDocument.Parse(line.Substring(6));
            JsonElement root = doc.RootElement;
            if (root.TryGetProperty("html", out JsonElement html))
            {
                notice.AppendLine(html.GetString());
                continue;
            }
            if (!root.TryGetProperty("choices", out JsonElement choices)
                || choices.GetArrayLength() == 0)
            {
                continue;
            }
            JsonElement choice = choices[0];
            if (choice.TryGetProperty("delta", out JsonElement delta)
                && delta.TryGetProperty("content", out JsonElement content)
                && content.ValueKind == JsonValueKind.String)
            {
                text.Append(content.GetString());
            }
            if (choice.TryGetProperty("finish_reason", out JsonElement finish)
                && finish.ValueKind == JsonValueKind.String
                && finish.GetString() == "stop")
            {
                break;
            }
        }

        Console.OutputEncoding = Encoding.UTF8;
        Console.WriteLine(text.Length > 0 ? text.ToString() : notice.ToString());
    }
}

Requires .NET 6 or later. The example uploads scan.png with MultipartFormDataContent, reads the stream line by line and joins the text in choices[0].delta.content; when the stream ends without any text, the content of the html events is the reason for the failure. Keep the file extension in the uploaded file name, because the image format is determined from it.

Modules on this site that accept images

Module codeNameNote
defaultSite Default ModelThis site default model.
gemini_4_argonGoogle Gemini 4 Argon—
gemini_3_8_flashGoogle Gemini 3.8 Flash—
gemini_3_6_flashGoogle Gemini 3.6 Flash—
gemini_3_5_flash_liteGoogle Gemini 3.5 Flash Lite—
gemini_3_1_proGoogle Gemini 3.1 Pro—
gemini_3_1_flash_liteGoogle Gemini 3.1 Flash Lite—
claude_fable_5_1Anthropic Claude Fable 5.1—
claude_fable_5Anthropic Claude Fable 5—
claude_opus_5_5Anthropic Claude Opus 5.5—
claude_opus_5Anthropic Claude Opus 5—
claude_opus_4_8Anthropic Claude Opus 4.8—
claude_sonnet_5_5Anthropic Claude Sonnet 5.5—
claude_sonnet_5Anthropic Claude Sonnet 5—
claude_haiku_5_5Anthropic Claude Haiku 5.5—
claude_haiku_4_5Anthropic Claude Haiku 4.5—
gpt_6_astraOpenAI GPT-6 Astra—
gpt_6_1_solOpenAI GPT-6.1 Sol—
gpt_6_solOpenAI GPT-6 Sol—
gpt_6_lunaOpenAI GPT-6 Luna—
openai_decisionsOpenAI Decisions—
gpt_5_6_solOpenAI GPT-5.6 Sol—
gpt_5_6_terraOpenAI GPT-5.6 Terra—
gpt_5_6_lunaOpenAI GPT-5.6 Luna—
chatgpt_5_5OpenAI ChatGPT 5.5—
chatgpt_5_4_miniOpenAI ChatGPT 5.4 mini—
chatgpt_5_4_nanoOpenAI ChatGPT 5.4 nano—
perplexity_sonar_deep_researchPerplexity Sonar Deep Research—
perplexity_sonar_reasoning_proPerplexity Sonar Reasoning Pro—
perplexity_sonar_proPerplexity Sonar Pro—
grok_4_7xAI Grok 4.7—
grok_4_6xAI Grok 4.6—
grok_4_5xAI Grok 4.5—
muse_spark_1.3Meta Muse Spark 1.3—
kimi_k3Kimi K3—
qwen3.5_397b_a17bQwen 3.5 397B A17B—
ocrImage OCRRequires at least one image file.
image_to_promptImage-to-PromptRequires at least one image file.
Image generation

Describe the picture you want in input to generate an image; upload a reference image to edit it, or send back session_sn to keep editing the previous result. Generated images are returned as download links (see “Reading the response and getting output files”).

Generate an image from text

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=gpt_image_2_5_flare" \
  --data-urlencode "input=A cat sitting on a desk, digital illustration"

Edit with a reference image

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "module=gpt_image_2_5_flare" \
  -F "input=Change the background to a beach at sunset" \
  -F "upload_file[]=@photo.png"

Keep editing the previous image (session_sn)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=gpt_image_2_5_flare" \
  --data-urlencode "session_sn=YOUR_SESSION_SN" \
  --data-urlencode "input=Make the cat wear a red scarf"

Image modules that support continuous editing emit data: {"session_sn": N} on the first call; send it back and the previous result is used as the source image when no new image is uploaded.

Choose the image quality (quality)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=gpt_image_2_5_flare" \
  --data-urlencode "quality=high" \
  --data-urlencode "input=A watercolor painting of a lighthouse at dawn"

Image parameters

ParameterRequiredDescription
upload_file[]Optional (may be omitted)Reference or source images for editing (multipart/form-data, multiple files allowed). Modules marked below as requiring an image cannot run without one.
session_snOptional (may be omitted)Continue editing the image generated by the previous call (modules that support continuous editing only).
qualityOptional (may be omitted)Image quality for gpt_image_2_5_flare, gpt_image_2_5_sunburst: auto, low, medium, high, xhigh, max (auto, the default, lets the model decide). Higher quality produces more output and costs more credits.

Image generation modules on this site

Module codeNameNote
gpt_image_2_5_flareGPT Image 2.5 Flare GenerationReference images accepted. Continuous editing supported.
Image output size: chosen automatically by the model from the prompt; commonly 1024x1024, 1024x1536, or 1536x1024 pixels, and other resolutions are possible (longest edge up to 3840 pixels).
gpt_image_2_5_sunburstGPT Image 2.5 Sunburst GenerationReference images accepted. Continuous editing supported.
Image output size: chosen automatically by the model from the prompt; commonly 1024x1024, 1024x1536, or 1536x1024 pixels, and other resolutions are possible (longest edge up to 3840 pixels).
gemini_nano_banana_2_1Nano Banana 2.1Reference images accepted. Continuous editing supported.
Image output size: 1K (about 1024x1024 pixels).
nano_banana_proNano Banana ProReference images accepted. Continuous editing supported.
Image output size: 1K (about 1024x1024 pixels).
nano_banana_3_1_flashNano Banana 3.1 FlashReference images accepted. Continuous editing supported.
Image output size: 1K (about 1024x1024 pixels).
change_clothesAI Change ClothesRequires at least one image file.
Image output size: 2K class (about 2048x2048 pixels at 1:1; the aspect ratio is decided by the model from the prompt or reference image).
seedream_5_0BytePlus Seedream 5.0 Pro Text-to-ImageReference images accepted. Continuous editing supported.
Image output size: 2K class (about 2048x2048 pixels at 1:1; the aspect ratio is decided by the model from the prompt or reference image).
Speech recognition

Upload an audio file to turn speech into text; you can set the language, and some modules can output SRT subtitles.

Transcribe an audio file

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "module=speech_to_text" \
  -F "param2=en" \
  -F "upload_file[]=@speech.mp3"

input is not needed: speech recognition modules do not use typed text.

Output SRT subtitles

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "module=speech_to_text" \
  -F "param2=en" \
  -F "param3=on" \
  -F "upload_file[]=@speech.mp3"

Help the module spell names and terms

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "module=speech_to_text" \
  -F "param2=en" \
  -F "hint=Lin Mei-ling, TSMC, Kubernetes" \
  -F "upload_file[]=@speech.mp3"

Speech recognition parameters

ParameterRequiredDescription
upload_file[]RequiredThe audio file to transcribe. Accepted formats and size limits depend on the module.
param2Optional (may be omitted)Language of the audio as a two-letter ISO 639-1 code, e.g. zh, en, ja, ko. When omitted, the default language of this site is used. With zh the transcript is output in Traditional Chinese.
param3Optional (may be omitted)Set to on to output the transcript in SRT subtitle format (only on modules marked below; other modules reply that SRT is not supported and are not charged).
hintOptional (may be omitted)Names and terms that may appear in the audio, separated by commas, e.g. Lin Mei-ling, TSMC, Kubernetes. Helps the module spell proper nouns correctly. Line breaks are removed and only the first 200 characters are used. Modules marked below as unsupported ignore it and say so in the reply.

Speech recognition modules on this site

Module codeNameSRT subtitlesName and term hints
speech_to_textSpeech RecognitionSupportedSupported
gpt_transcribeSpeech Recognition gpt_transcribeUnsupportedSupported
whisper_1Speech Recognition whisper_1SupportedSupported
gpt_4o_transcribe_diarizeMulti-Speaker Speech RecognitionUnsupportedUnsupported
Speech generation

Turn the text in input into speech, choosing the voice and language with param2 and related parameters; the output is a download link to an MP3 file.

Text to speech (Google Gemini 3.8 Flash Text to Speech)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=gemini_3_8_flash_tts" \
  --data-urlencode "param2=Kore" \
  --data-urlencode "param3=en-US" \
  --data-urlencode "param4=Warm and cheerful" \
  --data-urlencode "input=Welcome to our website. We hope you have a wonderful day."
ParameterRequiredDescription
inputRequiredThe text to read aloud.
param2Optional (may be omitted)Voice name (case-insensitive; Kore when omitted). See the voice list below.
param3Optional (may be omitted)Language code (BCP-47, e.g. cmn-CN, en-US, ja-JP). When omitted the language is detected automatically.
param4Optional (may be omitted)Speaking style for gemini_3_8_flash_tts, gemini_3_8_flash_lite_tts, e.g. Warm and cheerful. You can also put it on the first line of input as Style: Warm and cheerful; that line is not read aloud.

The same parameters apply to gemini_3_8_flash_tts, gemini_3_8_flash_lite_tts, gemini_2_5_flash_tts, gemini_2_5_pro_tts.

Voice names (30)
ValueDescription
ZephyrBright
PuckUpbeat
CharonInformative
KoreFirm
FenrirExcited
LedaYoung
OrusFirm
AoedeBreezy
CallirrhoeEasygoing
AutonoeBright
EnceladusBreathy
IapetusClear
UmbrielEasygoing
AlgiebaSmooth
DespinaSmooth
ErinomeClear
AlgenibGravelly
RasalgethiInformative
LaomedeiaUpbeat
AchernarSoft
AlnilamFirm
SchedarEven
GacruxWarm
PulcherrimaForward
AchirdFriendly
ZubenelgenubiCasual
VindemiatrixGentle
SadachbiaLively
SadaltagerKnowledgeable
SulafatWarm
Language codes (30)
ValueDescription
de-DEGerman (Germany)
en-AUEnglish (Australia)
en-GBEnglish (United Kingdom)
en-INEnglish (India)
en-USEnglish (United States)
es-USSpanish (United States)
fr-FRFrench (France)
hi-INHindi
pt-BRPortuguese (Brazil)
ar-XAArabic
es-ESSpanish (Spain)
fr-CAFrench (Canada)
id-IDIndonesian (Indonesia)
it-ITItalian (Italy)
ja-JPJapanese (Japan)
tr-TRTurkish (Turkey)
vi-VNVietnamese (Vietnam)
bn-INBengali (India)
gu-INGujarati (India)
kn-INKannada (India)
ml-INMalayalam (India)
mr-INMarathi (India)
ta-INTamil (India)
te-INTelugu (India)
nl-NLDutch (Netherlands)
ko-KRKorean (South Korea)
cmn-CNChinese
pl-PLPolish (Poland)
ru-RURussian (Russia)
th-THThai (Thailand)

Text to speech (BytePlus Seed-TTS)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=text_to_speech_byteplus" \
  --data-urlencode "param2=zh_female_wanwanxiaohe_moon_bigtts" \
  --data-urlencode "input=Welcome to our website. We hope you have a wonderful day."
ParameterRequiredDescription
inputRequiredThe text to read aloud.
param2RequiredVoice id. See the voice list below.
Voice ids (33)
ValueDescription
zh_female_wanwanxiaohe_moon_bigttsIsabella - Sweet Taiwanese
zh_female_cancan_mars_bigttsLuna - Bright All-Purpose Female
zh_male_baqiqingshu_mars_bigttsEdward - Bold Mature Male
zh_female_wenroushunv_mars_bigttsEmma - Gentle Lady
zh_female_shaoergushi_mars_bigttsTina - Children's Stories
zh_male_silang_mars_bigttsWilliam - Magnetic Male
zh_male_jieshuonansheng_mars_bigttsJames - Narration Male
zh_female_jitangmeimei_mars_bigttsGrace - Warmhearted Girl
zh_female_tiexinnvsheng_mars_bigttsSophia - Caring Female
zh_female_qiaopinvsheng_mars_bigttsMia - Playful Female
zh_female_mengyatou_mars_bigttsAva - Cute Girl
zh_female_qingxinnvsheng_mars_bigttsOlivia - Fresh Female
zh_female_linjia_mars_bigttsLily - Girl Next Door
en_female_anna_mars_bigttsAnna - Gentle American
en_male_adam_mars_bigttsAdam - Clear American
en_female_sarah_mars_bigttsSarah - Australian Female
en_male_dryw_mars_bigttsDryw - Deep Australian
en_male_smith_mars_bigttsSmith - Deep British
zh_male_guozhoudege_moon_bigttsAndrew - Cantonese Male
zh_female_daimengchuanmei_moon_bigttsElena - Sichuan Cute Girl
zh_male_jingqiangkanye_moon_bigttsThomas - Beijing Chatter
zh_female_wanqudashu_moon_bigttsRobert - Playful Uncle
zh_female_gaolengyujie_moon_bigttsCharlotte - Cool Elegant Female
zh_male_wennuanahu_moon_bigttsMark - Warm Male
zh_female_linjianvhai_moon_bigttsLila - Fresh Girl Next Door
zh_male_shaonianzixin_moon_bigttsEthan - Confident Youth
zh_male_yuanboxiaoshu_moon_bigttsJoseph - Knowledgeable Male
zh_male_yangguangqingnian_moon_bigttsGeorge - Sunny Young Male
zh_female_shuangkuaisisi_moon_bigttsAria - Lively Female
multi_female_shuangkuaisisi_moon_bigttsHaruko - Energetic Female (JA/ES)
multi_male_jingqiangkanye_moon_bigttsKazune - Male (JA/ES)
multi_female_gaolengyujie_moon_bigttsAkemi - Cool Female (JA)
multi_male_wanqudashu_moon_bigttsHiroshi - Mature Male (JA/ES)

Read text in a cloned voice (BytePlus Voice Cloning)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "module=voice_replication" \
  -F "input=Welcome to our website. We hope you have a wonderful day." \
  -F "upload_file[]=@voice_sample.mp3"

Upload a clear recording of the voice to imitate (upload_file[]) and put the text to read in input.

Generate sound from a description (BytePlus SeedAudio 1.0 Audio Generation)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=seedaudio_1_0" \
  --data-urlencode "input=Gentle rain on a window with distant thunder, calm atmosphere"

Describe the sound effects, voice or atmosphere in input. Optionally attach up to 3 reference audio clips (cite them in the text as @Audio1, @Audio2 …) or one reference image; audio and images cannot be mixed.

Speech generation modules on this site

Module codeNameNote
gemini_3_8_flash_ttsGoogle Gemini 3.8 Flash Text to SpeechAudio output format: MP3.
gemini_3_8_flash_lite_ttsGoogle Gemini 3.8 Flash-Lite Text to SpeechAudio output format: MP3.
gemini_2_5_flash_ttsGoogle Gemini 2.5 Flash Text to SpeechAudio output format: MP3.
gemini_2_5_pro_ttsGoogle Gemini 2.5 Pro Text to SpeechAudio output format: MP3.
text_to_speech_byteplusBytePlus Seed-TTSAudio output format: MP3.
seedaudio_1_0BytePlus SeedAudio 1.0 Audio GenerationMaximum text input: 3,000 characters.
Audio output format: MP3 (up to 120 seconds).
voice_replicationBytePlus Voice CloningAudio output format: MP3.
Video generation

Describe the scene in input to generate a video; you can set the aspect ratio, resolution and length, or upload images as the first frame and reference materials. The output is a download link to an MP4 file.

Generate a video from text (seedance 2.5 Generate Video)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=seedance_2_5" \
  --data-urlencode "aspect_ratio=16:9" \
  --data-urlencode "resolution=1080p" \
  --data-urlencode "duration=10" \
  --data-urlencode "generate_audio=true" \
  --data-urlencode "input=A cat jumping over a fence in slow motion, cinematic lighting"

Set the first and last frames

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "module=seedance_2_5" \
  -F "input=The flower slowly blooms" \
  -F "first_frame=@start.jpg" \
  -F "last_frame=@end.jpg"
ParameterRequiredDescription
aspect_ratioOptional (may be omitted)Aspect ratio (default 16:9).
seedance_2_5: 16:9, 9:16, 1:1, 4:3, 3:4, 21:9, adaptive
seedance_2_0: 16:9, 9:16, 1:1, 4:3, 3:4, 21:9, 9:21
resolutionOptional (may be omitted)Resolution for seedance_2_5: 720p, 1080p (default 720p).
durationOptional (may be omitted)Video length in seconds for seedance_2_5: 4 to 30 (default 15).
generate_audioOptional (may be omitted)true (default) generates sound with the video; false makes a silent video.
first_frameOptional (may be omitted)Image file used as the first frame.
last_frameOptional (may be omitted)Image file used as the last frame.
keyframes[]Optional (may be omitted)Reference images (multiple files allowed).
upload_file[]Optional (may be omitted)Reference images, videos or audio (multiple files allowed).

The first/last frames cannot be combined with reference materials (keyframes[] or upload_file[]) in the same call; such a call is rejected before generation and not charged.

Generate a video from text (Gemini Omni Flash 1.1 Video Generation)

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=gemini_omni_flash_1_1" \
  --data-urlencode "resolution=1080p" \
  --data-urlencode "aspect_ratio=9:16" \
  --data-urlencode "input=A cat jumping over a fence in slow motion, cinematic lighting"
ParameterRequiredDescription
resolutionOptional (may be omitted)Resolution for gemini_omni_flash_1_1: 720p, 1080p, 4k (default 720p).
aspect_ratioOptional (may be omitted)Aspect ratio for gemini_omni_flash_1_1: 16:9, 9:16 (default 16:9).
upload_file[]Optional (may be omitted)Reference images for the video.
session_snOptional (may be omitted)Send back the value from the previous call to revise the previous video.

Video generation usually takes a few minutes. The stream keeps sending progress messages; keep the connection open until the final event (an interrupted call is not charged).

Video generation modules on this site

Module codeNameNote
gemini_omni_flash_1_1Gemini Omni Flash 1.1 Video GenerationVideo output: one MP4 video with audio; the resolution (720P by default, or 1080P / 4K upscaled) and the aspect ratio (16:9 or 9:16) follow the control panel selection; the length is decided by the model (about 3 to 10 seconds).
seedance_2_5seedance 2.5 Generate VideoVideo output: one MP4 video of 4 to 30 seconds (15 by default) at 720P or 1080P, with the length, resolution and aspect ratio following the panel selection (with a reference video the model decides the aspect ratio and length automatically, up to 30 seconds).
seedance_2_0seedance 2.0 Generate VideoVideo output: one 15-second 720P MP4 video; the aspect ratio follows the panel selection.
GPTs custom assistants

Call a GPTs custom assistant you created, or a public one on this site, through the site-native chat endpoint: send module=gpts and pass the assistant id in param2. The id is the number at the end of its chat page URL (https://www.myai168.com/en/ai/gpts/gpts?sn=YOUR_GPT_SN).

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=gpts" \
  --data-urlencode "param2=YOUR_GPT_SN" \
  --data-urlencode "input=Hello, please introduce yourself."

Continue the same conversation — replace YOUR_SESSION_SN with the session_sn value emitted in the previous reply stream:

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=gpts" \
  --data-urlencode "param2=YOUR_GPT_SN" \
  --data-urlencode "session_sn=YOUR_SESSION_SN" \
  --data-urlencode "input=Please continue."

The assistant role instructions and bound knowledge bases are applied automatically — no need to repeat them in input. To continue the same conversation, send back the session_sn value emitted in the stream. Billing follows this site default model; a private assistant can only be called with its creator API key.

AI Agent

AI Agent plans a task as several steps and works through them round by round with tools (web search, reading web pages and documents, writing documents, producing charts and files) until the task is done. Send module=agent and describe the task in input. Each new conversation creates a notebook of its own; uploaded files and output files are stored in that notebook.

Run a task

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=agent" \
  --data-urlencode "input=Hello, please introduce yourself."

Continue a conversation (session_sn)

On the first call, omit session_sn. The stream sends a data: {"session_sn": N} event as soon as the task starts; save the value and send it back on every follow-up call of the same conversation (follow-up calls do not send a new number). AI Agent then remembers the earlier rounds and keeps working in the same notebook, so files uploaded or produced earlier are still there and can be revised.

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=agent" \
  --data-urlencode "input=Research the electric scooter market and write a short report as a Word document."
curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "module=agent" \
  --data-urlencode "session_sn=YOUR_SESSION_SN" \
  --data-urlencode "input=Change the conclusion of the report into a bulleted list."

Replace YOUR_SESSION_SN with the value returned by the first call.

When a task needs many steps, AI Agent may stop and ask whether to continue; reply “Continue” with the same session_sn and it carries on from where it stopped. To start an unrelated task, omit session_sn and a new notebook is created.

Hand over files

curl -N https://www.myai168.com/en/ai/chat/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "module=agent" \
  -F "input=Read this document and list five key points." \
  -F "upload_file[]=@report.pdf"

Uploaded files (upload_file[], multiple files allowed) are saved in the notebook of the conversation for AI Agent to read and edit.

AI Agent parameters

ParameterRequiredDescription
moduleRequiredFixed value agent.
inputRequiredThe task to complete, or a follow-up request in a continued conversation.
session_snOptional (may be omitted)Conversation number for continuing the same conversation (see above).
chat_modelOptional (may be omitted)Model that runs the task; values are listed below. When omitted or set to default, the default model of this site is used.
upload_file[]Optional (may be omitted)Files for AI Agent to work on (multipart/form-data, multiple files allowed).
notebook_snOptional (may be omitted)Run in one of your own notebooks and use its sources, notes and files; the number is the value after notebook?sn= in the notebook page URL. It must be your own notebook, otherwise the call stops with a permission message and is not charged. When omitted, a new conversation creates a new notebook and a continued conversation keeps using the notebook it used last.
chat_log_tsOptional (may be omitted)Used with notebook_sn to choose which conversation thread of that notebook to continue; the data: {"chat_log_ts": "..."} event in the stream gives the thread used by the call. Ordinary continued conversations only need session_sn.
Values of chat_model (25)
ValueName
defaultSite Default
gemini_4_argonGemini 4 Argon
gemini_3_8_flashGemini 3.8 Flash
gemini_3_6_flashGemini 3.6 Flash
gemini_3_5_flash_liteGemini 3.5 Flash Lite
gemini_3_1_proGemini 3.1 Pro
gemini_3_1_flash_liteGemini 3.1 Flash Lite
claude_fable_5_1Claude Fable 5.1
claude_fable_5Claude Fable 5
claude_opus_5_5Claude Opus 5.5
claude_opus_5Claude Opus 5
claude_opus_4_8Claude Opus 4.8
claude_sonnet_5_5Claude Sonnet 5.5
claude_sonnet_5Claude Sonnet 5
claude_haiku_5_5Claude Haiku 5.5
claude_haiku_4_5Claude Haiku 4.5
gpt_6_1_solGPT-6.1 Sol
gpt_6_solGPT-6 Sol
gpt_6_lunaGPT-6 Luna
gpt_5_6_solGPT-5.6 Sol
gpt_5_6_terraGPT-5.6 Terra
gpt_5_6_lunaGPT-5.6 Luna
chatgpt_5_5ChatGPT 5.5
chatgpt_5_4_miniChatGPT 5.4 mini
chatgpt_5_4_nanoChatGPT 5.4 nano

Reading the reply

The reply of AI Agent arrives as html events that also carry an md key with the same content in Markdown; join the md values in order to get the full reply. html events without an md key show the progress of each round (steps and tool actions) and the credit summary at the end, and can be skipped. System messages, such as insufficient credits or the question whether to continue, arrive as text chunks in choices[0].delta.content.

Download links of output files appear in the reply, in the form https://www.myai168.com/en/api/file/download_nb?sn=...&fn=.... They are private files of the calling account: sign in to this site with the same account and open them in a browser, or open the notebook of the conversation on the AI Agent Notebook page.

Python example (two calls in the same conversation)

import json
import requests

url = "https://www.myai168.com/en/ai/chat/chat"
headers = {"Authorization": "Bearer YOUR_API_KEY"}


def ask(text, session_sn=0):
    data = {"module": "agent", "input": text}
    if session_sn:
        data["session_sn"] = session_sn
    reply = []
    with requests.post(url, headers=headers, data=data, stream=True, timeout=(10, 1800)) as r:
        r.raise_for_status()
        r.encoding = "utf-8"
        for line in r.iter_lines(decode_unicode=True):
            if not line or not line.startswith("data: "):
                continue
            payload = json.loads(line[6:])
            if "session_sn" in payload:
                session_sn = payload["session_sn"]
            elif "md" in payload:
                reply.append(payload["md"])
            elif payload.get("choices"):
                choice = payload["choices"][0]
                content = (choice.get("delta") or {}).get("content")
                if content:
                    reply.append(content)
                if choice.get("finish_reason") == "stop":
                    break
    return "".join(reply), session_sn


answer, session_sn = ask("Research the electric scooter market and write a short report as a Word document.")
print(answer)
print("session_sn:", session_sn)

answer, session_sn = ask("Change the conclusion of the report into a bulleted list.", session_sn)
print(answer)

Requires pip install requests. ask() returns the reply and the conversation number; the second call sends the number back to continue the same conversation.

Things to note

  • Your account needs at least 10,000 credits to use AI Agent. A task runs many rounds of reasoning and tool actions and can use a large amount of credits, so consider setting a credit limit on the API key.
  • A task can take several minutes or longer and is complete only when finish_reason is stop, so set a long read timeout on the client. If the connection drops, the task stops and the rounds already completed are still charged by usage.
  • Only one task can run in the same notebook at a time. Wait until the previous call has finished before sending the next one; otherwise the reply says the previous task is still running.
  • session_sn only works for the account that started the conversation, so use an API key of the same account. AI Agent conversations are not listed on the history page; keep session_sn in your program.
Reading the response and getting output files

Response events

The response is an SSE stream (Content-Type: text/event-stream, UTF-8 encoded); each event is one data: {JSON} line:

EventDescription
{"choices": [{"delta": {"content": "..."}}]}A text chunk (OpenAI-compatible chat.completion.chunk); concatenate the chunks in order to get the full reply.
{"html": "..."}An HTML fragment: previews and download links of images, videos and audio, notices, and the usage summary at the end of the reply.
{"session_sn": N}Conversation id (only from modules that support it); send it back on the next call to continue.
{"user_request_html": "..."}An echo of the uploaded files (HTML); programs can ignore it.
"finish_reason": "stop"End of the stream (delta.content is null in this event).

Skip any key not listed above — more event kinds may be added later.

Usage summary of the call

A successful call sends one html event before the stream ends, wrapped in <span class="billing-summary">, stating the credits used by the call, the elapsed time and the remaining credits. The wording follows the site language and suits showing to users as is; when a program needs numbers, query the balance with GET https://www.myai168.com/en/api/user/get_credits.

Getting output files

Images, videos, audio and other outputs appear as download URLs of this site in the href / src attributes of the html fragments (URLs look like https://www.myai168.com/en/api/file/download_photo?id=... or https://www.myai168.com/en/api/file/download?id=...). These files are private to the calling account: sign in to this site with the same account and open the URL in a browser to download them.

Python example

The example reads the stream, assembles the full text reply and collects the conversation id, the output file URLs and the usage summary. If the stream ends with no reply text and no output file, the notices received are treated as the failure reason (install the package first: pip install requests):

import json
import re
import requests

url = "https://www.myai168.com/en/ai/chat/chat"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
data = {"module": "default", "input": "Hello, please introduce yourself."}

text_parts = []
file_urls = []
notices = []
billing = ""
session_sn = 0

with requests.post(url, headers=headers, data=data, stream=True, timeout=(10, 900)) as r:
    r.raise_for_status()
    r.encoding = "utf-8"
    for line in r.iter_lines(decode_unicode=True):
        if not line or not line.startswith("data: "):
            continue
        payload = json.loads(line[6:])
        if "session_sn" in payload:
            session_sn = payload["session_sn"]
        elif "html" in payload:
            fragment = payload["html"]
            for u in re.findall(r'(?:href|src)="([^"]*/api/file/[^"]+)"', fragment):
                if u not in file_urls:
                    file_urls.append(u)
            plain = " ".join(re.sub(r"<[^>]+>", " ", fragment).split())
            if 'class="billing-summary"' in fragment:
                billing = plain
            elif plain:
                notices.append(plain)
        elif payload.get("choices"):
            choice = payload["choices"][0]
            content = (choice.get("delta") or {}).get("content")
            if content:
                text_parts.append(content)
            if choice.get("finish_reason") == "stop":
                break

answer = "".join(text_parts)
if not answer and not file_urls:
    raise RuntimeError("request failed: " + " / ".join(notices))
print(answer)
print("session_sn:", session_sn)
print("files:", file_urls)
print("billing:", billing)

Do not omit r.encoding = "utf-8": the response header does not state the encoding, and without this line requests turns non-ASCII text into garbage. timeout=(10, 900) means 10 seconds to connect and at most 900 seconds between two chunks.

To upload files, pass them in the files argument with the field name upload_file[]:

files = [("upload_file[]", open("photo.jpg", "rb"))]
data = {"module": "default", "input": "What is in this picture?"}
r = requests.post(url, headers=headers, data=data, files=files, stream=True, timeout=(10, 900))

Node.js example

This uses the fetch built into Node.js 18 and later, so no package is needed. Save it as chat.mjs and run node chat.mjs:

const url = "https://www.myai168.com/en/ai/chat/chat";
const body = new URLSearchParams({ module: "default", input: "Hello, please introduce yourself." });

const res = await fetch(url, {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY" },
  body,
});
if (!res.ok) throw new Error("HTTP " + res.status);

let answer = "";
let sessionSn = 0;
const fileUrls = new Set();
const decoder = new TextDecoder();
let buffer = "";

for await (const chunk of res.body) {
  buffer += decoder.decode(chunk, { stream: true });
  const lines = buffer.split("\n");
  buffer = lines.pop();
  for (const line of lines) {
    if (!line.startsWith("data: ")) continue;
    const payload = JSON.parse(line.slice(6));
    if (payload.session_sn !== undefined) {
      sessionSn = payload.session_sn;
    } else if (payload.html !== undefined) {
      for (const m of payload.html.matchAll(/(?:href|src)="([^"]*\/api\/file\/[^"]+)"/g)) {
        fileUrls.add(m[1]);
      }
    } else if (payload.choices) {
      answer += payload.choices[0].delta?.content ?? "";
    }
  }
}

console.log(answer);
console.log("session_sn:", sessionSn);
console.log("files:", [...fileUrls]);

To upload files, use FormData (do not set Content-Type yourself — fetch adds the boundary automatically); read the response the same way as above:

import { readFile } from "node:fs/promises";

const form = new FormData();
form.append("module", "default");
form.append("input", "What is in this picture?");
form.append("upload_file[]", new Blob([await readFile("photo.jpg")]), "photo.jpg");

const res = await fetch("https://www.myai168.com/en/ai/chat/chat", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY" },
  body: form,
});

Practical tips

  • A call is complete only when finish_reason is stop. A call interrupted midway is not charged and can simply be sent again.
  • Waiting time varies a lot by use: text usually takes seconds to tens of seconds, image and speech generation can exceed a minute, and video generation can take several minutes. Give the client a generous read timeout.
  • Keep a separate session_sn for each conversation, and omit it when starting a new topic.
  • Keep the key in server-side code only, never in a web page or a mobile app; setting a credit limit on each key is recommended.
‹ Previous page: Codex CLI LinuxNext page: MYAI168 MCP CLI ›
↑
Question link copied.

Other FAQ pages

API Documentation

  • API Quick Start
  • OpenAI ChatGPT API
  • Anthropic (Claude) API
  • Google Gemini API
  • Google Search API
  • Google News API
  • OpenRouter API
  • API Pricing

CLI & Agent Guides

  • cc-switch macOS
  • cc-switch Windows
  • cc-switch Linux
  • OpenCode macOS
  • OpenCode Windows
  • OpenCode Linux
  • OpenClaw macOS
  • OpenClaw Windows
  • OpenClaw Linux
  • Hermes Agent macOS
  • Hermes Agent Windows
  • Hermes Agent Linux
  • Claude Code CLI macOS
  • Claude Code CLI Windows
  • Claude Code CLI Linux
  • Codex CLI macOS
  • Codex CLI Windows
  • Codex CLI Linux

MYAI168 API & MCP

  • MYAI168 MCP CLI
  • MYAI168 MCP Web & App