$request Canonical request. * @param string $key API key. * @return array{url:string,headers:array,body:string} */ public function build( array $request, string $key ): array; /** * Canonical response from an HTTP answer (throws ProviderError for errors). * * @param int $status HTTP status. * @param string $body Body. * @param string $key Key (for redaction). * @return array{content:array>,stop_reason:string,usage:array,model:string} * @throws ProviderError On provider errors. */ public function parse( int $status, string $body, string $key ): array; /** * Cheapest possible request that proves the key works (Save & test). * * @param string $model Model. * @return array Canonical request. */ public function test_request( string $model ): array; }