Gemini Generate Content API
POSThttps://api.acedata.cloud/v1beta/models/:generateContent
POSThttps://api.acedata.cloud/v1beta/models/:streamGenerateContent

Request Paths

modelstring
Model for content generation. Format: model name (without the `models/` prefix).

Request Headers

authorizationstring
Bearer token

Request Body

toolsarray
A list of tools that can be used to generate the next response.
contentsarrayRequired parameter
The current content of the conversation with the model. In a single-turn query, it is a single instance; in a multi-turn query (dialogue), it is a repeated field that includes the dialogue history and the latest request.
toolConfigobject
Requested tool configuration.
functionCallingConfigobject
modestring
Please select
allowedFunctionNamesarray
cachedContentstring
The name of the cached content to be used. Format: `cachedContents/{cachedContent}`.
safetySettingsarray
Security settings used to block unsafe content.
generationConfigobject
Configuration options for model generation and output.
seedinteger
Random seed for deterministic generation.
topKinteger
The maximum number of tokens considered during sampling (Top-K).
topPnumber
The maximum cumulative probability of tokens considered during sampling (Top-P).
temperaturenumber
Control the randomness of the output. Value range: [0.0, 2.0].
stopSequencesarray
Generate a character sequence that stops the output (up to 5 characters).
candidateCountinteger
The number of generated responses to return.
responseSchemaobject
Output Schema for generated candidate text (subset of OpenAPI Schema). Used in conjunction with `responseMimeType` of type `application/json`.
thinkingConfigobject
Configuration of thinking functions (only supports specific models).
thinkingBudgetinteger
The budget for the number of tokens that the model should generate for thinking.
includeThoughtsboolean
Is the thought process included in the response?
Please select
maxOutputTokensinteger
The maximum number of tokens in the response.
presencePenaltynumber
Apply a presence penalty to the tokens that have already appeared in the response.
frequencyPenaltynumber
Frequency penalty applied in proportion to the number of token uses.
responseMimeTypestring
The MIME types of the generated candidate text. Supported: `text/plain`, `application/json`, `text/x.enum`.
Please select
responseModalitiesarray
The set of response modalities that the model can return.
systemInstructionobject
System instructions set by the developer.
partsarray

Response

Gemini AI
Allow Use General Balance

When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.

Shell

Python

JavaScript

Java

Go

PHP

Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.