Skip to content

Repository files navigation

OpenCode AI Provider

An OpenCode AI Provider for the PHP AI Client SDK. Works as a WordPress plugin.

Requirements

Installation

  1. Upload the plugin files to /wp-content/plugins/opencode-ai-provider/
  2. Ensure the PHP AI Client plugin is installed and activated
  3. Activate the plugin through the WordPress admin

Usage

Configuration

The provider uses the OPENCODE_API_KEY environment variable or constant for authentication, or you can configure it via the WordPress Settings Connectors UI.

To define it in PHP:

define('OPENCODE_API_KEY', 'your-opencode-zen-api-key');

Or as an environment variable:

putenv('OPENCODE_API_KEY=your-opencode-zen-api-key');

Prompting

Simply use the standard WordPress AI Client functions:

useWordPress\AiClient\AiClient;
$result = AiClient::prompt('Write a PHP function to filter query parameters.')
->usingProvider('opencode')
->generateTextResult();
echo$result->toText();

Supported Models

Available models are dynamically discovered from the OpenCode Zen API /models endpoint, which includes curated, development-optimized coding models like deepseek-v4-flash-free and others.

License

GPL-2.0-or-later

Privacy Policy

See the OpenCode privacy policy: https://opencode.ai/legal/privacy-policy

Terms of Use

See the OpenCode terms of service: https://opencode.ai/legal/terms-of-service

About

OpenCode Zen integration for the PHP AI Client SDK. It enables WordPress sites to use OpenCode Zen's curated, developer-optimized LLMs (such as DeepSeek models) for coding and text generation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages