Stream generated content (Gemini)
The streaming form of generateContent: the same request, answered as server-sent events, each data: line one GenerateContentResponse chunk. The stream has no terminal frame, so it carries no cost comment; the request's cost is in the usage records (GET /v1/generation).
Authorization<token>creator*stringThe part of the model ID before the slash (google in google/gemini-3.1-flash-lite). To pin a provider, prefix it with provider:, as in google:google.
model*stringThe part of the model ID after the slash (gemini-3.1-flash-lite).
alt?"sse"The Google Gen AI SDKs send alt=sse. The response is server-sent events either way.
"sse"application/json- body
A Gemini GenerateContentRequest as sent over REST. The model is named in the path, so the body has no model; every other field is Google's.
cachedContent?stringA cached content name (cachedContents/{id}); Gemini models only.
contents*array<>The conversation so far; one item for a single-turn request.
generationConfig?Configuration options for model generation and outputs. Not all parameters are configurable for every model.
labels?safetySettings?array<>serviceTier?GeminiServiceTier"unspecified""standard""flex""priority"store?booleansystemInstruction?The base structured datatype containing multi-part content of a message.
A Content includes a role field designating the producer of the Content
and a parts field containing multi-part data that contains the content of
the message turn.
toolConfig?The Tool configuration containing parameters for specifying Tool use
in the request.
tools?array<>Server-sent events; each data: line is a GenerateContentResponse chunk
text/event-stream- response
Response from the model supporting multiple candidate responses.
Safety ratings and content filtering are reported for both
prompt in GenerateContentResponse.prompt_feedback and for each candidate
in finish_reason and in safety_ratings. The API:
- Returns either all requested candidates or none of them
- Returns no candidates at all only if there was something wrong with the
prompt (check
prompt_feedback) - Reports feedback on each candidate in
finish_reasonandsafety_ratings.
candidates?array<>Candidate responses from the model.
modelStatus?Output only. The current model status of this model.
modelVersion?stringOutput only. The model version used to generate the response.
promptFeedback?Returns the prompt's feedback related to the content filters.
responseId?stringOutput only. response_id is used to identify each response.
usageMetadata?Output only. Metadata on the generation requests' token usage.
curl -X POST 'https://api.ohmygpt.com/v1/models/string/string:streamGenerateContent' \ -H 'Content-Type: application/json' \ -d '{ "contents": [ {} ]}'{ "candidates": [ { "avgLogprobs": 0.1, "citationMetadata": { "citationSources": [ {} ] }, "content": { "parts": [ { "audioTranscription": null, "codeExecutionResult": null, "executableCode": null, "fileData": null, "functionCall": null, "functionResponse": null, "inlineData": null, "mediaProcessing": "MEDIA_PROCESSING_UNSPECIFIED", "mediaResolution": null, "partMetadata": { "property1": null, "property2": null }, "speechMetadata": null, "text": "string", "thought": true, "thoughtSignature": "string", "toolCall": null, "toolResponse": null, "videoMetadata": null } ], "role": "string" }, "continuationToken": "string", "finishMessage": "string", "finishReason": "FINISH_REASON_UNSPECIFIED", "groundingAttributions": [ { "content": { "parts": [ { "audioTranscription": null, "codeExecutionResult": null, "executableCode": null, "fileData": null, "functionCall": null, "functionResponse": null, "inlineData": null, "mediaProcessing": "MEDIA_PROCESSING_UNSPECIFIED", "mediaResolution": null, "partMetadata": { "property1": null, "property2": null }, "speechMetadata": null, "text": "string", "thought": true, "thoughtSignature": "string", "toolCall": null, "toolResponse": null, "videoMetadata": null } ], "role": "string" }, "sourceId": null } ], "groundingMetadata": { "googleMapsWidgetContextToken": "string", "groundingChunks": [ {} ], "groundingSupports": [ {} ], "imageSearchQueries": [ "string" ], "retrievalMetadata": null, "searchEntryPoint": null, "webSearchQueries": [ "string" ] }, "index": 0, "logprobsResult": { "chosenCandidates": [ {} ], "logProbabilitySum": 0.1, "topCandidates": [ {} ] }, "safetyRatings": [ { "blocked": true, "category": "HARM_CATEGORY_UNSPECIFIED", "probability": "HARM_PROBABILITY_UNSPECIFIED" } ], "tokenCount": 0, "urlContextMetadata": { "urlMetadata": [ {} ] } } ], "modelStatus": { "message": "string", "modelStage": "MODEL_STAGE_UNSPECIFIED", "retirementTime": "2019-08-24T14:15:22Z" }, "modelVersion": "string", "promptFeedback": { "blockReason": "BLOCK_REASON_UNSPECIFIED", "safetyRatings": [ { "blocked": true, "category": "HARM_CATEGORY_UNSPECIFIED", "probability": "HARM_PROBABILITY_UNSPECIFIED" } ] }, "responseId": "string", "usageMetadata": { "cacheTokensDetails": [ { "modality": null, "tokenCount": 0 } ], "cachedContentTokenCount": 0, "candidatesTokenCount": 0, "candidatesTokensDetails": [ { "modality": null, "tokenCount": 0 } ], "promptTokenCount": 0, "promptTokensDetails": [ { "modality": null, "tokenCount": 0 } ], "serviceTier": "unspecified", "thoughtsTokenCount": 0, "toolUsePromptTokenCount": 0, "toolUsePromptTokensDetails": [ { "modality": null, "tokenCount": 0 } ], "totalTokenCount": 0 }}List stored responses GET
Lists stored responses owned by the authenticated user, newest first. Deleted responses are excluded; every stored status is returned. Use `after` with the previous page's `last_id` to page backwards.
Send a message to the OhMyGPT team POST
Sends a sales inquiry, or a request for a catalog model that is not available yet, to [email protected]. A 202 response means the message is stored and will be delivered; it does not need to be sent again. Replies go to the email address in the message. Limited to a few messages per minute per IP address.