Generate content (Gemini)
Google Gemini generateContent, the endpoint the Google Gen AI SDKs call with base URL https://api.ohmygpt.com and API version v1. The model ID goes in the path, slash included: /v1/models/google/gemini-3.1-flash-lite:generateContent. Prefix it with provider: to pin one provider, as in /v1/models/google:google/gemini-3.1-flash-lite:generateContent. Gemini models and every other chat model in the catalog accept the same request and answer with a GenerateContentResponse.
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).
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<>Successful response
application/json- 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:generateContent' \ -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 }}Delete stored response DELETE
Deletes a locally stored response. Deleted, nonexistent, and cross-tenant responses all return the same not found boundary.
Retrieve stored response GET
Returns a response previously created without `store:false`. Only responses owned by the authenticated user are visible. The response `id` and `previous_response_id` fields use OhMyGPT response IDs.