Create Vector Store error

This is my request and response:

HTTP Request Job Name: https://api.openai.com/v1/vector_stores/
HTTP Request String: {“name”:“Shop Files”}

ResponseError. Reason: , Response:

403 Forbidden

403 Forbidden


nginx I am not using nginx. I am in the US. The error seems to indicate that I am in a forbidden country. Any ideas why?

This is the documentation I am trying to follow in doing this:
https://platform.openai.com/docs/api-reference/vector-stores-files/createFile

This is the code that makes the request in the B4J programming language:
Public Sub CreateVectorStore(VectorStoreName As String)
LogColor(“Sub OpenAILibrary CreateVectorStore started”, 0xFF210099)
Dim job As HttpJob
job.Initialize(“CreateVectorStore”, Me)

Dim parameters As String
parameters = $"{"name":"${VectorStoreName}"}"$
job.PostString("https://api.openai.com/v1/vector_stores/", parameters)
job.GetRequest.SetContentType("application/json")
job.GetRequest.SetHeader("Authorization", "Bearer " & apiKey)
job.GetRequest.SetHeader("OpenAI-Organization", "")
job.GetRequest.SetHeader("OpenAI-Beta", "assistants=v2")

' Log the request
LogHttpRequest("https://api.openai.com/v1/vector_stores/", parameters)
LogColor("Sub OpenAILibrary CreateVectorStore finished", 0xFF210099)

End Sub

Are your API requests originating from a server or cloud worker also guaranteed to be in the USA?

One case of problems is using CDN providers - Cloudflare particularly - where your cloud app can originate from China by a Chinese user being routed to a local server with your code.

If this is the only connection you can use, and the IP block is in the USA, you could submit that geolocation issue to “help” - informing them that it needs staff escalation for the reconfiguration.


You should not send an empty organization. Either fill it out to match the API key being employed, or omit that header. If you are sending organization, you should also send the project ID associated with the API key.

Projects also serves a function of separating user data, such as uploaded user documents that may be in file storage, so this more intense scoping may be the reason for further issues.

See if ensuring all pieces of authentication are complete has any affect to resolve this issue. See if typical example Python code to make the same endpoint request succeeds. What would be expected is not a http error, though, it would be inability to use the ID of files or vector stores.

1 Like

Yes, my computer is here in the USA that I am working on . A windows PC. All my other requests work fine. I can list assistants, etc with no error.

I don’t have python or know how to use it.

I don’t use organization on any of my other calls and they work fine.
I removed the organization line. Still the same results. It is not in any of my other calls.

Anything else?

Specific endpoints can be set with no access in a project.

For uploading to storage:
https://api.openai.com/v1/uploads
https://api.openai.com/v1/files

Separate:

https://api.openai.com/v1/vector_stores

In API key endpoint selections, it is NOT LISTED.

Therefore, if enabling assistants category in an API key doesn’t work, you might need a full endpoint access key with “ALL” because of this oversight.

My key is already unrestricted. I selected All when I made it. I just checked to confirm.

Note that all my other calls to the API work. I can:

List Assistants
List Files
List Messages in A Thread.
List Fine Tuning Jobs
List Fine Tuning Events.
List Models
Delete a Thread.
Delete an Assistant.
Delete a File
Upload a File.
Chat
TTS
Image Response
Create an Assistant
Create a Thread

Any other ideas? Is this a bug?

I found the error. There is not supposed to be a forward slash at the end of the line above.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.