stagehand icon indicating copy to clipboard operation
stagehand copied to clipboard

Error executing agent task: No LLM API key or LLM Client configured. An LLM API key or a custom LLM Client is required to use act, extract, or observe.

Open Quadra-Kill opened this issue 1 month ago • 0 comments

import "dotenv/config";

import { createOpenRouter } from '@openrouter/ai-sdk-provider' import { AISdkClient, Stagehand } from '@browserbasehq/stagehand';

async function main() {

console.log('OPENROUTER_API_KEY:', process.env.OPENROUTER_API_KEY ? '已设置' : '未设置');

const openrouter = createOpenRouter({ apiKey: process.env.OPENROUTER_API_KEY, });

const providerClient = new AISdkClient({ model: openrouter("google/gemini-2.5-flash"), });

const stagehand = new Stagehand({ env: "LOCAL", llmClient: providerClient, });

await stagehand.init();

Quadra-Kill avatar Nov 29 '25 03:11 Quadra-Kill