Google Gemini Gemini Media API

The Gemini Media API from Google Gemini — 2 operation(s) for gemini media.

GitHub OpenAPI

Operations 2

POST /v1beta/files Upload media #
POST /v1beta/fileSearchStores/{fileSearchStoresId}:uploadToFileSearchStore Upload to file search store media #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/google-gemini:google-gemini-media-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

google-gemini-media-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Gemini Media API
  version: v1beta
  description: Generated from Google's published Discovery document for Gemini API (generativelanguage v1beta, revision 20261111). 2 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://generativelanguage.googleapis.com
tags:
- name: Media
paths:
  /v1beta/files:
    post:
      operationId: generativelanguage.media.upload
      summary: Upload media
      description: Creates a `File`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFileRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateFileResponse'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/devstorage.read_only
      - apiKey: []
      x-google-media-upload:
        maxSize: '2147483648'
        protocols:
          simple:
            path: /upload/v1beta/files
            multipart: true
          resumable:
            multipart: true
            path: /resumable/upload/v1beta/files
        accept:
        - '*/*'
      tags:
      - Media
  /v1beta/fileSearchStores/{fileSearchStoresId}:uploadToFileSearchStore:
    post:
      operationId: generativelanguage.media.uploadToFileSearchStore
      summary: Upload to file search store media
      description: Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document.
      parameters:
      - name: fileSearchStoresId
        in: path
        required: true
        description: Resource name segment (fileSearchStoresId).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadToFileSearchStoreRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomLongRunningOperation'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/devstorage.read_only
      - apiKey: []
      x-google-media-upload:
        maxSize: '104857600'
        protocols:
          resumable:
            multipart: true
            path: /resumable/upload/v1beta/{+fileSearchStoreName}:uploadToFileSearchStore
          simple:
            path: /upload/v1beta/{+fileSearchStoreName}:uploadToFileSearchStore
            multipart: true
        accept:
        - '*/*'
      tags:
      - Media
components:
  schemas:
    File:
      properties:
        updateTime:
          format: google-datetime
          type: string
          description: Output only. The timestamp of when the `File` was last updated.
          readOnly: true
        displayName:
          description: 'Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: "Welcome Image"'
          type: string
        source:
          type: string
          description: Source of the File.
          enum:
          - SOURCE_UNSPECIFIED
          - UPLOADED
          - GENERATED
          - REGISTERED
        createTime:
          readOnly: true
          format: google-datetime
          description: Output only. The timestamp of when the `File` was created.
          type: string
        expirationTime:
          type: string
          format: google-datetime
          readOnly: true
          description: Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.
        videoMetadata:
          $ref: '#/components/schemas/VideoFileMetadata'
          description: Output only. Metadata for a video.
        mimeType:
          description: Output only. MIME type of the file.
          readOnly: true
          type: string
        sizeBytes:
          type: string
          readOnly: true
          format: int64
          description: Output only. Size of the file in bytes.
        sha256Hash:
          readOnly: true
          type: string
          description: Output only. SHA-256 hash of the uploaded bytes.
          format: byte
        error:
          $ref: '#/components/schemas/Status'
          description: Output only. Error status if File processing failed.
        state:
          description: Output only. Processing state of the File.
          readOnly: true
          type: string
          enum:
          - STATE_UNSPECIFIED
          - PROCESSING
          - ACTIVE
          - FAILED
        uri:
          type: string
          readOnly: true
          description: Output only. The uri of the `File`.
        downloadUri:
          description: Output only. The download uri of the `File`.
          type: string
          readOnly: true
        name:
          type: string
          description: 'Immutable. Identifier. The `File` resource name. The ID (name excluding the "files/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`'
      description: A file uploaded to the API.
      type: object
    StringList:
      properties:
        values:
          items:
            type: string
          description: The string values of the metadata to store.
          type: array
      type: object
      description: User provided string values assigned to a single metadata key.
    UploadToFileSearchStoreRequest:
      properties:
        customMetadata:
          type: array
          description: Custom metadata to be associated with the data.
          items:
            $ref: '#/components/schemas/CustomMetadata'
        mimeType:
          description: Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content.
          type: string
        chunkingConfig:
          $ref: '#/components/schemas/ChunkingConfig'
          description: Optional. Config for telling the service how to chunk the data. If not provided, the service will use default parameters.
        displayName:
          type: string
          description: Optional. Display name of the created document.
      description: Request for `UploadToFileSearchStore`.
      type: object
    Status:
      properties:
        details:
          description: A list of messages that carry the error details. There is a common set of message types for APIs to use.
          type: array
          items:
            type: object
            additionalProperties:
              description: Properties of the object. Contains field @type with type URL.
        message:
          description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
          type: string
        code:
          description: The status code, which should be an enum value of google.rpc.Code.
          format: int32
          type: integer
      type: object
      description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).'
    CreateFileResponse:
      type: object
      properties:
        file:
          $ref: '#/components/schemas/File'
          description: Metadata for the created file.
      description: Response for `CreateFile`.
    WhiteSpaceConfig:
      description: Configuration for a white space chunking algorithm [white space delimited].
      properties:
        maxOverlapTokens:
          format: int32
          type: integer
          description: Maximum number of overlapping tokens between two adjacent chunks.
        maxTokensPerChunk:
          type: integer
          format: int32
          description: 'Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow.'
      type: object
    CustomMetadata:
      type: object
      properties:
        stringValue:
          type: string
          description: The string value of the metadata to store.
        stringListValue:
          $ref: '#/components/schemas/StringList'
          description: The StringList value of the metadata to store.
        key:
          description: Required. The key of the metadata to store.
          type: string
        numericValue:
          format: float
          type: number
          description: The numeric value of the metadata to store.
      description: User provided metadata stored as key-value pairs.
    GoogleRpcError:
      type: object
      description: The error envelope every Google API returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            status:
              type: string
            details:
              type: array
              items:
                type: object
    CustomLongRunningOperation:
      properties:
        error:
          $ref: '#/components/schemas/Status'
          description: The error result of the operation in case of failure or cancellation.
        response:
          additionalProperties:
            description: Properties of the object. Contains field @type with type URL.
          description: The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
          type: object
        done:
          description: If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
          type: boolean
        name:
          type: string
          description: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
        metadata:
          type: object
          description: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
          additionalProperties:
            description: Properties of the object. Contains field @type with type URL.
      type: object
    CreateFileRequest:
      properties:
        file:
          $ref: '#/components/schemas/File'
          description: Optional. Metadata for the file to create.
      description: Request for `CreateFile`.
      type: object
    VideoFileMetadata:
      properties:
        videoDuration:
          description: Duration of the video.
          format: google-duration
          type: string
      type: object
      description: Metadata for a video `File`.
    ChunkingConfig:
      type: object
      properties:
        whiteSpaceConfig:
          $ref: '#/components/schemas/WhiteSpaceConfig'
          description: White space chunking configuration.
      description: Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: key
      description: API key; accepted by methods that do not need user data.
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/devstorage.read_only: View your data in Google Cloud Storage
externalDocs:
  url: https://developers.generativeai.google/api
x-provenance:
  method: harvested
  publisher: Google
  source: https://generativelanguage.googleapis.com/$discovery/rest?version=v1beta
  note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261111)