> ## Documentation Index
> Fetch the complete documentation index at: https://gproxy.leenhawk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /v1beta/models/{model}:countTokens

> Available at the instance root or under a provider/namespace prefix. Shared paths select the wire dialect from client headers; without dialect evidence, the first listed route wins.



## OpenAPI

````yaml /generated/openapi.json post /v1beta/models/{model}:countTokens
openapi: 3.1.0
info:
  description: >-
    Forwarding, management, portal and OAuth APIs generated from Rust types.
    Input and output schemas preserve their respective Serde contracts.
    Streaming events and WebSocket messages are documented alongside HTTP
    payloads.
  title: GPROXY HTTP API
  version: 4.2.1
servers: []
security:
  - bearer: []
  - anthropicKey: []
  - googleKey: []
  - queryKey: []
paths:
  /v1beta/models/{model}:countTokens:
    post:
      tags:
        - Forwarding
      summary: POST /v1beta/models/{model}:countTokens
      description: >-
        Available at the instance root or under a provider/namespace prefix.
        Shared paths select the wire dialect from client headers; without
        dialect evidence, the first listed route wins.
      parameters:
        - in: path
          name: model
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Input_CountTokensRequestBody3'
        required: true
      responses:
        2XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_CountTokensResponseBody3'
          description: Successful protocol response
        default:
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Output_Envelope'
                  - properties:
                      error:
                        $ref: '#/components/schemas/Output_ErrorDetail'
                    required:
                      - error
                    type: object
                  - allOf:
                      - $ref: '#/components/schemas/Output_ErrorEvent'
                      - properties:
                          type:
                            const: error
                        required:
                          - type
                        type: object
                  - properties:
                      error:
                        $ref: '#/components/schemas/Output_GenerateContentError'
                    required:
                      - error
                    type: object
            text/plain:
              schema:
                type: string
          description: Gateway or upstream error
