Local provider auth (btca-server)
btca reads credentials from OpenCode’s auth storage:- macOS/Linux:
~/.local/share/opencode/auth.json - Windows:
%APPDATA%/opencode/auth.json
opencode(API key)openrouter(API key)openai(OAuth, no API keys)github-copilot(OAuth device flow)openai-compat(optional API key)anthropic(API key)google(API key or OAuth)minimax(API key)
OPENCODE_API_KEY(for provideropencode)OPENROUTER_API_KEY(for provideropenrouter)MINIMAX_API_KEY(for providerminimax)
Connect or disconnect
btca connect performs OAuth for openai and github-copilot, prompts for API keys when
required, and falls back to opencode auth --provider <provider> for other providers.
btca wipe removes BTCA config files in the current directory and global BTCA config files
(with a confirmation prompt unless --yes is passed).
For github-copilot, btca uses device flow OAuth and opens a browser prompt to complete
the sign-in.
GitHub Copilot model availability can vary by endpoint, account, and organization policy. Public
model catalogs may list models that the Copilot chat API still rejects for your specific token or
plan, so treat Copilot model selection as best-effort rather than guaranteed.
For openai-compat, btca connect also collects the required provider details:
- Base URL (required): the root URL of your OpenAI-compatible server. The AI SDK appends its own endpoint paths, so btca must know the base URL to send requests to the correct host.
- Provider name (required): the identifier the AI SDK uses to namespace requests for this OpenAI-compatible provider.
- Model ID (required): the model to use for requests; stored in
btca.config.jsoncasmodel. - API key (optional): only if your server requires authentication; stored in OpenCode auth.