ai.wire.send_as_with_wire

Same contract as `send_as`, plus the LLMCall wire record. On a non-2xx or transport failure this still throws the same classified error `send_as` throws — composite clients build failed-leg records from the error itself (`_failed_leg_call`), so no record accompanies a throw. `capture_wire` gates the request/response bodies; status, headers, and timing are always recorded. The request URL and captured response body are redacted with `redact_url_secrets` before storing.

Reference version

Signature

function ai.wire.send_as_with_wire<T>(
req: baml.http.Request,
provider: string,
client_name: string,
capture_wire: bool = …,
request_timeout_ms: int | null = …
) -> ai.wire.SentAs<T> throws baml.errors.Timeout | ai.errors.Failure

Same contract as send_as, plus the LLMCall wire record. On a non-2xx or transport failure this still throws the same classified error send_as throws — composite clients build failed-leg records from the error itself (_failed_leg_call), so no record accompanies a throw. capture_wire gates the request/response bodies; status, headers, and timing are always recorded. The request URL and captured response body are redacted with redact_url_secrets before storing.

Source:<builtin>/ai/ns_wire/wire.bamlbytes 72549795