Model providers

Using GitHub Copilot Models with OpenClaw

4 min read

Browse more in Model providers.

All model providers guides →

This guide walks you through configuring GitHub Copilot as a model provider in OpenClaw using the built-in `github-copilot` integration. You’ll run the device-login flow, set a default Copilot model, and wire it into your agent defaults.

By the end, your OpenClaw agents will call GitHub Copilot models like `github-copilot/gpt-4o` for coding tasks.

Setup flow

Prerequisites

  • An existing OpenClaw installation with the `openclaw` CLI available in your shell.
  • A GitHub account with access to GitHub Copilot models for your plan.
  • Access to an interactive terminal (TTY) where you can complete the GitHub device login flow.

Steps

  1. 1

    Choose how you want to use GitHub Copilot with OpenClaw

    Decide whether you use the built-in `github-copilot` provider or the Copilot Proxy plugin. The built-in provider uses a native device-login flow and is the default path that does not require VS Code.

    The Copilot Proxy plugin talks to a local `/v1` endpoint from the VS Code extension and only makes sense if you already run that proxy and keep VS Code open.

  2. 2

    Run the GitHub Copilot device login flow

    Use the dedicated auth command to start the GitHub device flow and link OpenClaw to your GitHub account. This command saves an auth profile and updates your config to use that profile, so later model calls can exchange your GitHub token for Copilot API tokens automatically.

    Keep the terminal open while you visit the URL and enter the one-time code.

    bash
    openclaw models auth login-github-copilot
  3. 3

    Automate login with the non-interactive flag when needed

    If you want to skip extra prompts during the login flow, add the `--yes` flag. This is useful when you already know you want to accept the defaults and don’t want to confirm each step.

    You still need an interactive TTY for the device code, but the CLI won’t ask additional questions.

    bash
    openclaw models auth login-github-copilot --yes
  4. 4

    Log in and set the recommended default Copilot model in one step

    Use the generic `login` auth command when you want OpenClaw to both authenticate with GitHub Copilot and apply the provider’s recommended default model automatically. The `--provider github-copilot --method device --set-default` flags tell OpenClaw which provider to configure, which auth method to use, and that it should update your default model.

    This keeps your config in sync with the provider’s best default without a separate command.

    bash
    openclaw models auth login --provider github-copilot --method device --set-default
  5. 5

    Set your default GitHub Copilot model explicitly

    If you want to control the default model yourself, or change it later, run the `models set` command. Here you point OpenClaw at a specific Copilot model ID like `github-copilot/gpt-4o`.

    This default applies wherever your agents rely on the primary model setting.

    bash
    openclaw models set github-copilot/gpt-4o
  6. 6

    Wire GitHub Copilot into your agent defaults config

    Update your OpenClaw config so agents use the Copilot model by default. primary` to `github-copilot/gpt-4o`, which means new agents inherit this model unless you override it.

    This keeps your configuration declarative and makes it obvious which provider backs your primary model.

    json
    {
      agents: { defaults: { model: { primary: "github-copilot/gpt-4o" } } },
    }

Configuration

OptionDescriptionExample
agents.defaults.model.primarySets the primary default model that OpenClaw agents use, here pointing to a GitHub Copilot model.github-copilot/gpt-4o

Troubleshooting

The login command hangs or fails when run from a non-interactive environment (CI, background job).

The GitHub Copilot login requires an interactive TTY because it runs the GitHub device flow and prompts you to visit a URL and enter a one-time code. Run `openclaw models auth login-github-copilot` directly in a terminal instead of inside a non-interactive shell or CI job so you can complete the device login.

A specific Copilot model ID is rejected when you call it from OpenClaw.

Copilot model availability depends on your GitHub plan, so some model IDs may not be allowed for your account. 1`, and update both your `openclaw models set` command and config snippet to use that model.

Frequently asked questions

Powered by Mem0

Add persistent memory to OpenClaw

Official Mem0 plugin for OpenClaw keeps context across chats and tools. Smaller prompts, lower cost, better continuity for your agents.

More in Model providers