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)
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.
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.
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