Skip to content

ALLOW_REAL_REQUESTS

ALLOW_REAL_REQUESTS: boolean = true

Global flag controlling whether real LLM API calls are allowed.

When false, resolveModel() throws before making any network call for string-based model identifiers (e.g., “anthropic/claude-sonnet-4-6”). Does NOT affect LanguageModelV3 objects passed directly (TestModel, FunctionModel, etc.).

Set to false in test setup to prevent accidental real API calls:

import { setAllowRealRequests } from "agent-express/test"
setAllowRealRequests(false)
true