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

# List collections

> This operation returns a list of all collections in a project.

Serverless indexes do not support collections.


<RequestExample>
  ```python Python theme={null}
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key='YOUR_API_KEY')

  active_collections = pc.list_collections()
  ```

  ```javascript JavaScript theme={null}
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

  await pc.listCollections();
  ```

  ```java Java theme={null}
  import io.pinecone.clients.Pinecone;
  import org.openapitools.client.model.CollectionModel;

  public class ListCollectionsExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          List<CollectionModel> collectionList = pc.listCollections().getCollections();
          System.out.println(collectionList);
      }
  }
  ```

  ```shell curl theme={null}
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -i -X GET "https://api.pinecone.io/collections" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-Api-Version: 2024-04"
  ```
</RequestExample>


## OpenAPI

````yaml https://raw.githubusercontent.com/pinecone-io/pinecone-api/refs/heads/main/2024-04/control_2024-04.oas.yaml get /collections
openapi: 3.0.3
info:
  title: Pinecone Control Plane API
  description: >-
    Pinecone is a vector database that makes it easy to search and retrieve
    billions of high-dimensional vectors.
  version: 2024-04
  contact:
    name: Pinecone Support
    url: https://support.pinecone.io
    email: support@pinecone.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: https://api.pinecone.io
    description: Production API endpoints
security:
  - ApiKeyAuth: []
tags:
  - name: Manage Indexes
    description: Actions that manage indexes
externalDocs:
  description: More Pinecone.io API docs
  url: https://docs.pinecone.io/introduction
paths:
  /collections:
    servers:
      - url: https://api.pinecone.io
    get:
      tags:
        - Manage Indexes
      summary: List collections
      description: |
        This operation returns a list of all collections in a project.

        Serverless indexes do not support collections.
      operationId: list_collections
      responses:
        '200':
          description: >-
            This operation returns a list of all the collections in your current
            project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollectionList'
              examples:
                multiple-collections:
                  summary: Multiple collections with different states
                  value:
                    collections:
                      - name: small-collection
                        size: 3126700
                        status: Ready
                        dimension: 3
                        vector_count: 99
                        environment: us-east1-gcp
                      - name: small-collection-new
                        size: 3126700
                        status: Initializing
                        dimension: 3
                        vector_count: 99
                        environment: us-east1-gcp
                      - name: big-collection
                        size: 160087040000000
                        status: Ready
                        dimension: 1536
                        vector_count: 10000000
                        environment: us-east1-gcp
                no-collections:
                  summary: No collections created yet
                  value:
                    collections: []
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '500':
          $ref: '#/components/responses/500InternalServerError'
components:
  schemas:
    CollectionList:
      type: object
      description: The list of collections that exist in the project.
      properties:
        collections:
          type: array
          items:
            $ref: '#/components/schemas/CollectionModel'
    CollectionModel:
      type: object
      description: >-
        The CollectionModel describes the configuration and status of a Pinecone
        collection.
      required:
        - name
        - status
        - environment
      properties:
        name:
          type: string
          description: The name of the collection.
          example: example-collection
        size:
          type: integer
          description: The size of the collection in bytes.
          example: 10000000
          format: int64
        status:
          type: string
          description: The status of the collection.
          enum:
            - Initializing
            - Ready
            - Terminating
          example: Initializing
        dimension:
          type: integer
          description: >-
            The dimension of the vectors stored in each record held in the
            collection.
          example: 1536
          minimum: 1
          maximum: 2000
          format: int32
        vector_count:
          type: integer
          example: 120000
          format: int32
          description: The number of records stored in the collection.
        environment:
          type: string
          description: The environment where the collection is hosted.
          example: us-east1-gcp
    ErrorResponse:
      type: object
      description: The response shape used for all error responses.
      required:
        - status
        - error
      properties:
        status:
          type: integer
          description: The HTTP status code of the error.
          example: 500
        error:
          type: object
          description: Detailed information about the error that occurred.
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - OK
                - UNKNOWN
                - INVALID_ARGUMENT
                - DEADLINE_EXCEEDED
                - QUOTA_EXCEEDED
                - NOT_FOUND
                - ALREADY_EXISTS
                - PERMISSION_DENIED
                - UNAUTHENTICATED
                - RESOURCE_EXHAUSTED
                - FAILED_PRECONDITION
                - ABORTED
                - OUT_OF_RANGE
                - UNIMPLEMENTED
                - INTERNAL
                - UNAVAILABLE
                - DATA_LOSS
                - FORBIDDEN
            message:
              type: string
              example: >-
                Index name must contain only lowercase alphanumeric characters
                or hyphens, and must not begin or end with a hyphen.
            details:
              description: >-
                Additional information about the error. This field is not
                guaranteed to be present.
              type: object
          example:
            code: INVALID_ARGUMENT
            message: >-
              Index name must contain only lowercase alphanumeric characters or
              hyphens, and must not begin or end with a hyphen.
      example:
        status: 429
        error:
          code: QUOTA_EXCEEDED
          message: >-
            The index exceeds the project quota of 5 pods by 2 pods. Upgrade
            your account or change the project settings to increase the quota.
  responses:
    401Unauthorized:
      description: 'Unauthorized. Possible causes: Invalid API key.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unauthorized:
              summary: Unauthorized
              value:
                status: 401
                error:
                  code: UNAUTHENTICATED
                  message: Invalid API key.
    500InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal-server-error:
              summary: Internal server error
              value:
                status: 500
                error:
                  code: UNKNOWN
                  message: Internal server error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Api-Key
      description: >-
        An API Key is required to call Pinecone APIs. Get yours from the
        [console](https://app.pinecone.io/).
      in: header

````