apicheats.dev openai/llms.txt Raw .md
POST

POST /vector_stores/{vector_store_id}/search — OpenAI API

OpenAI API key (required); https://api.openai.com/v1

OpenAI API

Search vector store

Base URL
https://api.openai.com/v1
Auth
Authorization: Bearer <OPENAI_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 299 tokens · Vary: Accept

Critical gotchas

The Responses API is the primary interface for new text and tool workflows; Chat Completions remains a separate compatibility API.

Audio transcription uploads use multipart form data rather than a JSON request body.

cURL

curl -X POST 'https://api.openai.com/v1/vector_stores/vs_abc123/search' \  -H "Authorization: Bearer $OPENAI_API_KEY" \  -H 'Content-Type: application/json' \  -d '{  "query": "example-query"}'

Parameters

Name In Type Required Description
vector_store_id path string Yes The ID of the vector store to search.
query body string Yes A query string for a search
rewrite_query body boolean No Whether to rewrite the natural language query for vector search.
max_num_results body integer No The maximum number of results to return. This number should be between 1 and 50 inclusive.
filters body object No A filter to apply based on file attributes.
ranking_options body object No Ranking options for search.

Response 200 OK

{
  "object": "vector_store.search_results.page",
  "search_query": [
    "string"
  ],
  "data": [
    {
      "file_id": "string",
      "filename": "string",
      "score": 0,
      "attributes": {},
      "content": [
        {
          "type": "text",
          "text": "string"
        }
      ]
    }
  ],
  "has_more": true,
  "next_page": "string"
}
Get a free OpenAI API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.