I am trying to access the search API through cURL but I keep getting “You didn’t provide an API key”. Answers API and file APIs works fine. Below is the cURL command I am using
curl -L -X POST ‘https://api.openai.com/v1/engines/ada/search’
-H ‘Authorization: BEARER API_KEY’
-H ‘Content-Type: application/json’
–data-raw ‘{ “documents”: [“White House”, “hospital”, “school”], “query”: “the president”}’
The Answers API call is as follows
curl -L -X POST ‘https://api.openai.com/v1/answers’
-H ‘Authorization: BEARER API_KEY’
-H ‘Content-Type: application/json’
–data-raw ‘{
“file”: “file”,
“question”: “Whats an iterator”,
“search_model”: “ada”,
“model”: “curie”,
“temperature”: 0.7,
“examples_context”: “In 2017, U.S. life expectancy was 78.6 years.”,
“examples”: [[“What is human life expectancy in the United States?”, “78 years.”]],
“max_rerank”: 10,
“max_tokens”: 100,
“stop”: ["\n", “<|endoftext|>”]
}’