---
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 one by its ID, such as `google/gemini-3.5-flash`.

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

> **Closed beta**
>
> This documentation covers the closed 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/)Building a plugin or theme? 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 MCP client access to your WordPress sites.

[Download the OpenAPI spec](https://api.ai.wpengine.com/v1/openapi.yaml)Import the full API definition into Postman, Bruno, or a client generator.

---

> #### 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 a registered site still can't be written to](https://developers.wpengine.com/docs/ai/api/site-and-account-connections/)

> #### Once you are calling it
>
> - [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/)
> - [API reference — every operation, with generated curl, PHP, Go, and JavaScript examples](https://developers.wpengine.com/docs/ai/api/reference/)

## 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"}}]}
```
