Title: The WordPress AI Client
Published: 5 September 2026

---

[Home](https://learn.wordpress.org)[Courses](https://learn.wordpress.org/courses/)
[AI-Powered WordPress](https://learn.wordpress.org/course/ai-powered-wordpress/)
The WordPress AI Client

 [ Exit Course ](https://learn.wordpress.org/course/ai-powered-wordpress/)

 1.  a.  [   What is WordPress AI?  ](https://learn.wordpress.org/lesson/what-is-wordpress-ai/)
        [Preview](https://learn.wordpress.org/lesson/what-is-wordpress-ai/)
     b.  [   Installing the AI Plugin and Connecting a Provider  ](https://learn.wordpress.org/lesson/installing-the-ai-plugin-and-connecting-a-provider/)
        [Preview](https://learn.wordpress.org/lesson/installing-the-ai-plugin-and-connecting-a-provider/)
     c.  [   Understanding AI Providers  ](https://learn.wordpress.org/lesson/understanding-ai-providers/)
        [Preview](https://learn.wordpress.org/lesson/understanding-ai-providers/)
     d.  [   Practical: Connect an AI Provider  ](https://learn.wordpress.org/lesson/practical-connect-an-ai-provider/)
        [Preview](https://learn.wordpress.org/lesson/practical-connect-an-ai-provider/)
     e.  [   Module 1 Quiz  ](https://learn.wordpress.org/lesson/module-1-quiz/) [Preview](https://learn.wordpress.org/lesson/module-1-quiz/)
 2.  5 lessons, 1 quiz
 3.  a.  [   Generating Alt Text for Images  ](https://learn.wordpress.org/lesson/generating-alt-text-for-images/)
        [Preview](https://learn.wordpress.org/lesson/generating-alt-text-for-images/)
     b.  [   Writing Assistance: Titles, Excerpts, and Summaries  ](https://learn.wordpress.org/lesson/writing-assistance-titles-excerpts-and-summaries/)
        [Preview](https://learn.wordpress.org/lesson/writing-assistance-titles-excerpts-and-summaries/)
     c.  [   Practical: Draft a Post with AI Writing Tools  ](https://learn.wordpress.org/lesson/practical-draft-a-post-with-ai-writing-tools/)
        [Preview](https://learn.wordpress.org/lesson/practical-draft-a-post-with-ai-writing-tools/)
     d.  [   Reviewing and Improving Content with Editorial Tools  ](https://learn.wordpress.org/lesson/reviewing-and-improving-content-with-editorial-tools/)
        [Preview](https://learn.wordpress.org/lesson/reviewing-and-improving-content-with-editorial-tools/)
     e.  [   Practical: Review a Draft with Editorial Tools  ](https://learn.wordpress.org/lesson/practical-review-a-draft-with-editorial-tools/)
        [Preview](https://learn.wordpress.org/lesson/practical-review-a-draft-with-editorial-tools/)
     f.  [   Module 2 Quiz  ](https://learn.wordpress.org/lesson/module-2-quiz/) [Preview](https://learn.wordpress.org/lesson/module-2-quiz/)
 4.  6 lessons, 1 quiz
 5.  a.  [   Moderating Comments with AI  ](https://learn.wordpress.org/lesson/moderating-comments-with-ai/)
        [Preview](https://learn.wordpress.org/lesson/moderating-comments-with-ai/)
     b.  [   Classifying your Content  ](https://learn.wordpress.org/lesson/classifying-your-content/)
        [Preview](https://learn.wordpress.org/lesson/classifying-your-content/)
     c.  [   Monitoring and Controlling AI on Your Site  ](https://learn.wordpress.org/lesson/monitoring-and-controlling-ai-on-your-site/)
        [Preview](https://learn.wordpress.org/lesson/monitoring-and-controlling-ai-on-your-site/)
     d.  [   Building AI into Your Publishing Workflow  ](https://learn.wordpress.org/lesson/building-ai-into-your-publishing-workflow/)
        [Preview](https://learn.wordpress.org/lesson/building-ai-into-your-publishing-workflow/)
     e.  [   Practical: Moderate and Classify Comments  ](https://learn.wordpress.org/lesson/practical-moderate-and-classify-comments/)
        [Preview](https://learn.wordpress.org/lesson/practical-moderate-and-classify-comments/)
     f.  [   Module 3 Quiz  ](https://learn.wordpress.org/lesson/module-3-quiz/) [Preview](https://learn.wordpress.org/lesson/module-3-quiz/)
 6.  6 lessons, 1 quiz
 7.  a.  [   The Abilities API  ](https://learn.wordpress.org/lesson/the-abilities-api/)
        [Preview](https://learn.wordpress.org/lesson/the-abilities-api/)
     b.  [   Practical: Explore your site's abilities  ](https://learn.wordpress.org/lesson/practical-explore-your-sites-abilities/)
        [Preview](https://learn.wordpress.org/lesson/practical-explore-your-sites-abilities/)
     c.  [   The WordPress AI Client  ](https://learn.wordpress.org/lesson/the-wordpress-ai-client/)
        [Preview](https://learn.wordpress.org/lesson/the-wordpress-ai-client/)
     d.  [   The MCP Adapter  ](https://learn.wordpress.org/lesson/the-mcp-adapter/) [Preview](https://learn.wordpress.org/lesson/the-mcp-adapter/)
     e.  [   Practical: Register an Ability & MCP Adapter  ](https://learn.wordpress.org/lesson/practical-register-an-ability-mcp-adapter/)
        [Preview](https://learn.wordpress.org/lesson/practical-register-an-ability-mcp-adapter/)
     f.  [   Module 4 Quiz  ](https://learn.wordpress.org/lesson/module-4-quiz/) [Preview](https://learn.wordpress.org/lesson/module-4-quiz/)
 8.  6 lessons, 1 quiz

### WordPress as an AI Platform

# The WordPress AI Client

## **Learning objectives**

By the end of this lesson, you will be able to:

 * Identify the WordPress AI Client as the shared infrastructure layer for AI requests,
   introduced in WordPress core version 7.0
 * Explain how the AI Client routes requests from WordPress features to configured
   AI providers
 * Trace the path of a single AI feature request through the AI Client, connector,
   and provider
 * Evaluate how centralized AI request handling shapes governance decisions, particularly
   for AI Request Logging and Connector Approval

---

You have already seen the AI Client at work throughout this course: every time a
feature generated a title, excerpt, or alt text, the AI Client was the component
routing that request to your provider. This lesson explains what the AI Client actually
is, how it handles that routing, and why it matters for how you configure and govern
your site.

## **What is the WordPress AI Client?**

You were introduced to the AI Client in **Module 1: Lesson 1: What is WordPress 
AI?** as one of the four AI building blocks. Here is a closer look at how it works.

The **WordPress AI Client** is a core WordPress component, introduced in version
7.0 “Armstrong,” that provides a unified interface for making AI requests to any
configured provider. It is available on every site running WordPress 7.0 or later,
with no additional plugin required.

Before the AI Client existed, every plugin that wanted AI functionality had to build
its own provider integration: its own credential management, its own request handling,
its own error logic. Users had to enter API keys separately for each plugin, and
when a provider updated its API, every plugin that used it broke independently.

The AI Client centralizes all of that in one place.

## **What the AI Client handles**

The AI Client sits between WordPress features and AI providers, managing everything
in between.

**Provider-agnostic request routing.** Plugins call a single interface regardless
of which provider you have configured. The AI Client translates that request into
the format the provider expects and handles the response. The plugin code does not
need to change when you switch providers.

**Shared credential management.** You configure your AI provider credentials once
in Settings > Connectors. Every plugin using the AI Client can access those credentials
automatically, with no additional setup per plugin.

**REST API endpoints for JavaScript.** The AI Client adds REST API endpoints (URL-
based interfaces that allow JavaScript and other systems to access WordPress functionality)
so AI capabilities are available to block editor features as well as PHP plugins.
This is how features like Generate Excerpt and Title Generation make their requests
from within the editor.

**A consistent integration point for admin experiments.** Experiments like AI Request
Logging and Connector Approval operate at the AI Client layer. Because every AI 
request passes through the Client, these experiments apply uniformly across all 
features and plugins on your site.

💡 **Why this matters for you**: The AI Client is why configuring one connector 
in Settings > Connectors makes all AI features work across the plugin. It is also
why switching to a different provider does not require changing settings inside 
each individual feature. Everything flows through the same layer.

📸 **Screenshot placeholder:** [Diagram showing the flow of an AI request: Feature(
e.g., Generate Excerpt)  AI Client  Connector  AI Provider  Response returned through
the same path]

## **How a request flows through your site**

When you click a button like Generate Excerpt or Generate Alt Text, the following
happens: the feature calls the AI Client with a request; the AI Client checks your
configured connector in Settings > Connectors; it builds the request in the format
that provider expects, sends it, and returns the response to the feature. From the
feature’s perspective, it simply asked for text and received it. The complexity 
of communicating with the provider is fully handled by the Client.

## **How admin experiments connect to the AI Client**

Because all AI requests pass through the AI Client, experiments that need to observe
or control AI activity operate at this layer.

**AI Request Logging** records every request that passes through the Client. The
log entries in Tools > AI Request Logs reflect activity at the Client itself: provider
used, model, duration, token counts, and request source. (See [Module 3: Lesson 3: Monitoring and controlling AI on your site](https://learn.wordpress.org/lesson/monitoring-and-controlling-ai-on-your-site/)[
Link — verify URL before publishing])

**Connector Approval** uses the Client as its enforcement point. When Connector 
Approval is enabled, the Client checks whether the plugin or theme making the request
has been approved in Tools > Connector Approvals before forwarding it. If it has
not been approved, the Client blocks the request entirely. (See [Module 3: Lesson 3: Monitoring and controlling AI on your site](https://learn.wordpress.org/lesson/monitoring-and-controlling-ai-on-your-site/)[
Link — verify URL before publishing])

This architecture means you have a single place to observe and govern all AI activity
on your site, regardless of how many plugins are using AI features.

## **For developers: making requests with the AI Client**

For plugin developers, the AI Client provides a clean, minimal starting point. A
provider-agnostic text generation call looks like this:

php

    ```wp-block-code
    $text = AiClient::prompt( 'Summarize this content in one sentence.' )
        ->generateText();
    ```

The Client handles provider selection, authentication, and response normalization
automatically. To target a specific model, you can specify one explicitly, though
provider-agnostic calls are recommended for broader compatibility across different
user configurations:

php

    ```wp-block-code
    $text = AiClient::prompt( 'Write a title for this post.' )
        ->usingModel( Google::model( 'gemini-2.5-flash' ) )
        ->generateText();
    ```

For the full SDK reference, see the [PHP AI Client on GitHub](https://github.com/WordPress/php-ai-client)[
Link — verify URL before publishing].

## **WordPress Playground**

The AI Client has no dedicated admin interface. Its work happens behind the scenes
every time an AI feature runs. You have already interacted with it in every Playground
exercise throughout this course.

---

## **Key terms**

| **Term** | **Definition** | 
| WordPress AI Client | A core WordPress component, introduced in version 7.0, that provides a unified interface for making AI requests to any configured provider, abstracting away provider-specific implementation details | 
| Provider-agnostic | Designed to work with any AI provider without being tied to a specific one; plugin code written against the AI Client works with any provider the user configures | 
| REST API endpoint | A URL-based interface that allows JavaScript and other systems to access WordPress functionality over standard web requests | 
| Connector | An AI provider configuration set up in Settings > Connectors, which the AI Client uses to authenticate and route requests to the appropriate AI service |

---

## **✅ Check your understanding**

 1. Before the AI Client existed, every plugin had to build its own AI provider integration.
    What specific problems does centralizing this in WordPress core solve for site 
    owners and administrators, not just developers?
 2. Think about the AI Request Logging and Connector Approval experiments you explored
    in **Module 3: Lesson 3: Monitoring and controlling AI** on your site [Link — verify
    URL before publishing]. How does knowing that both features operate at the AI Client
    layer change how you would configure and manage them on a production site?

 This is a preview lesson

Please contact the course administrator to take this lesson.

##  Suggestions

 Found a typo, grammar error or outdated screenshot? [Contact us](https://learn.wordpress.org/report-content-feedback/).