SilentAPI Logo SilentAPI

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

MethodPathDescription
POST/v1beta/models/{model}:generateContentGenerate content
POST/v1beta/models/{model}:streamGenerateContentStream 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

ParameterTypeDescription
contentsarrayConversation turns with parts
systemInstructionobject or stringSystem instruction. An object contains text parts.
generationConfigobjectSupports temperature, topP, maxOutputTokens, stopSequences, and response schemas
generationConfig.thinkingConfig.thinkingLevelstringReasoning 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.thinkingConfig.thinkingBudgetintegerToken budget for reasoning. See the table below.
generationConfig.thinkingConfig.includeThoughtsbooleanfalse leaves out the thinking text. When absent, thinking text is returned when the model gives it.
toolsarrayFunction declarations, Google Search, or Google Maps grounding
toolConfigobjectFunction calling configuration
safetySettingsarraySafety filter configuration

Reasoning

SilentAPI changes thinkingBudget to a reasoning level:

thinkingBudgetReasoning level
Less than 0medium
0none. Reasoning is off on models that can turn it off. Other models use their lowest level.
1 to 2,048low
2,049 to 8,192medium
8,193 to 32,768high
32,769 to 65,536xhigh
More than 65,536max

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

RequestHandling
thinkingLevel on a model with other levelsThe closest level the model supports
thinkingBudget on any modelChanged to a level with the table above, then to the closest level the model supports
temperature above 2, topP above 1Limited 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.