Sending a POST request to /v1/conversations/text-davinci-003/messages
will not return the result you want, because this URL is not used by the OpenAI API.
Here's an example of a cURL request which completes the message Say this is a test
curl https://api.openai.com/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"model": "text-davinci-003", "prompt": "Say this is a test", "temperature": 0, "max_tokens": 7}'
And this is an example of what the API will respond with:
{
"id": "cmpl-GERzeJQ4lvqPk8SkZu4XMIuR",
"object": "text_completion",
"created": 1586839808,
"model": "text-davinci:003",
"choices": [
{
"text": "This is indeed a test",
"index": 0,
"logprobs": null,
"finish_reason": "length"
}
],
"usage": {
"prompt_tokens": 5,
"completion_tokens": 7,
"total_tokens": 12
}
}
This is the full list of API paths:
Instead, you can use the URLs listed in the OpenAI documentation:
List models
GET https://api.openai.com/v1/models
Retrieve model
GET https://api.openai.com/v1/models/{model}
Create completion
POST https://api.openai.com/v1/completions
Create edit
POST https://api.openai.com/v1/edits
Create image
POST https://api.openai.com/v1/images/generations
Create image edit
POST https://api.openai.com/v1/images/edits
Create image variation
POST https://api.openai.com/v1/images/variations
Create embeddings
POST https://api.openai.com/v1/embeddings
More found in the OpenAI documentation.