Skip to content

Using OpenAI subscription in Zed AI

Warning

This method is intended for LOCAL AND PERSONAL USE ONLY!

OpenAI is not clearly banning authorisation via the OAuth token. However using other CLIProxyAPI functionalities like "account switching" are in clear violation of any AI provider, we do not recommend or endorse using it.

We strongly recommend using this method on your own risk, respect ToS/rate limits and for your personal (local) use only.

Zed AI by itself does not provide functionality to connect to OpenAI platform using OAuth (Plus/Pro plans).

Connecting other external agents resulted in either reduces functionality or was bugged or inconvenient: - OpenCode stops mid toolchain calls due to phantom errors - Codex does not provide fine grained permissions model

Workaround using CLIProxyAPI

  1. Obtain OpenAI OAuth token docker run --rm -p 1455:1455 -v ./config.yaml:/CLIProxyAPI/config.yaml -v ./auth:/root/.cli-proxy-api eceasy/cli-proxy-api:latest /CLIProxyAPI/CLIProxyAPI --codex-login
  2. Create local config file for CLI proxy, and docker-compose
    config.yaml
    # docker run --rm -p 8317:8317 -v ./conf.yaml:/CLIProxyAPI/config.yaml -v /Users/kacper/.cli-proxy-api:/root/.cli-proxy-api eceasy/cli-proxy-api:latest
    
    port: 8317
    remote-management:
      allow-remote: false
      secret-key: ""
      disable-control-panel: false
    auth-dir: "./auth"
    debug: false
    request-log: false
    logging-to-file: false
    usage-statistics-enabled: true
    request-retry: 3
    quota-exceeded:
      switch-project: false
      switch-preview-model: false
    disable-cooling: false
    api-keys:
      - "dummy" # your "api key" usen when connecting to the proxy api
    ws-auth: false
    
    docker-compose.yaml
    services:
      cli-proxy-api:
        image: eceasy/cli-proxy-api:latest
        container_name: cli-proxy-api
        ports:
          - "8317:8317"
        volumes:
          - ./config.yaml:/CLIProxyAPI/config.yaml
          - ./auths:/root/.cli-proxy-api
          - ./logs:/CLIProxyAPI/logs
        restart: unless-stopped
    
  3. Start container docker compose up -d
  4. In Zed, add the OpenAPI compatible provider with following config:
    Zed config
      "language_models": {
        "openai_compatible": {
          "cli-proxy-medium": {
            "api_url": "http://localhost:8317/v1",
            "available_models": [
              {
                "name": "gpt-5.5",
                "display_name": "CLI proxy gpt-5.5 (medium)",
                "max_tokens": 1050000,
                "max_output_tokens": 128000,
                "max_completion_tokens": 30000,
                "reasoning_effort": "medium",
                "capabilities": {
                  "tools": true,
                  "images": false,
                  "parallel_tool_calls": true,
                  "prompt_cache_key": true,
                  "chat_completions": true,
                },
              },
            ],
          },
        },
      },
    
  5. (Optionally) Set default and favourite models
    Default and favourite models
        "default_model": {
          "provider": "cli-proxy-medium",
          "model": "gpt-5.5",
          "enable_thinking": false,
        },
        "favorite_models": [
          {
            "provider": "cli-proxy-high",
            "model": "gpt-5.5",
            "enable_thinking": true,
          },
          {
            "provider": "cli-proxy-medium",
            "model": "gpt-5.5",
            "enable_thinking": true,
          },
          {
            "provider": "cli-proxy-xhigh",
            "model": "gpt-5.5",
            "enable_thinking": true,
          },
        ],
    

Note

Duplicate the block in available_model array for every reasoning_effort you want to use, currently Zed does not show reasoning selector for OpenAI compatibile models