All integrations

Point Codex CLI at a Responses API that costs a fraction of the original

Codex CLI speaks the OpenAI Responses API. A2Agent serves that API on three interchangeable paths, so the CLI connects with a base URL and a key and then runs against GLM, Kimi, DeepSeek, Qwen or MiniMax.

Setup

  1. 1

    Create an API key

    Sign up and create a key in the dashboard. New accounts start with trial credit, so no top-up is needed to test the connection.

  2. 2

    Send the base URL and key

    Codex CLI reads its provider configuration from the environment or from its config file, depending on version. Whichever your build uses, these are the two values it needs.

    export OPENAI_BASE_URL="https://a2agent.me/v1"
    export OPENAI_API_KEY="sk-your-a2agent-key"
  3. 3

    Confirm the Responses endpoint answers

    A direct call verifies the key, the group and the model before the CLI touches it.

    curl https://a2agent.me/v1/responses \
      -H "content-type: application/json" \
      -H "authorization: Bearer sk-your-a2agent-key" \
      -d '{
        "model": "deepseek-v4-pro",
        "input": "Reply with OK"
      }'

What differs from the official endpoint

Three paths, one handler

POST /v1/responses, POST /responses and POST /backend-api/codex/responses all resolve to the same handler, and each accepts a wildcard subpath. Codex builds differ in which one they call, so any of them works and none of them behaves differently. Pick whichever your version sends and do not worry about the prefix.

There is a WebSocket face too

GET /v1/responses upgrades to a WebSocket, served by a dedicated forwarder with its own connection pool. If your Codex build opens a socket rather than posting, it lands on that path rather than failing.

The upstream comes from the model name

A key can span several groups. The gateway resolves the group from the requested model on every call, so switching between deepseek-v4-pro and glm-5.2 needs no reconfiguration. Model ids are case-sensitive — copy them exactly as the models page prints them.

Chat Completions is available on the same key

POST /v1/chat/completions (and the /chat/completions alias without the prefix) is served for the same key, routed to the OpenAI-compatible path for every platform sold here. Tools that speak Chat Completions instead of Responses need no second credential.

Models worth starting with

Any model in the catalogue works through this client. These are the ones with a full page covering pricing, context window and setup.

Questions

Which endpoint should I configure?

Use https://a2agent.me/v1. If your Codex build calls the unprefixed /responses or the /backend-api/codex/responses path, those reach the same handler and work identically.

Do I need a separate key per model family?

No. One key can cover several groups, and the gateway picks the upstream from the model name on each request.

Are the model ids the same as OpenAI's?

No. Use the ids from the models page, such as deepseek-v4-pro or glm-5.2. They are case-sensitive.

What happens if my key has no group assigned?

The request is rejected before it reaches an upstream, with a structured error rather than a vague failure. Assign a group to the key in the dashboard.

Is image generation available?

Yes, on OpenAI-compatible platforms. /v1/images/generations and /v1/images/edits answer 404 with an explicit "Images API is not supported for this platform" message on the platforms that do not offer it.

Trial credit on sign-up, billed per token, no minimum spend.