Authorizations
##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_KEYHeaders
Enable 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:
- Async mode has the highest priority, even if streaming method is set, it will return a task ID
- After receiving the task ID, use the task query API to get the generation result, which will always be in non-streaming format
Path Parameters
Generation method:
generateContent: Returns complete response at oncestreamGenerateContent: Streaming generation, returns content in real-time chunks
Available options:
generateContent, streamGenerateContent Body
application/json
Response
Content generated successfully
Response format description:
- When
X-Async-Mode=true, returnsAsyncTaskResponse(async task response, immediately returns task ID) - When
method=generateContentand no async mode, returnsGenerateContentResponse(returns complete response at once) - When
method=streamGenerateContentand no async mode, returnsStreamGenerateContentResponse(streaming response, returns content in chunks)