Skip to main content
POST
Text generation: Gemini 3.6 Flash (native Gemini format)
Use the playground on the right: put sk-your-api-key (your APIYI token — no Google Key needed) in x-goog-api-key. The default example sets thinking to low; hit send to see a response.
Thinking is ON by default. For cost-sensitive calls pass thinkingConfig: {"thinkingLevel": "minimal"} or {"thinkingBudget": 0}. Search grounding, code execution, URL context, and Maps tools work only on this native endpoint. Capabilities, pricing, and measured thinking tiers: Gemini 3.6 Flash Overview.
  • For streaming, change the URL to :streamGenerateContent?alt=sse (the playground demonstrates non-streaming)
  • Code execution works, but executableCode / codeExecutionResult fields are currently not echoed — results appear in the text body
  • :countTokens and the explicit cache API (cachedContents) are not yet enabled on the platform

Parameter quick reference

Response notes

  • Thinking spend is in usageMetadata.thoughtsTokenCount (bills as output)
  • Grounding sources appear in candidates[0].groundingMetadata; URL context in urlContextMetadata
  • Implicit cache hits show in usageMetadata.cachedContentTokenCount (probabilistic — don’t rely on it)

Authorizations

x-goog-api-key
string
header
required

APIYI token, the sk- prefixed key

Body

application/json
contents
object[]
required

Conversation contents; parts can mix modalities

systemInstruction
object

System instruction

generationConfig
object

Generation config

tools
object[]

Tools: google_search / url_context / codeExecution / functionDeclarations, etc.

Response

Success

candidates
object[]
usageMetadata
object

Usage; thoughtsTokenCount is the thinking spend

modelVersion
string