Skip to main content
Codex Desktop doesn’t expose a custom endpoint field, so this guide uses CC Switch to add A2Agent as a provider and turn on routing. After that, your coding sessions run on A2Agent models instead of OpenAI’s. The setup mirrors the Claude Desktop flow: add a provider in CC Switch, enter your A2Agent key and base URL, then select a model in Codex Desktop.

Prerequisites

Setup

1

Add a Provider

Open CC Switch, switch to the Codex tab at the top, and click the orange 「+」 in the top-right corner.On the Add New Provider page, keep Codex as the provider and click Custom Configuration in the top-left corner.Image
2

Fill in the Provider Information

  • Provider Name:Custom, e.g. A2Agent-Codex.
  • API Key:Your A2Agent API key.
  • API Base URL:https://api.a2agent.me/v1 (OpenAI Responses-compatible endpoint; must end with /v1). Image
  • Default Model:Click the download button on the right to fetch a2agent Models, then choose the model you want, e.g:deepseek-v4-pro. Image
  • Advanced Options:To switch models when using Codex, configure model mapping in Advanced Options, select “Chat Completions” as the Upstream Format , and then click Add Model after fetching the model list. Image
3

Configure config.toml (TOML)

Write the following configuration to the Codex config file:
When finished, click 「 + Add 」 in the bottom-right corner.
4

Enable Routing

  • Click Settings in the top-left corner → Routing → Local Routing.
  • Turn on Show the local routing switch on the main page.
  • Turn on the Routing master switch. Image
5

Enable the Provider Channel

  • Return to the provider list and click Enable on the A2Agent-Codex card.
  • When the button shows In Use, the provider has been enabled.
After completing the configuration, restart CC-Switch and Codex, and you can then start using it.