Error : The requested model 'gpt-4o' cannot be used with the Assistants API in v1

I’m encountering an error when using Assistant API with gpt-4o.

I got this error;

Error: Error code: 400 - {‘error’: {‘message’: “The requested model ‘gpt-4o’ cannot be used with the Assistants API in v1. Follow the migration guide to upgrade to v2: https://platform.openai.com/docs/assistants/migration.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘model’, ‘code’: ‘unsupported_model’}}

It seems like this error happened the code below;

# Create the run
run = await client.beta.threads.runs.create(
    thread_id=thread_id, assistant_id=assistant_id
)

I created client instance;

client = AsyncOpenAI(api_key=api_key)

I installed openai=1.20.0 and This Assistant version is v2.

Thanks for any help or info :grinning:

2 Likes

Hi,
Is your issue resolved?
Because I’m also facing the same

2 Likes

In my case, it was the header that failed.

This is c#:
client = OpenAI(default_headers={“OpenAI-Beta”: “assistants=v2”})

1 Like

15 minutes ago they updated their SDK to 1.30.1
will solve the issue
pip3 install --upgrade openai
move to 1.30.1 and you are good to go

2 Likes

I updated openai == 1.20.0 to openai==1.30.1, then Fixed !!
Thank you !!