Title: WP_AI_Client_Discovery_Strategy
Published: May 20, 2026

---

# class WP_AI_Client_Discovery_Strategy {}

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_ai_client_discovery_strategy/?output_format=md#description)
 * [Methods](https://developer.wordpress.org/reference/classes/wp_ai_client_discovery_strategy/?output_format=md#methods)
 * [Source](https://developer.wordpress.org/reference/classes/wp_ai_client_discovery_strategy/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_ai_client_discovery_strategy/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_ai_client_discovery_strategy/?output_format=md#wp--skip-link--target)

This class’s access is marked private. This means it is not intended for use by 
plugin or theme developers, only by core. It is listed here for completeness.

Discovery strategy for WordPress HTTP client.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_ai_client_discovery_strategy/?output_format=md#description)󠁿

Registers the WordPress HTTP client adapter with the HTTPlug discovery system so
the AI Client SDK can find and use it automatically.

## 󠀁[Methods](https://developer.wordpress.org/reference/classes/wp_ai_client_discovery_strategy/?output_format=md#methods)󠁿

| Name | Description | 
| [WP_AI_Client_Discovery_Strategy::createClient](https://developer.wordpress.org/reference/classes/wp_ai_client_discovery_strategy/createclient/) | Creates an instance of the WordPress HTTP client. |

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_ai_client_discovery_strategy/?output_format=md#source)󠁿

    ```php
    class WP_AI_Client_Discovery_Strategy extends AbstractClientDiscoveryStrategy {

    	/**
    	 * Creates an instance of the WordPress HTTP client.
    	 *
    	 * @since 7.0.0
    	 *
    	 * @param Psr17Factory $psr17_factory The PSR-17 factory for creating HTTP messages.
    	 * @return ClientInterface The PSR-18 HTTP client.
    	 */
    	protected static function createClient( Psr17Factory $psr17_factory ): ClientInterface {
    		return new WP_AI_Client_HTTP_Client( $psr17_factory, $psr17_factory );
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ai-client/adapters/class-wp-ai-client-discovery-strategy.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/ai-client/adapters/class-wp-ai-client-discovery-strategy.php#L24)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/ai-client/adapters/class-wp-ai-client-discovery-strategy.php#L24-L37)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_ai_client_discovery_strategy/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.0.0](https://developer.wordpress.org/reference/since/7.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_ai_client_discovery_strategy%2F)
before being able to contribute a note or feedback.