components:
  schemas:
    Input_CountTokensRequestBody3:
      additionalProperties: true
      description: >-
        Body for `POST .../{model=models/*}:countTokens`; `model` is the path
        resource.
      properties:
        contents:
          items:
            $ref: '#/components/schemas/Input_Content'
          type:
            - array
            - 'null'
        generateContentRequest:
          anyOf:
            - $ref: '#/components/schemas/Input_EmbeddedGenerateContentRequest'
            - type: 'null'
      type: object
    Output_CountTokensResponseBody3:
      additionalProperties: true
      properties:
        cacheTokensDetails:
          items:
            $ref: '#/components/schemas/Output_ModalityTokenCount'
          type:
            - array
            - 'null'
        cachedContentTokenCount:
          format: int64
          type:
            - integer
            - 'null'
        promptTokensDetails:
          items:
            $ref: '#/components/schemas/Output_ModalityTokenCount'
          type:
            - array
            - 'null'
        totalTokens:
          format: int64
          type:
            - integer
            - 'null'
      type: object
    Output_Envelope:
      properties:
        error:
          $ref: '#/components/schemas/Output_EnvelopeBody'
      required:
        - error
      type: object
    Output_ErrorDetail:
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
      required:
        - message
      type: object
    Output_ErrorEvent:
      additionalProperties: true
      properties:
        error:
          $ref: '#/components/schemas/Output_StreamError'
        request_id:
          type:
            - string
            - 'null'
      required:
        - error
      type: object
    Output_GenerateContentError:
      additionalProperties: true
      properties:
        code:
          format: int64
          type: integer
        details:
          items: true
          type:
            - array
            - 'null'
        message:
          type: string
        status:
          type:
            - string
            - 'null'
      required:
        - code
        - message
      type: object
    Input_Content:
      additionalProperties: true
      properties:
        parts:
          items:
            $ref: '#/components/schemas/Input_Part'
          type:
            - array
            - 'null'
        role:
          type:
            - string
            - 'null'
      type: object
    Input_EmbeddedGenerateContentRequest:
      additionalProperties: true
      description: |-
        Full `GenerateContentRequest` object accepted inside CountTokens. Its
        `model` is part of this embedded Batch API object; standalone REST
        generation keeps model in its path.
      properties:
        cachedContent:
          type:
            - string
            - 'null'
        contents:
          items:
            $ref: '#/components/schemas/Input_Content'
          type: array
        generationConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_GenerationConfig'
            - type: 'null'
        labels:
          additionalProperties:
            type: string
          type:
            - object
            - 'null'
        model:
          description: >-
            Required by the Batch API `GenerateContentRequest` embedded in
            CountTokens.
          type: string
        safetySettings:
          items:
            $ref: '#/components/schemas/Input_SafetySetting'
          type:
            - array
            - 'null'
        serviceTier:
          anyOf:
            - $ref: '#/components/schemas/Input_ServiceTier'
            - type: 'null'
        store:
          type:
            - boolean
            - 'null'
        systemInstruction:
          anyOf:
            - $ref: '#/components/schemas/Input_Content'
            - type: 'null'
        toolConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_ToolConfig'
            - type: 'null'
        tools:
          items:
            $ref: '#/components/schemas/Input_Tool3'
          type:
            - array
            - 'null'
      required:
        - model
        - contents
      type: object
    Output_ModalityTokenCount:
      additionalProperties: true
      properties:
        modality:
          anyOf:
            - $ref: '#/components/schemas/Output_Modality'
            - type: 'null'
        tokenCount:
          format: int64
          type:
            - integer
            - 'null'
      type: object
    Output_EnvelopeBody:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    Output_StreamError:
      additionalProperties: true
      properties:
        message:
          type: string
        type:
          $ref: '#/components/schemas/Output_StreamErrorType'
      required:
        - type
        - message
      type: object
    Input_Part:
      additionalProperties: true
      properties:
        audioTranscription:
          anyOf:
            - $ref: '#/components/schemas/Input_AudioTranscription'
            - type: 'null'
        codeExecutionResult:
          anyOf:
            - $ref: '#/components/schemas/Input_CodeExecutionResult2'
            - type: 'null'
        executableCode:
          anyOf:
            - $ref: '#/components/schemas/Input_ExecutableCode'
            - type: 'null'
        fileData:
          anyOf:
            - $ref: '#/components/schemas/Input_FileData'
            - type: 'null'
        functionCall:
          anyOf:
            - $ref: '#/components/schemas/Input_FunctionCall2'
            - type: 'null'
        functionResponse:
          anyOf:
            - $ref: '#/components/schemas/Input_FunctionResponse'
            - type: 'null'
        inlineData:
          anyOf:
            - $ref: '#/components/schemas/Input_Blob'
            - type: 'null'
        mediaProcessing:
          anyOf:
            - $ref: '#/components/schemas/Input_MediaProcessing'
            - type: 'null'
        mediaResolution:
          anyOf:
            - $ref: '#/components/schemas/Input_MediaResolution'
            - type: 'null'
        partMetadata:
          additionalProperties: true
          type:
            - object
            - 'null'
        speechMetadata:
          anyOf:
            - $ref: '#/components/schemas/Input_SpeechMetadata'
            - type: 'null'
        text:
          type:
            - string
            - 'null'
        thought:
          type:
            - boolean
            - 'null'
        thoughtSignature:
          type:
            - string
            - 'null'
        toolCall:
          anyOf:
            - $ref: '#/components/schemas/Input_ToolCall'
            - type: 'null'
        toolResponse:
          anyOf:
            - $ref: '#/components/schemas/Input_ToolResponse'
            - type: 'null'
        videoMetadata:
          anyOf:
            - $ref: '#/components/schemas/Input_VideoMetadata'
            - type: 'null'
      type: object
    Input_GenerationConfig:
      additionalProperties: true
      properties:
        _responseJsonSchema: true
        audioTranscriptionConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_AudioTranscriptionConfig'
            - type: 'null'
        candidateCount:
          format: int64
          type:
            - integer
            - 'null'
        enableAffectiveDialog:
          type:
            - boolean
            - 'null'
        enableEnhancedCivicAnswers:
          type:
            - boolean
            - 'null'
        frequencyPenalty:
          format: double
          type:
            - number
            - 'null'
        imageConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageConfig'
            - type: 'null'
        logprobs:
          format: int64
          type:
            - integer
            - 'null'
        maxOutputTokens:
          format: int64
          type:
            - integer
            - 'null'
        mediaResolution:
          anyOf:
            - $ref: '#/components/schemas/Input_GenerationMediaResolution'
            - type: 'null'
        presencePenalty:
          format: double
          type:
            - number
            - 'null'
        responseFormat:
          anyOf:
            - $ref: '#/components/schemas/Input_ResponseFormatConfig'
            - type: 'null'
        responseJsonSchema: true
        responseLogprobs:
          type:
            - boolean
            - 'null'
        responseMimeType:
          type:
            - string
            - 'null'
        responseModalities:
          items:
            $ref: '#/components/schemas/Input_Modality'
          type:
            - array
            - 'null'
        responseSchema:
          anyOf:
            - $ref: '#/components/schemas/Input_Schema'
            - type: 'null'
        seed:
          format: int64
          type:
            - integer
            - 'null'
        speechConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_SpeechConfig'
            - type: 'null'
        stopSequences:
          items:
            type: string
          type:
            - array
            - 'null'
        temperature:
          format: double
          type:
            - number
            - 'null'
        thinkingConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_ThinkingConfig2'
            - type: 'null'
        topK:
          format: int64
          type:
            - integer
            - 'null'
        topP:
          format: double
          type:
            - number
            - 'null'
        translationConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_TranslationConfig'
            - type: 'null'
      type: object
    Input_SafetySetting:
      additionalProperties: true
      properties:
        category:
          $ref: '#/components/schemas/Input_HarmCategory'
        threshold:
          $ref: '#/components/schemas/Input_HarmBlockThreshold'
      required:
        - category
        - threshold
      type: object
    Input_ServiceTier:
      enum:
        - unspecified
        - standard
        - flex
        - priority
      type: string
    Input_ToolConfig:
      additionalProperties: true
      properties:
        functionCallingConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_FunctionCallingConfig'
            - type: 'null'
        includeServerSideToolInvocations:
          type:
            - boolean
            - 'null'
        retrievalConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_RetrievalConfig'
            - type: 'null'
      type: object
    Input_Tool3:
      additionalProperties: true
      properties:
        codeExecution:
          anyOf:
            - $ref: '#/components/schemas/Input_CodeExecution'
            - type: 'null'
        computerUse:
          anyOf:
            - $ref: '#/components/schemas/Input_ComputerUse'
            - type: 'null'
        fileSearch:
          anyOf:
            - $ref: '#/components/schemas/Input_FileSearch'
            - type: 'null'
        functionDeclarations:
          items:
            $ref: '#/components/schemas/Input_FunctionDeclaration'
          type:
            - array
            - 'null'
        googleMaps:
          anyOf:
            - $ref: '#/components/schemas/Input_GoogleMaps'
            - type: 'null'
        googleSearch:
          anyOf:
            - $ref: '#/components/schemas/Input_GoogleSearch'
            - type: 'null'
        googleSearchRetrieval:
          anyOf:
            - $ref: '#/components/schemas/Input_GoogleSearchRetrieval'
            - type: 'null'
        mcpServers:
          items:
            $ref: '#/components/schemas/Input_McpServer'
          type:
            - array
            - 'null'
        urlContext:
          anyOf:
            - $ref: '#/components/schemas/Input_UrlContext'
            - type: 'null'
      type: object
    Output_Modality:
      enum:
        - MODALITY_UNSPECIFIED
        - TEXT
        - IMAGE
        - VIDEO
        - AUDIO
        - DOCUMENT
      type: string
    Output_StreamErrorType:
      enum:
        - api_error
        - authentication_error
        - billing_error
        - invalid_request_error
        - not_found_error
        - overloaded_error
        - permission_error
        - rate_limit_error
        - timeout_error
        - conflict_error
        - request_too_large
      type: string
    Input_AudioTranscription:
      additionalProperties: true
      properties:
        speakerLabel:
          type:
            - string
            - 'null'
        text:
          type: string
        words:
          items:
            $ref: '#/components/schemas/Input_WordInfo'
          type:
            - array
            - 'null'
      required:
        - text
      type: object
    Input_CodeExecutionResult2:
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - 'null'
        outcome:
          $ref: '#/components/schemas/Input_Outcome'
        output:
          type:
            - string
            - 'null'
      required:
        - outcome
      type: object
    Input_ExecutableCode:
      additionalProperties: true
      properties:
        code:
          type: string
        id:
          type:
            - string
            - 'null'
        language:
          $ref: '#/components/schemas/Input_Language'
      required:
        - language
        - code
      type: object
    Input_FileData:
      additionalProperties: true
      properties:
        displayName:
          type:
            - string
            - 'null'
        fileUri:
          type: string
        mimeType:
          type:
            - string
            - 'null'
      required:
        - fileUri
      type: object
    Input_FunctionCall2:
      additionalProperties: true
      properties:
        args:
          additionalProperties: true
          type:
            - object
            - 'null'
        id:
          type:
            - string
            - 'null'
        name:
          type: string
      required:
        - name
      type: object
    Input_FunctionResponse:
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - 'null'
        name:
          type: string
        parts:
          items:
            $ref: '#/components/schemas/Input_FunctionResponsePart'
          type:
            - array
            - 'null'
        response:
          additionalProperties: true
          type: object
        scheduling:
          anyOf:
            - $ref: '#/components/schemas/Input_Scheduling'
            - type: 'null'
        willContinue:
          type:
            - boolean
            - 'null'
      required:
        - name
        - response
      type: object
    Input_Blob:
      additionalProperties: true
      properties:
        data:
          type: string
        displayName:
          type:
            - string
            - 'null'
        mimeType:
          type: string
      required:
        - mimeType
        - data
      type: object
    Input_MediaProcessing:
      enum:
        - MEDIA_PROCESSING_UNSPECIFIED
        - STATIC
        - AGENTIC
      type: string
    Input_MediaResolution:
      additionalProperties: true
      properties:
        level:
          anyOf:
            - $ref: '#/components/schemas/Input_MediaResolutionLevel'
            - type: 'null'
      type: object
    Input_SpeechMetadata:
      additionalProperties: true
      properties:
        speaker:
          type:
            - string
            - 'null'
        style:
          type:
            - string
            - 'null'
      type: object
    Input_ToolCall:
      additionalProperties: true
      properties:
        args:
          additionalProperties: true
          type:
            - object
            - 'null'
        id:
          type:
            - string
            - 'null'
        toolName:
          type:
            - string
            - 'null'
        toolType:
          $ref: '#/components/schemas/Input_ToolType2'
      required:
        - toolType
      type: object
    Input_ToolResponse:
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - 'null'
        response:
          additionalProperties: true
          type:
            - object
            - 'null'
        toolType:
          $ref: '#/components/schemas/Input_ToolType2'
      required:
        - toolType
      type: object
    Input_VideoMetadata:
      additionalProperties: true
      properties:
        endOffset:
          type:
            - string
            - 'null'
        fps:
          format: double
          type:
            - number
            - 'null'
        startOffset:
          type:
            - string
            - 'null'
      type: object
    Input_AudioTranscriptionConfig:
      additionalProperties: true
      properties:
        adaptationPhrases:
          items:
            type: string
          type:
            - array
            - 'null'
        customVocabulary:
          items:
            type: string
          type:
            - array
            - 'null'
        diarization:
          type:
            - boolean
            - 'null'
        languageAuto:
          anyOf:
            - $ref: '#/components/schemas/Input_LanguageAuto'
            - type: 'null'
        languageCodes:
          items:
            type: string
          type:
            - array
            - 'null'
        languageHints:
          anyOf:
            - $ref: '#/components/schemas/Input_LanguageHints'
            - type: 'null'
        mode:
          anyOf:
            - $ref: '#/components/schemas/Input_AudioTranscriptionMode'
            - type: 'null'
        wordTimestamp:
          type:
            - boolean
            - 'null'
      type: object
    Input_ImageConfig:
      additionalProperties: true
      properties:
        aspectRatio:
          type:
            - string
            - 'null'
        imageSize:
          type:
            - string
            - 'null'
      type: object
    Input_GenerationMediaResolution:
      enum:
        - MEDIA_RESOLUTION_UNSPECIFIED
        - MEDIA_RESOLUTION_LOW
        - MEDIA_RESOLUTION_MEDIUM
        - MEDIA_RESOLUTION_HIGH
      type: string
    Input_ResponseFormatConfig:
      additionalProperties: true
      properties:
        audio:
          anyOf:
            - $ref: '#/components/schemas/Input_AudioResponseFormat'
            - type: 'null'
        image:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageResponseFormat'
            - type: 'null'
        text:
          anyOf:
            - $ref: '#/components/schemas/Input_TextResponseFormat'
            - type: 'null'
      type: object
    Input_Modality:
      enum:
        - MODALITY_UNSPECIFIED
        - TEXT
        - IMAGE
        - VIDEO
        - AUDIO
        - DOCUMENT
      type: string
    Input_Schema:
      additionalProperties: true
      properties:
        anyOf:
          items:
            $ref: '#/components/schemas/Input_Schema'
          type:
            - array
            - 'null'
        default: true
        description:
          type:
            - string
            - 'null'
        enum:
          items:
            type: string
          type:
            - array
            - 'null'
        example: true
        format:
          type:
            - string
            - 'null'
        items:
          anyOf:
            - $ref: '#/components/schemas/Input_Schema'
            - type: 'null'
        maxItems:
          type:
            - string
            - 'null'
        maxLength:
          type:
            - string
            - 'null'
        maxProperties:
          type:
            - string
            - 'null'
        maximum:
          format: double
          type:
            - number
            - 'null'
        minItems:
          type:
            - string
            - 'null'
        minLength:
          type:
            - string
            - 'null'
        minProperties:
          type:
            - string
            - 'null'
        minimum:
          format: double
          type:
            - number
            - 'null'
        nullable:
          type:
            - boolean
            - 'null'
        pattern:
          type:
            - string
            - 'null'
        properties:
          additionalProperties:
            $ref: '#/components/schemas/Input_Schema'
          type:
            - object
            - 'null'
        propertyOrdering:
          items:
            type: string
          type:
            - array
            - 'null'
        required:
          items:
            type: string
          type:
            - array
            - 'null'
        title:
          type:
            - string
            - 'null'
        type:
          $ref: '#/components/schemas/Input_SchemaType'
      required:
        - type
      type: object
    Input_SpeechConfig:
      additionalProperties: true
      properties:
        languageCode:
          type:
            - string
            - 'null'
        multiSpeakerVoiceConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_MultiSpeakerVoiceConfig'
            - type: 'null'
        voiceConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_VoiceConfig'
            - type: 'null'
      type: object
    Input_ThinkingConfig2:
      additionalProperties: true
      properties:
        includeThoughts:
          type:
            - boolean
            - 'null'
        thinkingBudget:
          format: int64
          type:
            - integer
            - 'null'
        thinkingLevel:
          anyOf:
            - $ref: '#/components/schemas/Input_ThinkingLevel'
            - type: 'null'
      type: object
    Input_TranslationConfig:
      additionalProperties: true
      properties:
        echoTargetLanguage:
          type:
            - boolean
            - 'null'
        targetLanguageCode:
          type:
            - string
            - 'null'
      type: object
    Input_HarmCategory:
      enum:
        - HARM_CATEGORY_UNSPECIFIED
        - HARM_CATEGORY_HARASSMENT
        - HARM_CATEGORY_HATE_SPEECH
        - HARM_CATEGORY_SEXUALLY_EXPLICIT
        - HARM_CATEGORY_DANGEROUS_CONTENT
        - HARM_CATEGORY_CIVIC_INTEGRITY
        - HARM_CATEGORY_DEROGATORY
        - HARM_CATEGORY_TOXICITY
        - HARM_CATEGORY_VIOLENCE
        - HARM_CATEGORY_SEXUAL
        - HARM_CATEGORY_MEDICAL
        - HARM_CATEGORY_DANGEROUS
        - HARM_CATEGORY_JAILBREAK
      type: string
    Input_HarmBlockThreshold:
      enum:
        - HARM_BLOCK_THRESHOLD_UNSPECIFIED
        - BLOCK_LOW_AND_ABOVE
        - BLOCK_MEDIUM_AND_ABOVE
        - BLOCK_ONLY_HIGH
        - BLOCK_NONE
        - 'OFF'
      type: string
    Input_FunctionCallingConfig:
      additionalProperties: true
      properties:
        allowedFunctionNames:
          items:
            type: string
          type:
            - array
            - 'null'
        mode:
          anyOf:
            - $ref: '#/components/schemas/Input_FunctionCallingMode'
            - type: 'null'
      type: object
    Input_RetrievalConfig:
      additionalProperties: true
      properties:
        languageCode:
          type:
            - string
            - 'null'
        latLng:
          anyOf:
            - $ref: '#/components/schemas/Input_LatLng'
            - type: 'null'
      type: object
    Input_CodeExecution:
      additionalProperties: true
      type: object
    Input_ComputerUse:
      additionalProperties: true
      properties:
        disabledSafetyPolicies:
          items:
            $ref: '#/components/schemas/Input_ComputerUseSafetyPolicy'
          type:
            - array
            - 'null'
        enablePromptInjectionDetection:
          type:
            - boolean
            - 'null'
        environment:
          $ref: '#/components/schemas/Input_ComputerEnvironment2'
        excludedPredefinedFunctions:
          items:
            type: string
          type:
            - array
            - 'null'
      required:
        - environment
      type: object
    Input_FileSearch:
      additionalProperties: true
      properties:
        fileSearchStoreNames:
          items:
            type: string
          type: array
        metadataFilter:
          type:
            - string
            - 'null'
        topK:
          format: int64
          type:
            - integer
            - 'null'
      required:
        - fileSearchStoreNames
      type: object
    Input_FunctionDeclaration:
      additionalProperties: true
      properties:
        behavior:
          anyOf:
            - $ref: '#/components/schemas/Input_Behavior'
            - type: 'null'
        description:
          type: string
        name:
          type: string
        parameters:
          anyOf:
            - $ref: '#/components/schemas/Input_Schema'
            - type: 'null'
        parametersJsonSchema: true
        response:
          anyOf:
            - $ref: '#/components/schemas/Input_Schema'
            - type: 'null'
        responseJsonSchema: true
      required:
        - name
        - description
      type: object
    Input_GoogleMaps:
      additionalProperties: true
      properties:
        enableWidget:
          type:
            - boolean
            - 'null'
      type: object
    Input_GoogleSearch:
      additionalProperties: true
      properties:
        searchTypes:
          anyOf:
            - $ref: '#/components/schemas/Input_SearchTypes'
            - type: 'null'
        timeRangeFilter:
          anyOf:
            - $ref: '#/components/schemas/Input_Interval'
            - type: 'null'
      type: object
    Input_GoogleSearchRetrieval:
      additionalProperties: true
      properties:
        dynamicRetrievalConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_DynamicRetrievalConfig'
            - type: 'null'
      type: object
    Input_McpServer:
      additionalProperties: true
      properties:
        name:
          type: string
        streamableHttpTransport:
          anyOf:
            - $ref: '#/components/schemas/Input_StreamableHttpTransport'
            - type: 'null'
      required:
        - name
      type: object
    Input_UrlContext:
      additionalProperties: true
      type: object
    Input_WordInfo:
      additionalProperties: true
      properties:
        endOffset:
          type:
            - string
            - 'null'
        startOffset:
          type:
            - string
            - 'null'
        word:
          type: string
      required:
        - word
      type: object
    Input_Outcome:
      enum:
        - OUTCOME_UNSPECIFIED
        - OUTCOME_OK
        - OUTCOME_FAILED
        - OUTCOME_DEADLINE_EXCEEDED
      type: string
    Input_Language:
      enum:
        - LANGUAGE_UNSPECIFIED
        - PYTHON
      type: string
    Input_FunctionResponsePart:
      additionalProperties: true
      properties:
        inlineData:
          anyOf:
            - $ref: '#/components/schemas/Input_Blob'
            - type: 'null'
      type: object
    Input_Scheduling:
      enum:
        - SCHEDULING_UNSPECIFIED
        - SILENT
        - WHEN_IDLE
        - INTERRUPT
      type: string
    Input_MediaResolutionLevel:
      enum:
        - MEDIA_RESOLUTION_UNSPECIFIED
        - MEDIA_RESOLUTION_LOW
        - MEDIA_RESOLUTION_MEDIUM
        - MEDIA_RESOLUTION_HIGH
        - MEDIA_RESOLUTION_ULTRA_HIGH
      type: string
    Input_ToolType2:
      enum:
        - TOOL_TYPE_UNSPECIFIED
        - GOOGLE_SEARCH_WEB
        - GOOGLE_SEARCH_IMAGE
        - URL_CONTEXT
        - GOOGLE_MAPS
        - FILE_SEARCH
      type: string
    Input_LanguageAuto:
      additionalProperties: true
      type: object
    Input_LanguageHints:
      additionalProperties: true
      properties:
        languageCodes:
          items:
            type: string
          type:
            - array
            - 'null'
      type: object
    Input_AudioTranscriptionMode:
      enum:
        - MODE_UNSPECIFIED
        - VERBATIM
        - SMART
      type: string
    Input_AudioResponseFormat:
      additionalProperties: true
      properties:
        bitRate:
          format: int64
          type:
            - integer
            - 'null'
        delivery:
          anyOf:
            - $ref: '#/components/schemas/Input_Delivery'
            - type: 'null'
        mimeType:
          anyOf:
            - $ref: '#/components/schemas/Input_AudioMimeType'
            - type: 'null'
        sampleRate:
          format: int64
          type:
            - integer
            - 'null'
      type: object
    Input_ImageResponseFormat:
      additionalProperties: true
      properties:
        aspectRatio:
          anyOf:
            - $ref: '#/components/schemas/Input_AspectRatio'
            - type: 'null'
        delivery:
          anyOf:
            - $ref: '#/components/schemas/Input_Delivery'
            - type: 'null'
        imageSize:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageSize'
            - type: 'null'
        mimeType:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageMimeType'
            - type: 'null'
      type: object
    Input_TextResponseFormat:
      additionalProperties: true
      properties:
        mimeType:
          anyOf:
            - $ref: '#/components/schemas/Input_TextMimeType'
            - type: 'null'
        schema: true
      type: object
    Input_SchemaType:
      enum:
        - TYPE_UNSPECIFIED
        - STRING
        - NUMBER
        - INTEGER
        - BOOLEAN
        - ARRAY
        - OBJECT
        - 'NULL'
      type: string
    Input_MultiSpeakerVoiceConfig:
      additionalProperties: true
      properties:
        speakerVoiceConfigs:
          items:
            $ref: '#/components/schemas/Input_SpeakerVoiceConfig'
          type: array
      required:
        - speakerVoiceConfigs
      type: object
    Input_VoiceConfig:
      additionalProperties: true
      properties:
        prebuiltVoiceConfig:
          anyOf:
            - $ref: '#/components/schemas/Input_PrebuiltVoiceConfig'
            - type: 'null'
        voice:
          description: >-
            Prebuilt speaker name, stored `voice_...` ID, or client-managed
            `voicekey_...`.
          type:
            - string
            - 'null'
      type: object
    Input_ThinkingLevel:
      enum:
        - THINKING_LEVEL_UNSPECIFIED
        - MINIMAL
        - LOW
        - MEDIUM
        - HIGH
      type: string
    Input_FunctionCallingMode:
      enum:
        - MODE_UNSPECIFIED
        - AUTO
        - ANY
        - NONE
        - VALIDATED
      type: string
    Input_LatLng:
      additionalProperties: true
      properties:
        latitude:
          format: double
          type: number
        longitude:
          format: double
          type: number
      required:
        - latitude
        - longitude
      type: object
    Input_ComputerUseSafetyPolicy:
      enum:
        - SAFETY_POLICY_UNSPECIFIED
        - FINANCIAL_TRANSACTIONS
        - SENSITIVE_DATA_MODIFICATION
        - COMMUNICATION_TOOL
        - ACCOUNT_CREATION
        - DATA_MODIFICATION
        - USER_CONSENT_MANAGEMENT
        - LEGAL_TERMS_AND_AGREEMENTS
      type: string
    Input_ComputerEnvironment2:
      enum:
        - ENVIRONMENT_UNSPECIFIED
        - ENVIRONMENT_BROWSER
        - ENVIRONMENT_MOBILE
        - ENVIRONMENT_DESKTOP
      type: string
    Input_Behavior:
      enum:
        - UNSPECIFIED
        - BLOCKING
        - NON_BLOCKING
      type: string
    Input_SearchTypes:
      additionalProperties: true
      properties:
        imageSearch:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageSearch'
            - type: 'null'
        webSearch:
          anyOf:
            - $ref: '#/components/schemas/Input_WebSearch'
            - type: 'null'
      type: object
    Input_Interval:
      additionalProperties: true
      properties:
        endTime:
          type:
            - string
            - 'null'
        startTime:
          type:
            - string
            - 'null'
      type: object
    Input_DynamicRetrievalConfig:
      additionalProperties: true
      properties:
        dynamicThreshold:
          format: double
          type:
            - number
            - 'null'
        mode:
          anyOf:
            - $ref: '#/components/schemas/Input_RetrievalMode'
            - type: 'null'
      type: object
    Input_StreamableHttpTransport:
      additionalProperties: true
      properties:
        headers:
          additionalProperties:
            type: string
          type:
            - object
            - 'null'
        sseReadTimeout:
          type:
            - string
            - 'null'
        terminateOnClose:
          type:
            - boolean
            - 'null'
        timeout:
          type:
            - string
            - 'null'
        url:
          type: string
      required:
        - url
      type: object
    Input_Delivery:
      enum:
        - DELIVERY_UNSPECIFIED
        - INLINE
        - URI
      type: string
    Input_AudioMimeType:
      enum:
        - MIME_TYPE_UNSPECIFIED
        - AUDIO_MP3
        - AUDIO_OGG_OPUS
        - AUDIO_L16
        - AUDIO_WAV
        - AUDIO_ALAW
        - AUDIO_MULAW
      type: string
    Input_AspectRatio:
      enum:
        - ASPECT_RATIO_UNSPECIFIED
        - ASPECT_RATIO_ONE_BY_ONE
        - ASPECT_RATIO_TWO_BY_THREE
        - ASPECT_RATIO_THREE_BY_TWO
        - ASPECT_RATIO_THREE_BY_FOUR
        - ASPECT_RATIO_FOUR_BY_THREE
        - ASPECT_RATIO_FOUR_BY_FIVE
        - ASPECT_RATIO_FIVE_BY_FOUR
        - ASPECT_RATIO_NINE_BY_SIXTEEN
        - ASPECT_RATIO_SIXTEEN_BY_NINE
        - ASPECT_RATIO_TWENTY_ONE_BY_NINE
        - ASPECT_RATIO_ONE_BY_EIGHT
        - ASPECT_RATIO_EIGHT_BY_ONE
        - ASPECT_RATIO_ONE_BY_FOUR
        - ASPECT_RATIO_FOUR_BY_ONE
      type: string
    Input_ImageSize:
      enum:
        - IMAGE_SIZE_UNSPECIFIED
        - IMAGE_SIZE_FIVE_TWELVE
        - IMAGE_SIZE_ONE_K
        - IMAGE_SIZE_TWO_K
        - IMAGE_SIZE_FOUR_K
      type: string
    Input_ImageMimeType:
      enum:
        - MIME_TYPE_UNSPECIFIED
        - IMAGE_JPEG
      type: string
    Input_TextMimeType:
      enum:
        - MIME_TYPE_UNSPECIFIED
        - APPLICATION_JSON
        - TEXT_PLAIN
      type: string
    Input_SpeakerVoiceConfig:
      additionalProperties: true
      properties:
        speaker:
          type: string
        voiceConfig:
          $ref: '#/components/schemas/Input_VoiceConfig'
      required:
        - speaker
        - voiceConfig
      type: object
    Input_PrebuiltVoiceConfig:
      additionalProperties: true
      properties:
        voiceName:
          type:
            - string
            - 'null'
      type: object
    Input_ImageSearch:
      additionalProperties: true
      type: object
    Input_WebSearch:
      additionalProperties: true
      type: object
    Input_RetrievalMode:
      enum:
        - MODE_UNSPECIFIED
        - MODE_DYNAMIC
      type: string
  securitySchemes:
    bearer:
      scheme: bearer
      type: http
    anthropicKey:
      in: header
      name: x-api-key
      type: apiKey
    googleKey:
      in: header
      name: x-goog-api-key
      type: apiKey
    queryKey:
      in: query
      name: key
      type: apiKey

````

## Related topics

- [Routing & Endpoints](https://gproxy.leenhawk.com/reference/routing-table.md)
- [POST /v1beta/models/{model}:batchEmbedContents](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1betamodels-:batchembedcontents.md)
- [POST /v1beta/models/{model}:embedContent](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1betamodels-:embedcontent.md)
- [POST /v1beta/models/{model}:generateContent](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1betamodels-:generatecontent.md)
- [POST /v1beta/models/{model}:streamGenerateContent](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1betamodels-:streamgeneratecontent.md)


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