> ## 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 Cline CLI with A2Agent

> Connect Cline CLI to A2Agent through the “Bring your own provider” option.

Use DeepSeek, Kimi, GLM, MiniMax, Qwen, and other supported models through a single A2Agent API key at lower cost than official provider pricing.

Cline CLI supports OpenAI-compatible providers. After configuring A2Agent through `cline auth`, you can run interactive terminal sessions, one-shot coding tasks, scripts, and JSON-based automation through A2Agent.

## Prerequisites

* Cline CLI installed — follow the [official installation guide](https://docs.cline.bot/getting-started/installing-cline)

* An A2Agent API key — [sign up at a2agent.me/register](https://a2agent.me/register) to get one

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

## Setup

<Steps>
  <Step title="Open Cline CLI authentication">
    Run:

    ```bash theme={null}
    cline auth
    ```

    This opens the interactive provider and authentication setup in your terminal.
  </Step>

  <Step title="Select “Bring your own provider”">
    This option allows Cline CLI to connect to an external provider using a custom API endpoint and API key.
  </Step>

  <Step title="Select “OpenAI Compatible”">
    A2Agent provides an OpenAI-compatible API, so no additional SDK or provider-specific integration is required.
  </Step>

  <Step title="Enter the A2Agent provider information">
    Example:

    ```text theme={null}
    Base URL: https://api.a2agent.me/v1
    API Key: YOUR_A2AGENT_KEY
    Model: deepseek-v4-flash
    ```

    `deepseek-v4-flash` is only an example. Use the exact model ID currently shown on the [A2Agent Models page](https://a2agent.me/models).
  </Step>

  <Step title="Run Cline CLI with A2Agent">
    Start an interactive session:

    ```bash theme={null}
    cline
    ```

    Or run a one-shot task:

    ```bash theme={null}
    cline "Review this repository and suggest improvements."
    ```

    If Cline returns a response, the A2Agent connection is working.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    Cline reached A2Agent, but the API key was rejected.

    * Confirm that you entered a valid A2Agent API key.
    * Make sure the complete key was copied.
    * Check for extra spaces or line breaks.
    * Do not use an OpenAI API key.
    * Run `cline auth` again and re-enter the key.
  </Accordion>

  <Accordion title="Connection error">
    Confirm that the base URL is exactly:

    ```text theme={null}
    https://api.a2agent.me/v1
    ```
  </Accordion>

  <Accordion title="Model not found">
    The Model field or `--model` value must contain an exact A2Agent model ID.

    Check the current list at:[https://a2agent.me/models](https://a2agent.me/models)

    Model availability and IDs may change over time.
  </Accordion>
</AccordionGroup>
