> ## 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 WorkBuddy with A2Agent for Lower-Cost Models

> WorkBuddy lets you set a custom API endpoint, key and model ID. Enter your A2Agent credentials and WorkBuddy routes its requests through the A2Agent gateway.

WorkBuddy's chat and agent workflows continue to use the same interface after the custom connection is saved.

## Prerequisites

* WorkBuddy is installed. Download it from the official site: [workbuddy.cn](https://www.workbuddy.cn/).
* You have an A2Agent API key. Register at [a2agent.me/register](https://a2agent.me/register), then create a key in the [A2Agent dashboard](https://a2agent.me/login).
* You have a model ID currently listed on the [A2Agent Models page](https://a2agent.me/models).

## A2Agent connection values

Use these values first:

| WorkBuddy field | Value |
| - | - |
| Connection type | Custom API |
| Protocol | OpenAI-compatible, if the UI offers a protocol selector |
| Base URL / API URL | `https://api.a2agent.me/v1` |
| API key | Your A2Agent API key |
| Model | An exact model ID currently available in A2Agent |

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.

## Setup

<Steps>
  <Step title="Open WorkBuddy model settings">
    In WorkBuddy, open:

    ```text theme={null}
    Avatar → Settings → Model
    ```

    Depending on the WorkBuddy version, the buttons may be labeled **Add model**, **Custom model**, or **Manage models**.
  </Step>

  <Step title="Choose Custom API">
    On the model settings page, select:

    ```text theme={null}
    Custom API / Custom
    ```

    If the page offers **Provider**, **Local deployment**, and **Custom API**, choose **Custom API**. A2Agent is a remote OpenAI-compatible API, not a local Ollama service.
  </Step>

  <Step title="Enter the A2Agent API URL">
    Enter this value in the URL, Base URL, or API Endpoint field:

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

    Do not append `/chat/completions` unless your WorkBuddy version explicitly asks for a complete endpoint URL. A2Agent's standard request endpoint is:[https://api.a2agent.me/v1/chat/completions](https://api.a2agent.me/v1/chat/completions)
  </Step>

  <Step title="Enter your API key">
    Paste the API key created in the A2Agent dashboard into WorkBuddy's API key field.
  </Step>

  <Step title="Enter a model ID">
    In the Model field, enter an exact model ID currently available in your A2Agent account:

    ```text theme={null}
    YOUR_MODEL_ID
    ```

    Model IDs are case-sensitive. Copy the ID shown by A2Agent exactly; do not rewrite it.
  </Step>

  <Step title="Save and select the model">
    Save the custom model. Return to the WorkBuddy chat view and select the newly added model from the model picker.

    If the model does not appear after saving, fully quit and reopen WorkBuddy, then check the model list again.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorize">
    Check that:

    * The key came from the A2Agent dashboard.
    * The key was pasted completely, without leading/trailing spaces or line breaks.
    * You did not enter an OpenAI key, login password, or model name.
    * The key is still active in your A2Agent account.
  </Accordion>

  <Accordion title="The model does not appear after saving">
    Check the following in order:

    1. You selected **Custom API / Custom**.
    2. You entered the model ID, not the display name.
    3. You clicked Save.
    4. You fully quit and reopened WorkBuddy.
    5. The model ID exactly matches the current A2Agent catalog.
  </Accordion>

  <Accordion title="Model not found">
    Copy the current model ID from [A2Agent Models](https://a2agent.me/models). Do not use an old model name or alter its capitalization. Save the change and select the model again.
  </Accordion>

  <Accordion title="`404`or an endpoint path error">
    Start with:

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

    If WorkBuddy still reports a path error, enable **Advanced settings → Custom Protocol** and use:

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

## Official references

* [WorkBuddy model configuration](https://cloud.tencent.com/document/product/1831/134445)
* [WorkBuddy official download](https://www.workbuddy.cn/)
* [A2Agent Quickstart](https://docs.a2agent.me/quickstart)
* [A2Agent Models](https://a2agent.me/models)
* [A2Agent API reference](https://docs.a2agent.me/api-reference/overview)
