No assistant found with id

I get this error code :

Error code: 404 - {‘error’: {‘message’: "No assistant found with id ‘asst_z3vgfeOUpmUtprxxxxxxxx’}}

ASSISTANT_ID='asst_z3vgfeOUpmUtprgxxxxxxx'

client=OpenAI(api_key=api_key)
thread=client.beta.threads.create(
    messages=[
        {'role':'user',
         'content':'whats the most livable',
         }
    ]
)
run = client.beta.threads.runs.create(thread_id=thread.id, assistant_id=ASSISTANT_ID)

Welcome @mr.fuadak
I would recommend making a list assistants request to the API with the same API key and check if yours is in the list.

1 Like

This happened to me when I had to add more funds to my account.

1 Like

@mr.fuadak - Welcome to the community,

You can list all the assistants created using

client.beta.assistants.list(limit=100, order="desc")

Check if your assistant exists, if not create a new one.

Cheers!

1 Like

I saw that only the assistans I created with api (client.beta.assistants.create) is listed but not the one I created via openai playground thats why its ID not recognised.

You may find the assistant ID here

Screenshot 2024-05-31 at 12.25.49 PM

Cheers!