---
title: "Query chunks from a vector database."
method: POST
path: "/v1/vector-io/query"
tags: ["VectorIO"]
---

# Query chunks from a vector database.

`POST /v1/vector-io/query`

Query chunks from a vector database.

## Request body

- QueryChunksRequest — Request body for querying chunks from a vector store.
  - `vector_store_id` string, required — The ID of the vector store to query.
  - `query` union, required — The query content to search for.
    - string
    - ImageContentItemInput — A image content item
      - `type` 'image'
      - `image` URLOrData, required — A URL or a base64 encoded string
        - `url` URL — A URL reference to external content.
          - `uri` string, required
        - `data` string, byte, nullable
    - TextContentItem — A text content item
      - `type` 'text'
      - `text` string, required
    - union[]
      - union
        - ImageContentItemInput — A image content item
          - `type` 'image'
          - `image` URLOrData, required — A URL or a base64 encoded string
            - `url` URL — A URL reference to external content.
              - …
            - `data` string, byte, nullable
        - TextContentItem — A text content item
          - `type` 'text'
          - `text` string, required
  - `params` object, nullable — Additional query parameters.

## Response `200`

A QueryChunksResponse.

- QueryChunksResponse — Response from querying chunks in a vector database.
  - `chunks` EmbeddedChunkOutput[], required
    - `content` union, required
      - string
      - ImageContentItemOutput — A image content item
        - `type` 'image'
        - `image` URLOrData, required — A URL or a base64 encoded string
          - `url` URL — A URL reference to external content.
            - `uri` string, required
          - `data` string, byte, nullable
      - TextContentItem — A text content item
        - `type` 'text'
        - `text` string, required
      - union[]
        - union
          - ImageContentItemOutput — A image content item
            - `type` 'image'
            - `image` URLOrData, required — A URL or a base64 encoded string
              - …
          - TextContentItem — A text content item
            - `type` 'text'
            - `text` string, required
    - `chunk_id` string, required
    - `metadata` object
    - `chunk_metadata` ChunkMetadata, required — `ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata` is set during chunk creation in `FileSearchToolRuntimeImpl().insert()`and is not expected to change after. Use `Chunk.metadata` for metadata that will be used in the context during inference.
      - `chunk_id` string, nullable
      - `document_id` string, nullable
      - `source` string, nullable
      - `created_timestamp` integer, nullable
      - `updated_timestamp` integer, nullable
      - `chunk_window` string, nullable
      - `chunk_tokenizer` string, nullable
      - `content_token_count` integer, nullable
      - `metadata_token_count` integer, nullable
    - `embedding` number[], required
    - `embedding_model` string, required
    - `embedding_dimension` integer, required
  - `scores` number[], required

## Other responses

- `400` — The request was invalid or malformed
- `429` — The client has sent too many requests in a given amount of time
- `500` — The server encountered an unexpected error
- `default` — An error occurred

---

[API](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis.md) · [All operations](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ogx-ai/ogx-specification-stable-experimental-apis/versions/f3f783962256/schema)
