Documentation
API Reference
Playground
Chat completionsResponsesSystem One
Document classificationEmbeddings

Studio API

Upload fileList filesRetrieve fileDelete file
Create jobRetrieve job

Search

Create vector storeList vector storesRetrieve vector storeModify vector storeDelete vector storeAdd file to vector storeList files in vector storeRetrieve file in vector storeRemove file from vector storeCreate file batchRetrieve file batchList files in file batchCancel file batchSearch vector store
Create response

Search vector store

Search a vector store using a natural language query.

POST
/vector_stores/{vector_store_id}/search
/vector_stores/{vector_store_id}/search

The Authorization access token

query*

filters
object

ranking_options
object

Authorization

Authorization
Required
Bearer <token>

In: header

Request Body

application/jsonRequired

query
Required
string | array<string>

The search query in natural language. Accepts either a single string or an array of strings.

Note: Multi-query is currently a request-shape stub for OpenAI compatibility. When an array is supplied, only the first element is used to generate the search embedding; subsequent elements are ignored. The service emits a server-side warning when this happens. Pass a single string for predictable results until proper multi-query semantics are released.

max_num_resultsinteger

Maximum number of results to return (1-20).

Default: 5Minimum: 1Maximum: 20

filtersobject

Filter criteria for search results.

ranking_optionsobject

Accepted but uses the system's default ranking.

rewrite_queryboolean

Accepted but uses the system's default behavior.

Path Parameters

vector_store_id
Required
string

The ID of the vector store.


Example

Request

curl -X POST https://api.upstage.ai/v2/vector_stores/vs_abc123def456/search \
  -H "Authorization: Bearer $UPSTAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "How do I configure the system?",
    "max_num_results": 5
  }'

Response

{
  "object": "vector_store.search_results.page",
  "search_query": ["How do I configure the system?"],
  "data": [
    {
      "file_id": "file_xyz789",
      "filename": "product-guide.pdf",
      "score": 0.892,
      "attributes": {},
      "content": [
        {"type": "text", "text": "The matched text content from the document..."}
      ]
    }
  ],
  "has_more": false,
  "next_page": null
}

Multi-query request

The query field accepts an array of strings for OpenAI request-shape compatibility, but only the first element is currently used to generate the search embedding. Subsequent elements are ignored and a server-side warning is logged. Pass a single string for predictable results until proper multi-query semantics are released.

curl -X POST https://api.upstage.ai/v2/vector_stores/vs_abc123def456/search \
  -H "Authorization: Bearer $UPSTAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": ["How do I configure the system?", "What are the default settings?"],
    "max_num_results": 5
  }'

The request above behaves identically to passing only "How do I configure the system?" β€” the second query is dropped.

Cancel file batch

Cancel a file batch that is still indexing; completed files are kept. Covers the path parameters, the cancelled file batch object returned, and an example request and response.

Create response

Generate an LLM answer grounded in your vector stores with the file_search tool (RAG). Covers the request body (model, input, tools, instructions, stream), the response object (output with file_search_call and message items), non-streaming and streaming examples, and the SSE event types.

On this page

Search vector storeExampleRequestResponseMulti-query request