Creates the driver.
The vendor's API key, or an AI Credential's values in JSON.
OptionalendpointURL: stringOverrides the credential's endpoint and DefaultEndpoint.
Static ReadonlyDEFAULT_The SubQ Decisions API endpoint.
Static ReadonlyDEFAULT_The model used when DecisionParams.Model is empty.
ProtectedapiOnly sub-classes can access the API key
ProtectedAPIWhat the credential's apiKey must be, for the missing-key message, such as 'a Perplexity API key'.
ProtectedCredentialThe credential, read from the API key with ParseSystemOneCredential.
ProtectedDefaultThe vendor's endpoint, used when neither the constructor nor the credential gives one.
ProtectedDefaultThe model used when DecisionParams.Model is empty.
The Decisions API endpoint URL: the constructor's, else the credential's, else DefaultEndpoint, without trailing slashes.
ProtectedLegacyThe legacy environment variable that can hold the key, such as 'AI_VENDOR_API_KEY__PERPLEXITYDECISION'.
ProtectedSecretsThe secrets an error message must never show, each removed with RedactSecret. Defaults to the credential's API key; a driver that sends only part of it (Cloudflare's token) adds that part.
ProtectedServiceThe API's name in error messages, such as 'OpenRouter Decisions API'.
ProtectedBuildThe request body: { model, state, questions }.
Executes a typed decision request across one or more questions about a given state. This method wraps driver execution with input validation, output verification, execution timing, and structured error handling. It never throws.
Decision request parameters including state, questions, and model.
A Promise resolving to a DecisionResult.
ProtectedDescribeThe vendor's message when the body has one; otherwise the base default, the status and the start of the body.
ProtectedDoSends the questions and maps the typed answers.
ProtectedFailMarks the result failed because the response could not be mapped. Another model may still answer, so the failure allows failover (and is not 'Fatal', which would stop the failover loop).
ProtectedGetNo API key stops the call before any request, as a NoCredentials error that allows failover.
ProtectedGetThe one endpoint, whatever the model: the model travels in the body.
ProtectedGetPins three statuses whose ErrorAnalyzer reading would depend on SubQ's message text, which SubQ
documents only for validation_error. A 422 whose message names no validation word reads as a
fatal InvalidRequest, and a 403 whose message says "unauthorized" as a fatal Authentication
error: either stops Default Decision's failover loop, though another candidate could answer.
402 (no credits) is NoCredit;403 (the key cannot use the model) and 422 (a request SubQ rejects, which passed MJ's own
validation) are ModelError: another model may answer.Not Authentication or VendorValidationError: on those the runner drops the vendor's other
candidates, and the index it continues from then skips the next candidate (BaseModelRunner).
ErrorAnalyzer keeps the rest: 401 stays a fatal Authentication error, as for every other
driver; 429 and 503 allow failover.
ProtectedGetThe request headers. Defaults to the credential's API key as a bearer token and a JSON content type.
The model being asked.
ProtectedGetThe request body's model field. Defaults to the model unchanged.
The model being asked.
ProtectedResolveThe model to ask: DecisionParams.Model trimmed, or DefaultModel when it is empty.
ProtectedSendSends the request. This is the driver's only network call; a test double overrides it to stand in for the network.
The endpoint from GetEndpointURL.
The POST: method, headers, JSON body and the caller's cancellation signal.
ProtectedUnwrapReturns the System One response ({ model, answers, usage }) from a parsed 2xx body. Defaults to
the body itself. A vendor that wraps the response in an envelope unwraps it here, and throws
(with CreateSystemOneHTTPError) when the envelope reports a failure.
The parsed JSON body.
The HTTP status, for an error thrown from here.
ProtectedValidateValidates driver output DecisionResult against the requested questions.
Original decision request parameters.
Result returned by the driver.
An array of error descriptions, empty if valid.
ProtectedValidateValidates input DecisionParams against the decision contract.
Parameters to validate.
An array of error descriptions, empty if valid.
A
BaseDecisiondriver for Subquadratic's SubQ Decisions API,POST https://api.subq.ai/v1/systemone, which serves SubQ Snap (subq-snap-preview, in public preview; the ID changes at general availability, so the model-vendor row'sAPINameis where to change it). Errors arrive as{ detail: { error_type, message } }. The endpoint, key and error handling come from BaseHostedSystemOneDecision.Not sent: the API's optional
images(up to 4), whichDecisionParamshas no field for.