{"record":{"id":"902fe0c6940b398b","repo":"earendil-works/pi","slug":"no-usable-kind-api-key-api-key-oaut","errorCode":null,"errorMessage":"No usable ${kind === \"api_key\" ? \"API key\" : \"OAuth bearer token\"} is configured","messagePattern":"No usable (.+?) is configured","errorType":"validation","errorClass":"AuthCommandError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/credential-print.ts","lineNumber":82,"sourceCode":"\t\t};\n\t\tconst auth = provider.model\n\t\t\t? await modelRuntime.getAuth(provider.model, authOptions)\n\t\t\t: await modelRuntime.getAuth(provider.id, authOptions);\n\t\tconst value = getAuthCredential(auth);\n\t\tif (value) credentials.push({ providerId: provider.id, value });\n\t}\n\n\tif (credentials.length === 1) return credentials[0].value;\n\tif (credentials.length === 0) {\n\t\tconst providerId = providers[0]?.id;\n\t\tconst type = providerId ? credentialTypes.get(providerId) : undefined;\n\t\tif (cliProvider && kind === \"api_key\" && type === \"oauth\") {\n\t\t\tthrow new AuthCommandError(`Provider \"${providerId}\" is configured with OAuth, not an API key`);\n\t\t}\n\t\tif (cliProvider && kind === \"bearer_token\" && type !== \"oauth\") {\n\t\t\tthrow new AuthCommandError(`Provider \"${providerId}\" is not configured with an OAuth bearer token`);\n\t\t}\n\t\tthrow new AuthCommandError(`No usable ${kind === \"api_key\" ? \"API key\" : \"OAuth bearer token\"} is configured`);\n\t}\n\tthrow new AuthCommandError(\n\t\t`Multiple configured providers matched (${credentials.map(({ providerId }) => providerId).join(\", \")}). Specify --provider.`,\n\t);\n}\n","sourceCodeStart":64,"sourceCodeEnd":88,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/coding-agent/src/cli/credential-print.ts#L64-L88","documentation":"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).","triggerScenarios":"Thrown at packages/coding-agent/src/cli/credential-print.ts:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}