Skip to main content
AI Provider for deAPI is a WordPress plugin that adds deAPI as a provider for the WordPress AI Client, which is part of WordPress 7.0. Once the plugin is active and an API key is saved, any plugin built on the AI Client can generate and edit images, generate videos, create speech and compute embeddings with deAPI. The plugin is open source. Its code is on GitHub.
deAPI has no chat models in this plugin. Text features, such as title or excerpt generation, keep using your other AI providers.
The plugin was tested for this page on WordPress 7.1 with version 0.1.0 from WordPress.org, by running each capability through the AI Client against the live deAPI API.

What it adds

The plugin lists only the models available to your deAPI account. Transcription, music generation and the other deAPI endpoints are not part of the plugin, because the AI Client has no matching capability for them yet.

Prerequisites

  • WordPress 7.0 or later. The plugin loads on WordPress 6.9, but does nothing without the AI Client.
  • PHP 7.4 or later
  • A deAPI account with credits. deAPI charges per request; see Pricing.
  • A deAPI API key from the deAPI Dashboard. A key with the API role is enough. See API Keys.

Install and connect

  1. In the WordPress admin, open Plugins, add a new plugin, search for AI Provider for deAPI, then install and activate it.
  2. Go to Settings → Connectors and find deAPI.
  3. Paste your API key and save. WordPress checks the key with deAPI when you save it.
You can also set the key outside the database, with the DEAPI_API_KEY environment variable or a constant in wp-config.php:
Create a separate key for each site and set a spend limit on it. See Key restrictions.

Try it with the AI plugin

The plugin has no screens of its own. To see deAPI at work, use a plugin built on the AI Client, such as the AI plugin from the WordPress AI Team:
  1. Install and activate the AI plugin.
  2. Under Settings → AI, turn on Image Generation and Editing.
  3. Open Media → Generate Image, type a prompt and generate. The image comes from deAPI.
  4. To change a generated image, refine it with a text instruction. deAPI edits it with FLUX.2 [klein].
The Text to Speech feature of the AI plugin also works with deAPI. It creates an audio version of a post from the editor sidebar.

Use it from code

Every call goes through the AI Client. Name deapi and the model in the model preference.
Each call returns a file object, or a WP_Error when the request fails.

Images

deAPI waits for the GPU job to finish before it answers, so an image call takes several seconds. The plugin allows up to 5 minutes per request. In testing, a landscape image from FLUX.1 [schnell] took 24 seconds and an edit with FLUX.2 [klein] took 16 seconds.

Video

A video call blocks until the MP4 is ready. The plugin checks the job every 5 seconds and waits up to 10 minutes.
Run video generation from WP-CLI, a cron event or a background job. A normal page request is usually stopped by the PHP time limit, often 30 seconds, before the video is ready.

Speech

Output is always MP3. In testing, two sentences with Kokoro took 5 seconds. Voice lists are in Text-to-speech.

Embeddings

Bge_M3_FP16 returns 1024-dimensional vectors. It is listed when the site’s AI Client supports embeddings, which the plugin’s listing puts at WordPress 7.2 or later.

What the plugin sends

The plugin talks to deAPI’s OpenAI-compatible endpoint at https://oai.deapi.ai/v1. Nothing is sent until an API key is configured.
  • When you save the key, and when the AI Client needs the model list, the plugin sends the key to /v1/models.
  • When a plugin asks the AI Client for an image, an edit, a video, speech or embeddings and deAPI is selected, the plugin sends the key, the prompt or input text, any source images and the requested options to the matching endpoint.
  • Generated images can come back as links to results.deapi.ai, which the AI Client may download.
The plugin sends no other data and makes no requests in the background. Endpoints, models and fields are described in OpenAI Compatibility.

Troubleshooting


Resources