There is no legacy and no new API. Your AI is hallucinating.
Search the forum for the 403 / 401 errors and you will hopefully find your error …