Gemini Style
Use Gemini generateContent and streamGenerateContent
SilentAPI provides endpoints compatible with the Gemini API under /v1beta. Point the Google GenAI SDK at SilentAPI and send your API key.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /v1beta/models/{model}:generateContent | Generate content |
| POST | /v1beta/models/{model}:streamGenerateContent | Stream generate content |
Basic Request
curl "https://api.silentapi.com/v1beta/models/gemini-3.8-flash:generateContent" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: YOUR_API_KEY" \
-d '{
"contents": [{
"parts": [{ "text": "What is quantum entanglement?" }]
}]
}'
Response:
{
"candidates": [{
"content": {
"role": "model",
"parts": [{ "text": "Quantum entanglement is a phenomenon..." }]
},
"finishReason": "STOP"
}],
"usageMetadata": {
"promptTokenCount": 6,
"candidatesTokenCount": 142,
"totalTokenCount": 148
},
"silentapi": {
"cost": 0.000038,
"fallback": null
}
}
Using the Google GenAI SDK
Python
from google import genai
client = genai.Client(
api_key="YOUR_API_KEY",
http_options={"base_url": "https://api.silentapi.com"}
)
response = client.models.generate_content(
model="gemini-3.8-flash",
contents="What is quantum entanglement?"
)
print(response.text)
JavaScript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({
apiKey: "YOUR_API_KEY",
httpOptions: { baseUrl: "https://api.silentapi.com" }
});
const response = await ai.models.generateContent({
model: "gemini-3.8-flash",
contents: "What is quantum entanglement?"
});
const responseText = response.text;
Supported Parameters
| Parameter | Type | Description |
|---|---|---|
| contents | array | Conversation turns with parts |
| systemInstruction | object or string | System instruction. An object contains text parts. |
| generationConfig | object | Supports temperature, topP, maxOutputTokens, stopSequences, and response schemas |
| generationConfig. | string | Reasoning level: minimal, low, medium, or high. A model without the level gets the closest level, for example minimal becomes low on gemini-3.8-flash. See Reasoning. |
| generationConfig. | integer | Token budget for reasoning. See the table below. |
| generationConfig. | boolean | false leaves out the thinking text. When absent, thinking text is returned when the model gives it. |
| tools | array | Function declarations, Google Search, or Google Maps grounding |
| toolConfig | object | Function calling configuration |
| safetySettings | array | Safety filter configuration |
Reasoning
SilentAPI changes thinkingBudget to a reasoning level:
| thinkingBudget | Reasoning level |
|---|---|
| Less than 0 | medium |
| 0 | none. Reasoning is off on models that can turn it off. Other models use their lowest level. |
| 1 to 2,048 | low |
| 2,049 to 8,192 | medium |
| 8,193 to 32,768 | high |
| 32,769 to 65,536 | xhigh |
| More than 65,536 | max |
When both fields exist, thinkingLevel is used. An unknown thinkingLevel is ignored and thinkingBudget is used. Each model supports its own set of levels. SilentAPI changes an unsupported level to the closest supported level. See Reasoning for the rules.
Parameter Handling
| Request | Handling |
|---|---|
thinkingLevel on a model with other levels | The closest level the model supports |
thinkingBudget on any model | Changed to a level with the table above, then to the closest level the model supports |
temperature above 2, topP above 1 | Limited to 2 and 1. See Parameter Handling. |
Grounding
Use tools to request Google Search or Google Maps grounding. Support depends on the selected model. Grounding can add a request charge. Read current prices on the Services page and Calculator.
curl "https://api.silentapi.com/v1beta/models/gemini-3.8-flash:generateContent" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: YOUR_API_KEY" \
-d '{
"contents": [{ "parts": [{ "text": "What is the latest news on Mars exploration?" }] }],
"tools": [{"googleSearch": {}}]
}'
Cross-Style Usage
Use any supported text or multimodal model with generateContent. The response uses the Gemini format.
Streaming
Use :streamGenerateContent to receive server-sent events (SSE). Each response chunk contains candidate parts. See Streaming for details.