---
title: AI API
description: OpenAI-compatible HTTP API for chat, images, audio, and content tooling.
url: https://developers.wpengine.com/docs/ai/api/
image: https://developers.wpengine.com/og/docs/ai/api.png
---

# AI API

The AI API is an OpenAI-compatible HTTP service for chat completions, image generation, text-to-speech, transcription, and content tooling. One API key reaches models from Google, Anthropic, OpenAI, Qwen, and others. You pick a model by its ID, such as `google/gemini-3.8-flash`.

To start, create an API key in the WP Engine User Portal. Then point a client that speaks the OpenAI Chat Completions API at `https://api.ai.wpengine.com/v1` and make your first call. The Responses, Embeddings, and legacy Completions APIs aren’t available.

> **Beta**
>
> This documentation covers the AI beta. Endpoints, model availability, and rate limits may change before general availability.

[Call the API directly](https://developers.wpengine.com/docs/ai/api/getting-started/)Browse the model catalog, create a key, and make your first chat completion.

[Use AI inside WordPress](https://developers.wpengine.com/docs/ai/api/wordpress-ai-client/)For plugins and themes, the AI Client bundled with WordPress handles auth and provider routing for you.

[Connect an AI agent](https://developers.wpengine.com/docs/ai/api/mcp/)Give Claude Code, Claude Desktop, or any Model Context Protocol (MCP) client access to your WordPress sites.

---

> #### Before your first call
>
> - [Authentication — create, scope, and rotate a key](https://developers.wpengine.com/docs/ai/api/authentication/)
> - [Site and WordPress account connections — why you still can't write to a registered site](https://developers.wpengine.com/docs/ai/api/site-and-account-connections/)

> #### After your first call
>
> - [Stream a chat completion — parse Server-Sent Events in JavaScript and PHP](https://developers.wpengine.com/docs/ai/api/stream-chat-completions/)
> - [Errors — response shape and common status codes](https://developers.wpengine.com/docs/ai/api/errors/)
> - [Rate limits — quotas and 429 handling](https://developers.wpengine.com/docs/ai/api/rate-limits/)

## Was this helpful?

Thanks for the feedback!

```json
{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://developers.wpengine.com/#website","name":"WP Engine Product Documentation","url":"https://developers.wpengine.com/","description":"Resources for developing, deploying, and scaling on WP Engine.","inLanguage":"en-US","keywords":["API documentation","product documentation","headless WordPress","managed WordPress hosting"],"publisher":{"@id":"https://wpengine.com/#organization"}}]}
```
