> ## Documentation Index
> Fetch the complete documentation index at: https://docs.a2agent.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Oh My Pi (OMP) with A2Agent

> Oh My Pi (OMP) accepts a custom OpenAI-compatible provider. Add A2Agent once and select any supported model from OMP - no separate account with each upstream lab.

This guide is for **Oh My Pi (`omp`)**, not OpenAI Codex CLI. OMP reads custom provider definitions from `~/.omp/agent/models.yml`.

## Prerequisites

* Download OMP from the official OMP website: [omp.sh](https://omp.sh/).

* An A2Agent API key. Create one from the [A2Agent dashboard](https://a2agent.me/login) after registering at [a2agent.me/register](https://a2agent.me/register).

* A model ID currently listed on the [A2Agent Models page](https://a2agent.me/models).

## Setup

<Steps>
  <Step title="Create the OMP provider configuration">
    Create OMP's configuration directory, then open the model configuration file:

    ```bash theme={null}
    mkdir -p ~/.omp/agent
    nano ~/.omp/agent/models.yml
    ```

    Add the following configuration:

    ```yaml theme={null}
    providers:
      a2agent:
        baseUrl: https://api.a2agent.me/v1
        api: openai-completions
        apiKey: A2AGENT_API_KEY
        authHeader: true
        models:
          - id: deepseek-v4-flash
            name: DeepSeek V4 Flash
            contextWindow: 128000

          - id: deepseek-v4-pro
            name: DeepSeek V4 Pro
            contextWindow: 128000

          - id: qwen3.7-plus
            name: Qwen 3.7 Plus
            contextWindow: 1000000
    ```

    Save the file in `nano` with `Ctrl+O`, press `Enter`, then exit with `Ctrl+X`.

    The important fields are:

    | Field | Value | Purpose |
    | - | - | - |
    | `baseUrl` | `https://api.a2agent.me/v1` | A2Agent's OpenAI-compatible API endpoint. |
    | `api` | `openai-completions` | Routes OMP requests through the OpenAI Chat Completions format. |
    | `apiKey` | `A2AGENT_API_KEY` | Reads the key from the WSL environment variable instead of storing it in the file. |
    | `authHeader` | `true` | Sends `Authorization: Bearer <key>` with A2Agent requests. |

    Model IDs are examples only. Use the exact model IDs currently shown on the [A2Agent Models page](https://a2agent.me/models). The model IDs above are examples and may change.
  </Step>

  <Step title="Verify that OMP loaded the provider">
    Run:

    ```bash theme={null}
    omp models find a2agent
    ```

    The verified `omp models find a2agent` result is:

    | Model | Context | Max output | Thinking | Images |
    | - | -: | :- | - | - |
    | `deepseek-v4-flash` | 128K | 1M | `low`, `high`, `max` | No |
    | `deepseek-v4-pro` | 128K | 1M | `low`, `high`, `max` | No |
    | `qwen3.7-plus` | 1M | 131K | `minimal`, `low`, `medium`, `high` | Yes |

    These values describe the A2Agent models currently returned by OMP's model lookup. Keep the `models.yml` metadata aligned with the current result, and re-run the command after A2Agent or OMP updates.
  </Step>

  <Step title="Start OMP with an A2Agent model">
    Move into the project you want OMP to work on:

    ```bash theme={null}
    cd ~/projects/your-project
    ```

    Start OMP with a specific A2Agent model:

    ```bash theme={null}
    omp --model a2agent/deepseek-v4-flash
    ```

    You can also start OMP normally and use the in-session model picker:

    ```text theme={null}
    /model
    ```

    Then select one of the `a2agent/...` entries.

    For a minimal connection test, ask OMP:

    ```text theme={null}
    State the active model ID only. Do not read or modify any files.
    ```

    If OMP replies and identifies the selected `a2agent/...` model, the connection is working.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorize">
    Verify all of the following:

    * The value is an A2Agent API key, not an OpenAI key.
    * `apiKey: A2AGENT_API_KEY` matches the environment-variable name exactly.
    * `authHeader: true` is present under the `a2agent` provider.
    * The key is active in the A2Agent dashboard.
  </Accordion>

  <Accordion title="a2agent`models do not appear in`omp models find a2agent">
    Check the configuration path and YAML syntax:

    ```bash theme={null}
    test -f ~/.omp/agent/models.yml && echo "models.yml found"
    omp models find a2agent
    ```

    Also verify that `a2agent` is not disabled in OMP's effective settings:

    ```bash theme={null}
    omp config get disabledProviders
    ```

    Remove `a2agent` from `disabledProviders` if it appears there. A disabled provider remains unavailable even when its key and configuration are correct.
  </Accordion>

  <Accordion title="Model not found">
    Model IDs are case-sensitive. Copy the model ID exactly from the [A2Agent Models page](https://a2agent.me/models), update `~/.omp/agent/models.yml`, then run:

    ```bash theme={null}
    omp models find a2agent
    ```

    Do not use a display name in `id`. For example, use `kimi-k2.7-code`, not `Kimi K2.7 Code`.
  </Accordion>
</AccordionGroup>
