Google Gemini Gemini Files API

The Gemini Files API from Google Gemini — 3 operation(s) for gemini files.

GitHub OpenAPI

Operations 4

POST /v1beta/files:register Register files #
GET /v1beta/files List files #
DELETE /v1beta/files/{filesId} Delete files #
GET /v1beta/files/{filesId} Get files #

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-files-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-files-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Gemini Files API
  version: v1beta
  description: Generated from Google's published Discovery document for Gemini API (generativelanguage v1beta, revision 20261111). 4 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://generativelanguage.googleapis.com
tags:
- name: Files
paths:
  /v1beta/files:register:
    post:
      operationId: generativelanguage.files.register
      summary: Register files
      description: Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterFilesRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterFilesResponse'
        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: []
      tags:
      - Files
  /v1beta/files:
    get:
      operationId: generativelanguage.files.list
      summary: List files
      description: Lists the metadata for `File`s owned by the requesting project.
      parameters:
      - name: pageSize
        in: query
        required: false
        description: Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100.
        schema:
          format: int32
          type: integer
      - name: pageToken
        in: query
        required: false
        description: Optional. A page token from a previous `ListFiles` call.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFilesResponse'
        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: []
      tags:
      - Files
  /v1beta/files/{filesId}:
    delete:
      operationId: generativelanguage.files.delete
      summary: Delete files
      description: Deletes the `File`.
      parameters:
      - name: filesId
        in: path
        required: true
        description: Resource name segment (filesId).
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
        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: []
      tags:
      - Files
    get:
      operationId: generativelanguage.files.get
      summary: Get files
      description: Gets the metadata for the given `File`.
      parameters:
      - name: filesId
        in: path
        required: true
        description: Resource name segment (filesId).
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        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: []
      tags:
      - Files
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
    RegisterFilesResponse:
      description: Response for `RegisterFiles`.
      properties:
        files:
          description: The registered files to be used when calling GenerateContent.
          type: array
          items:
            $ref: '#/components/schemas/File'
      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).'
    RegisterFilesRequest:
      description: Request for `RegisterFiles`.
      properties:
        uris:
          items:
            type: string
          type: array
          description: 'Required. The Google Cloud Storage URIs to register. Example: `gs://bucket/object`.'
      type: object
    Empty:
      type: object
      description: 'A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }'
      properties: {}
    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
    ListFilesResponse:
      description: Response for `ListFiles`.
      properties:
        nextPageToken:
          type: string
          description: A token that can be sent as a `page_token` into a subsequent `ListFiles` call.
        files:
          items:
            $ref: '#/components/schemas/File'
          description: The list of `File`s.
          type: array
      type: object
    VideoFileMetadata:
      properties:
        videoDuration:
          description: Duration of the video.
          format: google-duration
          type: string
      type: object
      description: Metadata for a video `File`.
  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)