Skip to content

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. #1319

@Quadra-Kill

Description

@Quadra-Kill

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();

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