I asked copilot itself about an API interface to send prompts and get responses and it said it doesn't support that as it's intended for integration into IDEs. It also said "If you're looking for programmatic access to AI-powered code generation, you might want to explore OpenAI's GPT APIs or similar services, which are specifically designed for such use cases."