# CodeBuddy (/docs/providers/codebuddy)

The CodeBuddy account answers with the visitor's Tencent CodeBuddy account. The wallet lists it as CodeBuddy under "With your plan", with the id `codebuddy`.

## What the visitor needs [#what-the-visitor-needs]

A CodeBuddy account with a plan. The wallet shows the account as paid from the plan.

## Sign in [#sign-in]

1. In the wallet, the visitor picks CodeBuddy under "With your plan".
2. The wallet asks CodeBuddy for a sign in state at `https://www.codebuddy.ai/v2/plugin/auth/state` and opens the sign in address CodeBuddy returns in a window. The side panel asks the visitor to sign in and approve in that window, with no code to compare.
3. The visitor signs in to codebuddy.ai and approves.
4. The wallet asks CodeBuddy for the token of that state each time a page finishes loading in the window, when the window closes, and when the visitor presses "I approved it".
5. CodeBuddy returns the tokens. The wallet reads the account's catalog at `https://www.codebuddy.ai/v3/config` and picks its first model that calls tools, and the account is connected.

The sign in stays open for ten minutes. The wallet renews the access token with the refresh token from one minute before it expires.

## Models [#models]

The wallet has no model list for CodeBuddy. The account answers with the model picked at sign in, `deepseek-v4-pro` when the catalog offers no model that calls tools, and the side panel shows no model buttons for its sites.

## Usage and limits [#usage-and-limits]

The wallet reads no usage header specific to CodeBuddy. It reads `x-ratelimit-remaining-tokens` and `x-ratelimit-limit-tokens` on any answer that carries them, as it does for every account. Without them, the card keeps saying "Usage shows after the first answer", and Auto ranks the account among the accounts with no reading.

## Calls [#calls]

Answers come from `https://www.codebuddy.ai/v2/chat/completions` in the OpenAI chat completions protocol. Each call carries the token and the account headers CodeBuddy reads from its claims: `X-User-Id`, plus `X-Tenant-Id` and `X-Enterprise-Id` when the token names them. All four request options reach CodeBuddy.

## Known issues [#known-issues]

- The sign in borrows the login of the CodeBuddy command line tool (`platform=CLI`).
- The calls present themselves as that tool, with `User-Agent: CLI/2.96.0 CodeBuddy/2.96.0` and `X-Domain: www.codebuddy.ai`.
