> ## AI Agent Context
> - Full documentation index: https://aistudio.google.com/llms.txt
> - Gemini Docs MCP server (consistent live info): https://gemini-api-docs-mcp.dev
> - Coding agent skills & setup guide: https://aistudio.google.com/docs/coding-agents.md

# Listing batches

{% mark class="http-get" %}{% icon name="south_west" /%}`GET`{% /mark %} `https://generativelanguage.googleapis.com/v1beta/batches`

Lists operations that match the specified filter in the request. If the
server doesn't support this method, it returns `UNIMPLEMENTED`.

{% two-column-layout %}
  {% left-column %}
## Parameters  {% class="hide-from-toc" id="parameters" %}

  {% section class="api-ref-property-list" %}
  **filter**: `string`

  The standard list filter.

  {% hr /%}

  **pageSize**: `integer`

  The standard list page size.

  {% hr /%}

  **pageToken**: `string`

  The standard list page token.

  {% hr /%}

  **returnPartialSuccess**: `boolean`

  When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `"projects/example/locations/-"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.

  {% /section %}

  {% /left-column %}

  {% right-column class="sticky" %}
  **Example request** {% class="example-heading" %}

  {% tabs %}
  {% tab label="REST" %}
  ```sh
  curl -X GET "https://generativelanguage.googleapis.com/v1beta/batches" \
    -H "x-goog-api-key: $GEMINI_API_KEY"
  ```

  {% /tab %}

  {% /tabs %}

  {% /right-column %}

{% /two-column-layout %}

{% two-column-layout %}
  {% left-column %}
## Response  {% class="hide-from-toc" id="response" %}

  {% section class="api-ref-property-list" %}
  {% details %}
  {% summary %}
  **operations**: `Operation array`

  A list of operations that matches the specified filter in the request.

  {% /summary %}

  {% details %}
  {% summary %}
  **error**: `Status`

  The error result of the operation in case of failure or cancellation.

  {% /summary %}

  **code**: `integer`

  The status code, which should be an enum value of google.rpc.Code.

  **message**: `string`

  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.

  **details**: `object array`

  A list of messages that carry the error details. There is a common set of message types for APIs to use.

  {% /details %}

  **response**: `object`

  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`.

  **name**: `string`

  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**: `object`

  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.

  **done**: `boolean`

  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.

  {% /details %}

  {% hr /%}

  **nextPageToken**: `string`

  The standard List next-page token.

  {% hr /%}

  **unreachable**: `string array`

  Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations.

  {% /section %}

  {% /left-column %}

  {% right-column class="sticky" %}
  **Example response** {% class="example-heading" %}

  ```json
  {
    "operations": [
      {
        "error": {
          "code": 0,
          "message": "string",
          "details": [
            {}
          ]
        },
        "response": {},
        "name": "string",
        "metadata": {},
        "done": true
      }
    ],
    "nextPageToken": "string",
    "unreachable": [
      "string"
    ]
  }
  ```

  {% /right-column %}

{% /two-column-layout %}

