earendil-works/pi · error · AuthCommandError
No usable is configured
Error message
No usable ${kind === "api_key" ? "API key" : "OAuth bearer token"} is configured What it means
After collecting credentials across candidate providers, none produced a usable value: no API key or OAuth bearer token is configured (or the requested kind mismatches the configured credential type, e.g. api_key requested for an OAuth provider).
Solutions
- Authenticate a provider first with /login or the appropriate environment variables
- Verify configured providers with pi auth check
- Use --provider to target a specific credential
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/coding-agent/src/cli/credential-print.ts:82 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/902fe0c6940b398b.
Report an issue: GitHub.
Appendix: source
Thrown at packages/coding-agent/src/cli/credential-print.ts:82
};
const auth = provider.model
? await modelRuntime.getAuth(provider.model, authOptions)
: await modelRuntime.getAuth(provider.id, authOptions);
const value = getAuthCredential(auth);
if (value) credentials.push({ providerId: provider.id, value });
}
if (credentials.length === 1) return credentials[0].value;
if (credentials.length === 0) {
const providerId = providers[0]?.id;
const type = providerId ? credentialTypes.get(providerId) : undefined;
if (cliProvider && kind === "api_key" && type === "oauth") {
throw new AuthCommandError(`Provider "${providerId}" is configured with OAuth, not an API key`);
}
if (cliProvider && kind === "bearer_token" && type !== "oauth") {
throw new AuthCommandError(`Provider "${providerId}" is not configured with an OAuth bearer token`);
}
throw new AuthCommandError(`No usable ${kind === "api_key" ? "API key" : "OAuth bearer token"} is configured`);
}
throw new AuthCommandError(
`Multiple configured providers matched (${credentials.map(({ providerId }) => providerId).join(", ")}). Specify --provider.`,
);
}
View on GitHub (pinned to 4af9d21d3b)