Skip to content

Can't use AWS Bedrock custom Llm on BROWSERBASE Env #899

Closed

Description

@ulwiisibaq

Hi, I seems to always failed using stagehand with bedrock on BrowserBase env, the stagehand init would always expect to pass apiKey, even though we're using bedrock custom llm client.

is not supported yet to use bedrock on browserbase env? or is there any flag for it to skip the api key validation?
using LOCAL env, it works fine.

below are the sample of our constructor (the commented one are our trial with dummy api key)

  const stagehand = new Stagehand({
    ...StagehandConfig,
    // modelName: "aisdk",
    // modelClientOptions: {
    //   apiKey: "test",
    // },
    llmClient: new AISdkClient({
      model: bedrock("anthropic.claude-3-5-sonnet-20240620-v1:0"),
    }),
  });

error: "StagehandAPIError: modelApiKey is required

Activity

  1. gingeekrishna commented on Jun 2, 2026

    @gingeekrishna

    Hi @ulwiisibaq!

    This issue has been fixed. Here's a full summary:

    The fix

    The "modelApiKey is required" error was removed in #1953 (merged April 6, 2026). modelApiKey is now fully optional — custom LLM clients like AWS Bedrock handle their own authentication and don't need to pass an API key to Stagehand.

    Available since @browserbasehq/[email protected] (May 11, 2026). The current latest is 3.6.0.

    What to do

    Upgrade to 3.4.0 or later. Your existing configuration works without any changes:

    const stagehand = new Stagehand({
      env: "BROWSERBASE",
      llmClient: new AISdkClient({
        model: bedrock("anthropic.claude-3-5-sonnet-20240620-v1:0"),
      }),
      // No modelApiKey or dummy apiKey needed
    });

    If you're stuck on an older version and can't upgrade immediately, passing a placeholder as a temporary workaround:

    modelClientOptions: { apiKey: "placeholder" }

    Docs

    PR #966 adds a troubleshooting entry to the Models page covering this exact error, so future users searching for it will find the answer directly in the docs.

  2. added a commit that references this issue on Jun 21, 2026
    28cb782
  3. akeimach commented on Nov 3, 2026

    @akeimach
    Contributor

    Fixed by #1953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions