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

# Use WorkBuddy AI with CometAPI

> Configure the WorkBuddy AI desktop app with CometAPI through the Custom provider dialog or models.json.

Use the [WorkBuddy AI](https://www.workbuddy.ai/) desktop app with CometAPI through its OpenAI-compatible Custom provider. You can configure the connection in the app or with a `models.json` file.

Official WorkBuddy AI references:

* [Model Configuration](https://www.workbuddy.ai/docs/workbuddy/From-Beginner-to-Expert-Guide/Function-Description/Model)
* [models.json Configuration Guide](https://www.workbuddy.ai/docs/cli/models)

## Prerequisites

* [WorkBuddy AI](https://www.workbuddy.ai/) installed on your computer
* A [CometAPI](https://www.cometapi.com) account with an active API key
* A model ID from the [CometAPI model list](/overview/models)

## Choose a setup method

<CardGroup cols={2}>
  <Card title="Configure in the app" icon="desktop" href="#configure-the-app">
    Use **Settings** → **Model** to add a Custom provider through the graphical interface.
  </Card>

  <Card title="Configure with models.json" icon="file-code" href="#configure-models-json">
    Store a reusable model definition in the user-level or project-level WorkBuddy AI configuration file.
  </Card>
</CardGroup>

## Configure the app

<Steps>
  <Step title="Open the model settings">
    In WorkBuddy AI, open **Settings** → **Model**, then select **Add Model**.
  </Step>

  <Step title="Select the Custom provider">
    In the **Provider** field, select **Custom**. This option accepts an OpenAI-compatible API connection.
  </Step>

  <Step title="Enter the CometAPI connection values">
    Enter the following values in the Add Model dialog:

    | Field | Value |
    | - | - |
    | Provider | `Custom` |
    | Endpoint | `https://api.cometapi.com/v1/chat/completions` |
    | API Key | Your CometAPI API key |
    | Model Name | The model ID from the [CometAPI model list](/overview/models) |

    The endpoint includes the complete `/chat/completions` path. Enable **Custom Protocol** so WorkBuddy sends the URL exactly as entered instead of adding another `/chat/completions` path.

    <Frame>
      <img src="https://mintcdn.com/cometapi/yz6X9U_FscWpHj8q/images/integrations/workbuddy-ai-add-model.png?fit=max&auto=format&n=yz6X9U_FscWpHj8q&q=85&s=3dabe44ed2e5f275370cc55fb6960c38" alt="WorkBuddy AI Add Model dialog with the Custom provider and CometAPI connection fields" width="1800" height="1360" data-path="images/integrations/workbuddy-ai-add-model.png" />
    </Frame>

    The screenshot uses `gpt-6-astra` as an example model name. Choose a model ID that is available in your CometAPI account.
  </Step>

  <Step title="Set model capabilities">
    Enable **Tool Calling**, **Image Input**, or **Reasoning** only when the selected model supports that capability. Use **Reasoning Only** and **Allow Disabling Reasoning** when those controls match the model's reasoning behavior.
  </Step>

  <Step title="Test and save the model">
    In the Add Model dialog, click **Test connection**, then click **Save** after the connection check completes.
  </Step>
</Steps>

## Configure models.json

WorkBuddy AI reads custom models from a user-level `~/.codebuddy/models.json` file or a project-level `<workspace>/.codebuddy/models.json` file. Project-level configuration takes priority for matching model IDs.

Create the configuration directory if it does not exist, then save the following JSON. The example uses an environment variable reference so that the API key does not appear in the file:

```json theme={null}
{
  "models": [
    {
      "id": "your-model-id",
      "name": "CometAPI model",
      "vendor": "CometAPI",
      "apiKey": "${COMETAPI_KEY}",
      "url": "https://api.cometapi.com/v1/chat/completions",
      "supportsToolCall": false,
      "supportsImages": false,
      "supportsReasoning": false
    }
  ],
  "availableModels": [
    "your-model-id"
  ]
}
```

Set `COMETAPI_KEY` in the environment that starts WorkBuddy AI. Replace `your-model-id` with a model ID from the [CometAPI model list](/overview/models). The `url` value must be the complete OpenAI Chat Completions path. Change a capability flag to `true` only when the selected model supports that capability.

Set the file permissions to owner read/write on macOS or Linux:

```bash theme={null}
chmod 600 "$HOME/.codebuddy/models.json"
```

If you use a project-level file, create it at `<workspace>/.codebuddy/models.json` and keep the file out of version control when it contains local configuration. WorkBuddy AI reloads saved `models.json` changes and labels models added through the file as custom models.

<Note>
  The `availableModels` array controls which model IDs appear in the model selector. If the array is empty or omitted, WorkBuddy AI displays all configured models.
</Note>

## Verify the connection

After either setup method, select the CometAPI model in the WorkBuddy AI model selector and send a short prompt, such as:

```text theme={null}
Reply with one sentence: WorkBuddy AI is connected through CometAPI.
```

A response confirms that WorkBuddy AI can reach the configured CometAPI model. If the model does not appear, check that the model ID matches the CometAPI model list and that `availableModels` includes the same ID when you use that field.

## Troubleshooting

<AccordionGroup>
  <Accordion title="The model does not appear in WorkBuddy AI">
    Confirm that the `id` value matches a CometAPI model ID. If `availableModels` is present, add the same ID to that array. For a project configuration, check `<workspace>/.codebuddy/models.json` before the user-level file.
  </Accordion>

  <Accordion title="The connection test fails">
    Check that the API key is active and that the endpoint is exactly `https://api.cometapi.com/v1/chat/completions`. For a `models.json` setup, confirm that `COMETAPI_KEY` is available in the environment that starts WorkBuddy AI.
  </Accordion>

  <Accordion title="The request uses the wrong path">
    Use the complete `/chat/completions` path in the Endpoint field and the `url` field. In the app, enable **Custom Protocol** so WorkBuddy sends the complete URL without adding another path.
  </Accordion>

  <Accordion title="The model sends unsupported features">
    Turn off capability flags that the selected model does not support. Tool calling, image input, and reasoning are independent settings.
  </Accordion>
</AccordionGroup>

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "HowTo",
        "@id": "https://apidoc.cometapi.com/integrations/workbuddy-ai#howto",
        "name": "Use WorkBuddy AI with CometAPI",
        "description": "Configure WorkBuddy AI with CometAPI through the Custom provider dialog or models.json.",
        "step": [
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/workbuddy-ai#step-1",
            "position": 1,
            "name": "Open the model settings",
            "text": "Open WorkBuddy AI Settings, select Model, and choose Add Model."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/workbuddy-ai#step-2",
            "position": 2,
            "name": "Select the Custom provider",
            "text": "Select Custom as the provider for an OpenAI-compatible API connection."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/workbuddy-ai#step-3",
            "position": 3,
            "name": "Enter the CometAPI connection values",
            "text": "Enter the CometAPI Chat Completions URL, API key, and model ID."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/workbuddy-ai#step-4",
            "position": 4,
            "name": "Set model capabilities",
            "text": "Enable the capability flags that match the selected CometAPI model."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/workbuddy-ai#step-5",
            "position": 5,
            "name": "Test and save the model",
            "text": "Test the connection, save the model, and send a short prompt from WorkBuddy AI."
          }
        ]
      },
      {
        "@type": "BreadcrumbList",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "CometAPI Docs",
            "item": "https://apidoc.cometapi.com/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "Integrations",
            "item": "https://apidoc.cometapi.com/integrations"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "Use WorkBuddy AI with CometAPI",
            "item": "https://apidoc.cometapi.com/integrations/workbuddy-ai"
          }
        ]
      }
    ]
    }
    `}
</script>
