---
title: "Retrieves a vector store file."
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/operations/getVectorStoreFile"
---

> Full API specification: https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1.md

# Retrieves a vector store file.

`GET` `/vector_stores/{vector_store_id}/files/{file_id}`

Operation ID: `getVectorStoreFile`

## Path parameters

- `vector_store_id` (string, required) - The ID of the vector store that the file belongs to.
- `file_id` (string, required) - The ID of the file being retrieved.

## Responses

- `200` - OK

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
paths:
  /vector_stores/{vector_store_id}/files/{file_id}:
    get:
      operationId: getVectorStoreFile
      tags:
        - Vector stores
      summary: Retrieves a vector store file.
      parameters:
        - in: path
          name: vector_store_id
          required: true
          schema:
            type: string
            example: vs_abc123
          description: The ID of the vector store that the file belongs to.
        - in: path
          name: file_id
          required: true
          schema:
            type: string
            example: file-abc123
          description: The ID of the file being retrieved.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VectorStoreFileObject"
      x-oaiMeta:
        name: Retrieve vector store file
        group: vector_stores
        beta: true
        returns: The [vector store
          file](/docs/api-reference/vector-stores-files/file-object) object.
        examples:
          request:
            curl: |
              curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \
                -H "Authorization: Bearer $OPENAI_API_KEY" \
                -H "Content-Type: application/json" \
                -H "OpenAI-Beta: assistants=v2"
            python: |
              from openai import OpenAI
              client = OpenAI()

              vector_store_file = client.beta.vector_stores.files.retrieve(
                vector_store_id="vs_abc123",
                file_id="file-abc123"
              )
              print(vector_store_file)
            node.js: >
              import OpenAI from "openai";

              const openai = new OpenAI();


              async function main() {
                const vectorStoreFile = await openai.beta.vectorStores.files.retrieve(
                  "vs_abc123",
                  "file-abc123"
                );
                console.log(vectorStoreFile);
              }


              main();
          response: |
            {
              "id": "file-abc123",
              "object": "vector_store.file",
              "created_at": 1699061776,
              "vector_store_id": "vs_abcd",
              "status": "completed",
              "last_error": null
            }
security:
  - ApiKeyAuth: []
components:
  schemas:
    VectorStoreFileObject:
      type: object
      title: Vector store files
      description: A list of files attached to a vector store.
      properties:
        id:
          description: The identifier, which can be referenced in API endpoints.
          type: string
        object:
          description: The object type, which is always `vector_store.file`.
          type: string
          enum:
            - vector_store.file
          x-stainless-const: true
        usage_bytes:
          description: The total vector store usage in bytes. Note that this may be
            different from the original file size.
          type: integer
        created_at:
          description: The Unix timestamp (in seconds) for when the vector store file was
            created.
          type: integer
        vector_store_id:
          description: The ID of the [vector
            store](/docs/api-reference/vector-stores/object) that the
            [File](/docs/api-reference/files) is attached to.
          type: string
        status:
          description: The status of the vector store file, which can be either
            `in_progress`, `completed`, `cancelled`, or `failed`. The status
            `completed` indicates that the vector store file is ready for use.
          type: string
          enum:
            - in_progress
            - completed
            - cancelled
            - failed
        last_error:
          type: object
          description: The last error associated with this vector store file. Will be
            `null` if there are no errors.
          nullable: true
          properties:
            code:
              type: string
              description: One of `server_error` or `rate_limit_exceeded`.
              enum:
                - server_error
                - unsupported_file
                - invalid_file
            message:
              type: string
              description: A human-readable description of the error.
          required:
            - code
            - message
        chunking_strategy:
          type: object
          description: The strategy used to chunk the file.
          oneOf:
            - $ref: "#/components/schemas/StaticChunkingStrategyResponseParam"
            - $ref: "#/components/schemas/OtherChunkingStrategyResponseParam"
          x-oaiExpandable: true
      required:
        - id
        - object
        - usage_bytes
        - created_at
        - vector_store_id
        - status
        - last_error
      x-oaiMeta:
        name: The vector store file object
        beta: true
        example: |
          {
            "id": "file-abc123",
            "object": "vector_store.file",
            "usage_bytes": 1234,
            "created_at": 1698107661,
            "vector_store_id": "vs_abc123",
            "status": "completed",
            "last_error": null,
            "chunking_strategy": {
              "type": "static",
              "static": {
                "max_chunk_size_tokens": 800,
                "chunk_overlap_tokens": 400
              }
            }
          }
    StaticChunkingStrategyResponseParam:
      type: object
      title: Static Chunking Strategy
      additionalProperties: false
      properties:
        type:
          type: string
          description: Always `static`.
          enum:
            - static
          x-stainless-const: true
        static:
          $ref: "#/components/schemas/StaticChunkingStrategy"
      required:
        - type
        - static
    OtherChunkingStrategyResponseParam:
      type: object
      title: Other Chunking Strategy
      description: This is returned when the chunking strategy is unknown. Typically,
        this is because the file was indexed before the `chunking_strategy`
        concept was introduced in the API.
      additionalProperties: false
      properties:
        type:
          type: string
          description: Always `other`.
          enum:
            - other
          x-stainless-const: true
      required:
        - type
    StaticChunkingStrategy:
      type: object
      additionalProperties: false
      properties:
        max_chunk_size_tokens:
          type: integer
          minimum: 100
          maximum: 4096
          description: The maximum number of tokens in each chunk. The default value is
            `800`. The minimum value is `100` and the maximum value is `4096`.
        chunk_overlap_tokens:
          type: integer
          description: >
            The number of tokens that overlap between chunks. The default value
            is `400`.


            Note that the overlap must not exceed half of
            `max_chunk_size_tokens`.
      required:
        - max_chunk_size_tokens
        - chunk_overlap_tokens
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
```
