{"record":{"id":"f5aa1e4176292716","repo":"continuedev/continue","slug":"accesskeyid-is-required-for-bedrock-api-only-foun","errorCode":null,"errorMessage":"accessKeyId is required for Bedrock API. Only found secretAccessKey","messagePattern":"accessKeyId is required for Bedrock API\\. Only found secretAccessKey","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/openai-adapters/src/apis/Bedrock.ts","lineNumber":67,"sourceCode":"    (getSecureID as any).uuid = uuidv4();\n  }\n  return `<!-- SID: ${(getSecureID as any).uuid} -->`;\n}\n\n/**\n * Interface for tool use state tracking\n */\ninterface ToolUseState {\n  toolUseId: string;\n  name: string;\n  input: string;\n}\n\nexport class BedrockApi implements BaseLlmApi {\n  constructor(protected config: BedrockConfig) {\n    if (config.env?.accessKeyId || config?.env?.secretAccessKey) {\n      if (!config.env?.accessKeyId) {\n        throw new Error(\n          \"accessKeyId is required for Bedrock API. Only found secretAccessKey\",\n        );\n      }\n      if (!config.env?.secretAccessKey) {\n        throw new Error(\n          \"secretAccessKey is required for Bedrock API. Only found accessKeyId\",\n        );\n      }\n    }\n  }\n\n  async getCreds() {\n    if (this.config?.env?.accessKeyId && this.config?.env?.secretAccessKey) {\n      return {\n        accessKeyId: this.config.env.accessKeyId,\n        secretAccessKey: this.config.env.secretAccessKey,\n      };\n    }","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/openai-adapters/src/apis/Bedrock.ts#L49-L85","documentation":"The Bedrock adapter requires AWS credentials to come in pairs: if either accessKeyId or secretAccessKey is set in config.env, both must be present. This constructor guard catches the specific case where only secretAccessKey was supplied, failing fast instead of letting the AWS SDK attempt unsigned/failed requests with a confusing downstream error.","triggerScenarios":"Constructing BedrockApi with config.env containing secretAccessKey but not accessKeyId — e.g. a config where one key was deleted or never set while the other remained.","commonSituations":"Rotating AWS keys and only updating one value; copying config templates that have only one key filled in; misunderstanding that Bedrock in this adapter uses static keys rather than the default AWS credential chain when any env key is present.","solutions":["Add the missing accessKeyId alongside secretAccessKey in config.env","Prefer IAM roles / the ambient AWS credential chain by omitting both env keys entirely if running on AWS infrastructure","Double-check for typos/case: it must be exactly accessKeyId and secretAccessKey"],"exampleFix":"// before\n{ provider: 'bedrock', env: { secretAccessKey: 'wJalr...', region: 'us-east-1' } }\n\n// after\n{ provider: 'bedrock', env: { accessKeyId: 'AKIA...', secretAccessKey: 'wJalr...', region: 'us-east-1' } }","handlingStrategy":"validation","validationCode":"const env = config.env ?? {};\nif (env.secretAccessKey && !env.accessKeyId) {\n  throw new Error('accessKeyId missing: provide both AWS keys or neither (use IAM role)');\n}","typeGuard":"const hasCompleteBedrockCreds = (env?: BedrockEnv): boolean =>\n  Boolean(env?.accessKeyId && env?.secretAccessKey) ||\n  (!env?.accessKeyId && !env?.secretAccessKey);","tryCatchPattern":"try { new BedrockApi(config); } catch (e) {\n  if (e instanceof Error && e.message.includes('accessKeyId is required')) {\n    // fetch the key from secrets manager and retry, or drop both keys to use IAM\n  }\n  throw e;\n}","preventionTips":["Store AWS keys as a pair in your secret manager and load them together","On AWS infrastructure, prefer omitting both static keys and using the SDK credential chain"],"tags":["bedrock","aws","credentials","config"],"backgroundTag":"incomplete-credentials","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}