> ## Documentation Index
> Fetch the complete documentation index at: https://gomodel.enterpilot.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate content (Gemini API)

> GoModel API reference for POST /v1beta/models/{model}:generateContent: Generate content (Gemini API).



## OpenAPI

````yaml /openapi.json post /v1beta/models/{model}:generateContent
openapi: 3.0.0
info:
  description: >-
    AI gateway routing requests to multiple LLM providers (OpenAI, Anthropic,
    Gemini, Groq, Fireworks AI, Meta, OpenRouter, Kilo AI, DeepSeek, Z.ai, xAI,
    MiniMax, Xiaomi MiMo, Mistral AI, OpenCode Go, Oracle, Ollama, Bailian).
    Drop-in OpenAI-compatible API.
  title: GoModel API
  contact: {}
  version: '1.0'
servers:
  - url: '{base_url}'
    description: Edit the base URL to point at your GoModel deployment.
    variables:
      base_url:
        default: http://localhost:8080
        description: Your GoModel deployment URL
security: []
paths:
  /v1beta/models/{model}:generateContent:
    post:
      tags:
        - gemini
      summary: Generate content (Gemini API)
      parameters:
        - description: Model ID, e.g. gemini-2.5-flash or openai/gpt-4o-mini
          name: model
          in: path
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/geminiapi.GenerateContentRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/geminiapi.GenerateContentResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/geminiapi.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/geminiapi.ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/geminiapi.ErrorResponse'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/geminiapi.ErrorResponse'
      security:
        - BearerAuth: []
        - GeminiApiKey: []
        - GeminiQueryKey: []
components:
  requestBodies:
    geminiapi.GenerateContentRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/geminiapi.GenerateContentRequest'
      description: Gemini generateContent request
      required: true
  schemas:
    geminiapi.GenerateContentResponse:
      type: object
      properties:
        candidates:
          type: array
          items:
            $ref: '#/components/schemas/geminiapi.Candidate'
        modelVersion:
          type: string
        responseId:
          type: string
        usageMetadata:
          $ref: '#/components/schemas/geminiapi.UsageMetadata'
    geminiapi.ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/geminiapi.ErrorObject'
    geminiapi.GenerateContentRequest:
      type: object
      required:
        - contents
      properties:
        cachedContent:
          description: |-
            CachedContent is not supported: a request that sets it is refused
            with a 400.
          type: string
        contents:
          type: array
          items:
            $ref: '#/components/schemas/geminiapi.Content'
        generationConfig:
          $ref: '#/components/schemas/geminiapi.GenerationConfig'
        safetySettings:
          description: |-
            SafetySettings are accepted and ignored: they have no portable
            equivalent, and a provider's own defaults apply.
          type: array
          items:
            type: object
        store:
          description: |-
            Store is whether the provider may retain the request. It is carried
            as the Chat Completions store flag, which means the same.
          type: boolean
        systemInstruction:
          $ref: '#/components/schemas/geminiapi.Content'
        toolConfig:
          $ref: '#/components/schemas/geminiapi.ToolConfig'
        tools:
          type: array
          items:
            $ref: '#/components/schemas/geminiapi.Tool'
    geminiapi.Candidate:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/geminiapi.ResponseContent'
        finishReason:
          type: string
        index:
          type: integer
    geminiapi.UsageMetadata:
      type: object
      properties:
        cachedContentTokenCount:
          type: integer
        candidatesTokenCount:
          type: integer
        promptTokenCount:
          type: integer
        thoughtsTokenCount:
          type: integer
        totalTokenCount:
          type: integer
    geminiapi.ErrorObject:
      type: object
      properties:
        code:
          description: Code is the HTTP status code.
          type: integer
        message:
          type: string
        status:
          description: Status is the canonical gRPC status name, e.g. INVALID_ARGUMENT.
          type: string
    geminiapi.Content:
      type: object
      properties:
        parts:
          type: array
          items:
            $ref: '#/components/schemas/geminiapi.Part'
        role:
          type: string
    geminiapi.GenerationConfig:
      type: object
      properties:
        candidateCount:
          description: CandidateCount above 1 is refused with a 400.
          type: integer
        frequencyPenalty:
          type: number
        maxOutputTokens:
          type: integer
        presencePenalty:
          type: number
        responseJsonSchema:
          type: object
        responseMimeType:
          type: string
        responseModalities:
          description: ResponseModalities other than TEXT are refused with a 400.
          type: array
          items:
            type: string
        responseSchema:
          type: object
        seed:
          type: integer
        stopSequences:
          type: array
          items:
            type: string
        temperature:
          type: number
        thinkingConfig:
          $ref: '#/components/schemas/geminiapi.ThinkingConfig'
        topP:
          type: number
    geminiapi.ToolConfig:
      type: object
      properties:
        functionCallingConfig:
          $ref: '#/components/schemas/geminiapi.FunctionCallingConfig'
    geminiapi.Tool:
      type: object
      properties:
        functionDeclarations:
          type: array
          items:
            $ref: '#/components/schemas/geminiapi.FunctionDeclaration'
    geminiapi.ResponseContent:
      type: object
      properties:
        parts:
          type: array
          items:
            $ref: '#/components/schemas/geminiapi.ResponsePart'
        role:
          type: string
    geminiapi.Part:
      type: object
      properties:
        functionCall:
          $ref: '#/components/schemas/geminiapi.FunctionCall'
        functionResponse:
          $ref: '#/components/schemas/geminiapi.FunctionResponse'
        inlineData:
          $ref: '#/components/schemas/geminiapi.Blob'
        text:
          type: string
        thought:
          description: Thought marks model reasoning, as opposed to the answer.
          type: boolean
        thoughtSignature:
          description: >-
            ThoughtSignature is opaque state Gemini 3 and later return on a part
            and

            require back unchanged when the conversation continues.
          type: string
    geminiapi.ThinkingConfig:
      type: object
      properties:
        includeThoughts:
          type: boolean
        thinkingBudget:
          type: integer
        thinkingLevel:
          type: string
    geminiapi.FunctionCallingConfig:
      type: object
      properties:
        allowedFunctionNames:
          type: array
          items:
            type: string
        mode:
          type: string
    geminiapi.FunctionDeclaration:
      type: object
      properties:
        description:
          type: string
        name:
          type: string
        parameters:
          type: object
        parametersJsonSchema:
          type: object
    geminiapi.ResponsePart:
      type: object
      properties:
        functionCall:
          $ref: '#/components/schemas/geminiapi.FunctionCall'
        text:
          type: string
        thought:
          type: boolean
        thoughtSignature:
          type: string
    geminiapi.FunctionCall:
      type: object
      properties:
        args:
          type: object
        id:
          type: string
        name:
          type: string
    geminiapi.FunctionResponse:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        response:
          type: object
    geminiapi.Blob:
      type: object
      properties:
        data:
          type: string
        mimeType:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    GeminiApiKey:
      description: >-
        A GoModel key sent the way Gemini SDKs send theirs. Accepted on /v1beta
        routes only.
      type: apiKey
      name: x-goog-api-key
      in: header
    GeminiQueryKey:
      description: >-
        A GoModel key in the query, as plain Gemini REST calls send theirs.
        Accepted on /v1beta routes only; prefer the header, since a URL can end
        up in the logs of a proxy.
      type: apiKey
      name: key
      in: query

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.