gitbutlerapp/gitbutler · error · Error
Please sign in to use GitButler's AI API
Error message
Please sign in to use GitButler's AI API
What it means
Validation branch of the AI credential test: validateConfiguration() returned false for an OpenAI/Anthropic model kind while the app is set up to use GitButler's hosted AI API, but no user is signed in. The error identifies authentication as the fix rather than a missing key, because the hosted API is authorized through the GitButler account.
Solutions
- Prompt the user to sign in to their GitButler account, then rerun the credential check
- Offer switching to a bring-your-own-key model with a custom API key if they prefer not to sign in
- Open the sign-in flow directly from the settings panel to reduce friction
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at apps/desktop/src/components/settings/AiCredentialCheck.svelte:77 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18).
Data as JSON: /api/errors/370e6041e48083ee.
Report an issue: GitHub.
Appendix: source
Thrown at apps/desktop/src/components/settings/AiCredentialCheck.svelte:77
abortController = new AbortController();
try {
// Get current model kind
modelKind = await aiService.getModelKind();
debugInfo = `Model kind: ${modelKind}`;
// Check if using GitButler API
isUsingButlerAPI = await aiService.usingGitButlerAPI();
debugInfo += `, Using GB API: ${isUsingButlerAPI}`;
// Check if configuration is valid
const isConfigValid = await aiService.validateConfiguration();
debugInfo += `, Config valid: ${isConfigValid}`;
if (!isConfigValid) {
if (modelKind === ModelKind.OpenAI || modelKind === ModelKind.Anthropic) {
if (isUsingButlerAPI && !userService.user) {
throw new Error("Please sign in to use GitButler's AI API");
} else {
throw new Error("Please provide a valid API key for your selected AI service");
}
} else if (modelKind === ModelKind.Ollama) {
// Get Ollama configuration for more detailed error
const endpoint = await aiService.getOllamaEndpoint();
const model = await aiService.getOllamaModelName();
throw new Error(
`Please check Ollama configuration: endpoint=${endpoint}, model=${model}`,
);
} else if (modelKind === ModelKind.LMStudio) {
// Get LM Studio configuration for more detailed error
const endpoint = await aiService.getLMStudioEndpoint();
throw new Error(`Please check LM Studio configuration: endpoint=${endpoint}`);
}
}
debugInfo += `, Testing commit message generation`;View on GitHub (pinned to 58e5313667)