K

Engines

post
/engines/{engine_id}/search

Path parameters

  • Name
    engine_id
    Type
    string
    Required
    Description

    The ID of the engine to use for this request. You can select one of ada, babbage, curie, or davinci.

Body params

Name
query
Type
string
Required
Description
Query to search against the documents.
Name
documents
Type
array[string]
Description
Up to 200 documents to search over, provided as a list of strings. The maximum document length (in tokens) is 2034 minus the number of tokens in the query. You should specify either `documents` or a `file`, but not both.
Name
file
Type
string
Description
The ID of an uploaded file that contains documents to search over. You should specify either `documents` or a `file`, but not both.
Name
max_rerank
Type
integer
Description
The maximum number of documents to be re-ranked and returned by search. This flag only takes effect when `file` is set.
Name
return_metadata
Type
boolean
Description
A special boolean flag for showing metadata. If set to `true`, each document entry in the returned JSON will contain a "metadata" field. This flag only takes effect when `file` is set.
Name
user
Type
string
Description
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).

Response

JSON
{
  "object": "string",
  "model": "string",
  "data": [
    {
      "object": "string",
      "document": 0,
      "score": 0
    }
  ]
}