Getting 404 error calling the API: https://api.openai.com/v1/assistants

System.Net.Http.HttpRequestException: ‘Response status code does not indicate success: 400 (Bad Request).’

When I make this call from CURL I get this:

{
“error”: {
“message”: “You must provide the ‘OpenAI-Beta’ header to access the Assistants API. Please try again by setting the header ‘OpenAI-Beta: assistants=v2’.”,
“type”: “invalid_request_error”,
“param”: null,
“code”: “invalid_beta”
}
}

so I have to add this -H “OpenAI-Beta: assistants=v2” to the CURL call

Using calls from the OpenAI nuget package result in errors also saying that the assistant I am calling doesn’t exist, and when I try to list assistants I get the 404 error… But adding that OpenAI-Beta works how ever how do I do that in .net using the OpenAI package? Also, there doesn’t seem to be any documentation on V2 yet assistant seem to be on V2

Hi!

Regarding the documentation, it’s all about the v2 nowadays but there is a link to the legacy v1 documentation somewhere. Are you maybe using a bookmarked link to the old version?

https://platform.openai.com/docs/assistants/quickstart

To interact with the API in other code language without supplied SDK, you’ll have to look at the API reference which discusses specifically how to construct a POST/GET/DELETE request, and the response object you’ll get back.

Assistants will generally need three headers for authentication, because the data in a project is scoped, so that some semblance of firewall is between personal data of different projects. That besides the assistants version header.

Guidance:

https://platform.openai.com/docs/api-reference/authentication

We had a user who complained about their posts being edited without their consent, even though it was just adding a code block to plain text. But that’s off-topic.

Welcome @wweatlake1234

Can you please share the .NET code that’s throwing the errors?