X-Async-Mode request header, immediately returns task ID##All APIs require Bearer Token authentication##
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEYEnable async processing mode. When set to true, the request will be processed asynchronously and immediately return a task ID instead of waiting for the complete response.
Notes:
Generation method:
generateContent: Returns complete response at oncestreamGenerateContent: Streaming generation, returns content in real-time chunksgenerateContent, streamGenerateContent Content generated successfully
Response format description:
X-Async-Mode=true, returns AsyncTaskResponse (async task response, immediately returns task ID)method=generateContent and no async mode, returns GenerateContentResponse (returns complete response at once)method=streamGenerateContent and no async mode, returns StreamGenerateContentResponse (streaming response, returns content in chunks)