Creating file using GPT API and extract it's content in nodejs

Hello,

I need to upload any type of file and create using chatgpt api. In that I am getting success result.
For extract it’s content I am using openaiGPT.beta.assistants.create Gpt4 API in that also I am getting success.

But some how I am not able to get extract content from that file.

I am using model : “gpt-4-0125-preview” and tools type “retrieval” still not able to get content of the file.

Also I have tried it’s thread api and I am able to create it’s thread but when I try to create message and run api for GPT4 I am getting error.

401 You have insufficient permissions for this operation. Missing scopes: api.threads.write. Check that you have the correct role in your organization (Reader, Writer, Owner), and if you’re using a restricted API key, that it has the necessary scopes.

I have given permission as well.

For thread I am using following APIS
openaiGPT.beta.threads.messages.create
openaiGPT.beta.threads.runs.create

Can anyone have idea about it?

Thanks in advance !!