ModelProvider
Parameters and properties
Section titled “Parameters and properties”nameRequiredstringProvider name: openai or anthropic for the built-in providers.identityOptionalstring | undefinedStable key made of the provider name, protocol path and base URL, such as openai:responses:https://api.openai.com/v1. Built-in providers stamp it on reasoning blocks and replay them only to the same identity.validateOptional((model: AgentModel) => void) | undefinedCheck called by createAgent() with the normalized agent model; throw to reject unsupported settings before any request. The Anthropic provider requires maxOutputTokens and rejects reasoning minimal; the OpenAI provider defines no check.requestRequired(request: ModelRequest) => Promise<ModelResult>Send one request and resolve with its normalized result. Inside a harness, the request receives the agent model’s reasoning and maxOutputTokens and the run’s cancellation signal, and the reported usage is accounted once.streamOptional((request: ModelRequest) => AsyncIterable<ModelStreamEvent>) | undefinedStreaming variant of request: yields text-delta events as the answer arrives, then one result event. The harness uses it instead of request when present.