Protected_Protected Optional ReadonlyapiProtected ReadonlybaseProtected Readonlyv1ProtectedbaseOrigin this provider talks to; shown in PROVIDER_UNREACHABLE hints.
ProtectedbodyProtectedcachedThe last successful discovery, while younger than modelCacheTtlMs (default 5 min; 0 disables).
ProtectedclassifyProvider-specific reading of an error body. Return the fields you can
tell from it (code, providerCode, hint, retryAfterMs); the status
code default fills the rest.
ProtectederrorA fresh AIError for a failure this provider detects itself (no key, no model, blocked answer).
ProtectederrorOptionalmodel: stringProtectedfailOptionalmodelUsed: stringProtectedhttpJSON request. Non-2xx throws [HttpError]; the JSON body (if any) is on .json.
ProtectedhttpJSON request with the reply's status and headers (request ids live there).
ProtectedhttpStreaming request: the body as an async iterable of bytes, idle-guarded. Non-2xx throws [HttpError].
ProtectedokStreams a completion. The default runs the ordinary [process] and hands back its answer as a single chunk, so every provider can be consumed as a stream even where the upstream API has no streaming endpoint -- callers write one code path instead of two. Providers that do stream override it.
ProtectedrequestThe per-request knobs (signal, timeouts) as http options.
ProtectedresolveProtectedsetRecords what discovery found, keeping any seeded models first so the caller's chosen default stays the default.
Cheap by default: "up" means at least one model can be listed. No generation is sent.
ProtectedtoAny thrown value → AIError carrying this provider's classification.
Optionalmodel: string
Any server speaking the OpenAI chat-completions dialect: OpenAI itself, LM Studio, Groq, OpenRouter, DeepSeek, Mistral, xAI, Together, vLLM, ...