Move a project from OpenAI API to OpenRouter

A developer let GitHub Copilot handle a staged switch from OpenAI API calls to OpenRouter and then checked the commit details it generated.

Done with GitHub Copilot· Intermediate· Jul 2025

What they did
They gave GitHub Copilot’s coding agent a small migration task for an existing project: swap out the OpenAI API integration for OpenRouter. The agent made the code edits, then returned commit and pull request notes for the developer to inspect. They accepted the work after reviewing those summaries.
How it went
The migration succeeded on the first pass. They said the agent stayed on task, produced useful documentation, and delivered a working change. The one thing they could not verify from the output was whether the agent had used any MCP tools.
Tips
For this kind of update, break the work into a narrow request and ask the agent to pause before any action that would have external effects. It also helps to review both the diff and the generated PR text, since some interfaces hide tool-use details.

Try it yourself with GitHub Copilot

In [repo name], replace the current OpenAI API integration with OpenRouter, working in small, checked-in increments. Adjust the client configuration, endpoint or base URL, environment settings, and model references so they fit [new provider], then run [test command]. Before you carry out anything that would send data, deploy code, remove files, or submit changes, stop and ask me to confirm. When you finish, give me the list of files changed plus any setup I still need to do, such as API keys or config values.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.