Getting 404 Not Found Error for API Endpoint in Postman

Hi OpenAI team,

I’m encountering a reproducible 404 Not Found error when attempting to use the OpenAI API’s v1/chat/completions endpoint via Postman. I believe this might be a bug, as I’ve followed the documentation and ensured all details are correct.

Details:

  • Tool: Postman
  • API Key: Generated from the OpenAI platform with Read and Write permissions
  • Endpoint: api.openai (com)/v1/chat/completions
  • Headers:
    • Authorization: Bearer sk-[my-api-key]
    • Content-Type: application/json
  • Request Body: { “model”: “gpt-4-turbo”, “messages”: [{“role”: “user”, “content”: “Hello, how are you?”}] }

Steps Taken:

  1. Checked Endpoint: Verified the URL is correct.

  2. API Key: Confirmed the API key is correct and has the necessary permissions.

  3. Network: Ensured my network isn’t blocking the OpenAI domain.

  4. cURL Command: Tried using cURL with the same results: /Blockquote curl api.openai (com)/v1/chat/completions -H “Authorization: Bearer sk-[my-api-key]” -H “Content-Type: application/json” -d ‘{“model”: “gpt-4-turbo”, “messages”: [{“role”: “user”, “content”: “Hello, how are you?”}]}’ /Blockquote

  5. API Key Permissions: Verified that the API key has read and write permissions for the required endpoints.

Logs from Postman:

  • Status: 404 Not Found
  • Response: { “error”: { “message”: “The requested resource was not found”, “type”: “invalid_request_error”, “param”: null, “code”: “resource_not_found” } }

Additional Information:

  • Attached are screenshots showing the API key permissions and the Postman setup.
  • I have also checked the API documentation and followed the setup instructions carefully.

Any help or suggestions would be greatly appreciated. I’m looking forward to resolving this issue and getting the API to work correctly.

Thanks in advance!

Welcome to the dev community!

Check that the model and endpoint matches.

## Model endpoint compatibility

Endpoint Latest models
/v1/assistants All GPT-4 and GPT-3.5 Turbo models. The retrieval tool requires gpt-4-turbo-preview (and subsequent dated model releases) or gpt-3.5-turbo-1106 (and subsequent versions).
/v1/audio/transcriptions whisper-1
/v1/audio/translations whisper-1
/v1/audio/speech tts-1, tts-1-hd
/v1/chat/completions gpt-4 and dated model releases, gpt-4-turbo-preview and dated model releases, gpt-3.5-turbo and dated model releases, fine-tuned versions of gpt-3.5-turbo
/v1/completions (Legacy) gpt-3.5-turbo-instruct, babbage-002, davinci-002
/v1/embeddings text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002
/v1/fine_tuning/jobs gpt-3.5-turbo, babbage-002, davinci-002
/v1/moderations text-moderation-stable, text-moderation-latest
/v1/images/generations dall-e-2, dall-e-3

This list excludes all of our deprecated models.

https://platform.openai.com/docs/models/model-endpoint-compatibility

1 Like

Hi Paul,

Thanks for your response. I’ve double-checked the model and endpoint, and they match the documentation. Here are the details:

Endpoint:

api.openai com/v1/chat/completions

Headers:

  • Authorization: Bearer sk-[my-api-key]
  • Content-Type: application/json

Request Body: { “model”: “gpt-4-turbo”, “messages”: [{“role”: “user”, “content”: “Hello, how are you?”}] }

Despite this, I’m still getting a 404 Not Found error. Here’s what I’ve tried so far:

  1. Checked Endpoint: Verified the URL is correct.
  2. API Key: Confirmed the API key is correct and has the necessary permissions.
  3. Network: Ensured my network isn’t blocking the OpenAI domain.
  4. cURL Command: Tried using cURL with the same results:

curl api.openai com/v1/chat/completions -H “Authorization: Bearer sk-[my-api-key]” -H “Content-Type: application/json” -d ‘{“model”: “gpt-4-turbo”, “messages”: [{“role”: “user”, “content”: “Hello, how are you?”}]}’

  1. API Key Permissions: Verified that the API key has read and write permissions for the required endpoints.

Logs from Postman:

  • Status: 404 Not Found
  • Response: { “error”: { “message”: “The requested resource was not found”, “type”: “invalid_request_error”, “param”: null, “code”: “resource_not_found” } }

Attached are screenshots showing the API key permissions and the Postman setup. Could there be another issue causing this error?

Thanks in advance for your help!

1 Like

Try…

curl https://api.openai.com/v1/chat/completions -H “Authorization: Bearer sk-[my-api-key]” -H “Content-Type: application/json” -d ‘{“model”: “gpt-4-turbo”, “messages”: [{“role”: “user”, “content”: “Hello, how are you?”}]}’

…adding the HTTPS://

Looking at the API docs, I don’t see GPT-4-Turbo as a model for completions

gpt-4 and dated model releases, 
gpt-4-turbo-preview and dated model releases, 
gpt-3.5-turbo and dated model releases, 
fine-tuned versions of gpt-3.5-turbo

got gpt-4-turbo-preview and gpt-4 and 3.5-turbo.

Could you try changing the model to gpt-4 ?

1 Like

Hi Paul,

Thanks for the suggestion. I tried the cURL command with https:// included, but I’m still encountering the same issue. Here are the updated details:

Endpoint:

‘https://’ api openai com/v1/chat/completions

Headers:

  • Authorization: Bearer sk-[my-api-key]
  • Content-Type: application/json

Request Body: { “model”: “gpt-4-turbo”, “messages”: [{“role”: “user”, “content”: “Hello, how are you?”}] }

Steps Taken:

  1. Checked Endpoint: Verified the URL is correct and included https://.
  2. API Key: Confirmed the API key is correct and has the necessary permissions.
  3. Network: Ensured my network isn’t blocking the OpenAI domain.
  4. Updated cURL Command: Tried using cURL with https://:

curl ‘https://’ api openai com/v1/chat/completions -H “Authorization: Bearer sk-[my-api-key]” -H “Content-Type: application/json” -d ‘{“model”: “gpt-4-turbo”, “messages”: [{“role”: “user”, “content”: “Hello, how are you?”}]}’

  1. API Key Permissions: Verified that the API key has read and write permissions for the required endpoints.

Logs from Postman:

  • Status: 404 Not Found
  • Response: { “error”: { “message”: “The requested resource was not found”, “type”: “invalid_request_error”, “param”: null, “code”: “resource_not_found” } }

Attached are screenshots showing the API key permissions and the Postman setup. Could there be another issue causing this error?

Thanks in advance for your help!

Did you see my comment about trying gpt-4 rather than gpt-4-turbo?