Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/amirsafaridevs/ai-provider-for-gapgpt/archive/refs/heads/main.zipA WordPress plugin that registers GapGPT as an AI provider for the PHP AI Client that ships with WordPress.
GapGPT exposes an OpenAI compatible API, so this provider is built on top of the OpenAI compatible base classes shipped with the PHP AI Client SDK, pointed at the GapGPT API endpoint (https://api.gapgpt.app/v1) instead of OpenAI's own endpoint.
This is a WordPress plugin only. It is not published or intended to be used as a standalone Composer package.
Requirements
- WordPress 7.0 or higher (or WordPress 6.9 with the wordpress/php-ai-client package installed)
- PHP 7.4 or higher
- A GapGPT API key, available from your GapGPT account
Installation
- Upload the plugin files to
/wp-content/plugins/ai-provider-for-gapgpt/, or install it through the WordPress Plugins screen - Activate the plugin through the 'Plugins' menu in WordPress
- Configure your GapGPT API key, either by defining the
GAPGPT_API_KEYconstant inwp-config.php, or by setting theGAPGPT_API_KEYenvironment variable
// wp-config.php
define( 'GAPGPT_API_KEY', 'your-api-key' );
Usage
The provider automatically registers itself with the PHP AI Client on the init hook. Once the plugin is active and an API key is configured, GapGPT models are available anywhere the AI Client is used:
use WordPress\AiClient\AiClient;
$result = AiClient::prompt( 'Hello, world!' )
->usingProvider( 'gapgpt' )
->usingModel( 'gpt-4o' )
->generateTextResult();
echo $result->toText();
use WordPress\AiClient\AiClient;
$result = AiClient::prompt( 'A watercolor painting of a mountain lake at sunrise' )
->usingProvider( 'gapgpt' )
->usingModel( 'dall-e-3' )
->generateImageResult();
Supported Models
GapGPT proxies models from many different vendors behind one OpenAI compatible API, and the exact catalog changes over time (new models are added, older ones retired, versions bumped). For that reason this plugin does not hardcode a model list: on every request it queries GapGPT's GET /v1/models endpoint - the same discovery endpoint used by the official OpenAI client libraries, just against the GapGPT base URL - and builds the list of currently available models from that live response.
See the GapGPT pricing / model list page for a human-readable, up-to-date overview of what is currently offered.
Because the discovery endpoint only returns model IDs (not capabilities), this plugin infers what each model can do from its ID:
| Model ID pattern | Capability |
|---|---|
dall-e-*, gpt-image-*, flux*, imagen-*, stable-diffusion*, sdxl*, midjourney*, seedream*, qwen-image* |
Image generation |
tts-*, *-tts |
Text to speech (recognized, but the model class is not implemented yet - see Roadmap) |
| Everything else, except embedding, moderation, transcription, rerank, realtime, instruct, audio, video, edit and search models | Text generation (chat) |
Roadmap
Currently supported capabilities are text generation and image generation. Text-to-speech and other modalities GapGPT may expose in the future are intentionally out of scope for this initial version.
Configuration
API key
Authentication is handled by the PHP AI Client itself, using the GAPGPT_API_KEY constant or environment variable:
define( 'GAPGPT_API_KEY', 'your-api-key' );
API endpoint
Requests are always sent to https://api.gapgpt.app/v1, GapGPT's primary API endpoint. There is no setting to change this.
Privacy / External Services
This plugin relies on the third-party GapGPT API to function; see the "External services" section of readme.txt for full details on what data is transmitted, when, and to whom.
Credits
Maintained by ArtaCode, with development by Amir Safari.
This plugin follows the structure of the official AI Provider for OpenAI plugin by the WordPress AI Team, adapted to talk to the GapGPT API.
License
GPL-2.0-or-later