Anecdotally I've used copilot to help write a lot of IAM polities in Terraform and the accuracy is basically 100% already.
With an API that has a hidden / predefined prompt, you'll run into hallucinations that are harder or impossible to handle