/v1beta/models/{model}:generateContenthttps://api.linkinfra.aiAuthorization
Bearer TokenAuthorizationBearer <token>Authenticate requests with your API key in the request header:
Authorization: Bearer sk-your-api-keyNeed a key? Create one in the console
Place the model ID in the URL path. Both Bearer tokens and the x-goog-api-key header are supported.
modelstringrequiredGemini model ID without the models/ prefix.
Request body
application/jsoncontentsarray<object>requiredConversation content in the native Gemini format.
Show child properties2
rolestringContent role: user or model.
partsarray<object>requiredText, image, or audio content parts.
Show child properties2
textstringText content.
inlineDataobjectInline media with mimeType and Base64-encoded data.
generationConfigobjectGeneration settings such as temperature and maxOutputTokens.
For streaming, use /v1beta/models/{model}:streamGenerateContent?alt=sse with the same request body.
Response
application/json200Successful responsecandidatesarray<object>Generated candidates. Content is in content.parts.
usageMetadataobjectInput, output, and total token usage.