Trying to use REST API and getting error on the first request. Can anyone help?

I am new to tasking.ai and I have a free account. I am trying to use openai-compatible rest api. I am getting the response ‘{“detail”:“Not Found”}’ on the first request.
I am using Delphi so the code is in Pascal. I am able to use almost the same code successfully with openai:
Client.CustHeaders.Clear;
Client.ContentType := ‘application/json’;
Client.CustHeaders.Add(‘Authorization’, ’ Bearer '+ APIKey);
Client.Get('https://oapi.tasking.ai/v1/assistants/'+AssId);
Response := Trim(Response);
At this point the response is ‘{“detail”:“Not Found”}’.
What am I doing wrong?

Thank you,
Andre

Hi Andre,
I am trying to understand your code. Is Client.Get('https://oapi.tasking.ai/v1/assistants/'+AssId) attempting to fetch the information of the assistant object with the given AssId?

If that is the case, you should use https://api.tasking.ai/v1/assistants/AssId instead of oapi because your assistant is created based on TaskingAI. The openai-compatible REST API can be seamlessly adapted to almost all other use cases, except when fetching the model or assistant, in which case you need to retrieve it from TaskingAI.

Please correct me if I have misunderstood your intention.

Thank you, simson. This was helpful, I thought I had tried it before but perhaps not.

Andre