WordPress 7.0 introduces a built-in AI Client — a provider-agnostic PHP API that allows plugins to send prompts to AI models and receive results through a consistent interface. The entry point is wp_ai_client_prompt(), which returns a fluent WP_AI_Client_Prompt_Builder object. It supports text generation, image generation, speech, video, and multimodal outputs. Plugin developers can specify model preferences, perform feature detection before showing AI UI, and handle errors using standard WP_Error conventions. The architecture separates a provider-agnostic PHP SDK from a WordPress-specific wrapper. API keys are managed via the Connectors API, and WordPress Core ships without bundled providers — instead relying on official provider plugins. Migration guidance is provided for developers already using the php-ai-client or wp-ai-client packages.
Table of contents
The entry point: wp_ai_client_prompt()Text generationImage generationGetting the full result objectFeature detectionAdvanced configurationError handlingControlling AI availabilityArchitectureMigration from php-ai-client and wp-ai-clientAdditional resourcesSort: