| 开发者 | mralaminahamed |
|---|---|
| 更新时间 | 2026年8月10日 14:05 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
OPENCODE_ZEN_API_KEY for server-level configuration, bypassing the database entirelyopencode-zen provider and supports the standard generation options (temperature, max tokens, top P, presence/frequency penalties, stop sequences, system instruction, and function declarations).
The source code is on GitHub — bug reports and pull requests are welcome:
/wp-content/plugins/alamin-ai-provider-for-opencode-zen/.wp plugin install alamin-ai-provider-for-opencode-zen --activateOpenCode Zen is an AI platform that acts as a gateway to multiple AI providers. Instead of needing separate API keys for OpenAI (GPT), Anthropic (Claude), and Google (Gemini), you get access to all of them through a single OpenCode Zen API key. Learn more at opencode.ai.
Go to Settings > Connectors in your WordPress admin and enter your OpenCode Zen API key there. All AI-enabled plugins on your site will automatically use it. Alternatively, set the OPENCODE_ZEN_API_KEY environment variable on your server.
No. WordPress 7.0 and higher include the AI Client SDK natively — no additional plugin is required.
It depends on your use case:
The plugin falls back to a hardcoded list of 61 models so the AI Client continues to function and AI-enabled plugins stay operational.
Yes. WordPress lets you install multiple provider plugins. You can switch the active provider from Settings > Connectors at any time without reconfiguring any plugin.
Your API key is stored in the WordPress options table, which is protected by your database credentials. For higher security, set the OPENCODE_ZEN_API_KEY environment variable on your server — this keeps the key entirely out of the database.
Billing is handled entirely by OpenCode Zen. Your usage is billed according to OpenCode Zen's pricing based on tokens consumed per model. WordPress and this plugin do not charge anything.
Temperature, max tokens, top P, presence penalty, frequency penalty, stop sequences, system instruction, and function declarations — the full set of options supported by the WordPress AI Client SDK.
Yes, if you have a WooCommerce plugin that integrates with the WordPress AI Client. Once this provider is active and your API key is set, any AI-enabled WooCommerce plugin can generate product descriptions, SEO meta, and more using any of the 61 models.
Yes. Any Gutenberg plugin or block that uses the WordPress AI Client will automatically use this provider once configured.
This plugin implements the standard WordPress AI Client provider interface. Developers building plugins or themes on top of the WordPress AI Client do not need to do anything special — if this provider is active, it will be available automatically.
opencode_zen_settings, so saving the form changed a database row and nothing else. A caller's own value still wins; the saved values fill in what was left unset.opencode_zen_generate_text_params filter, which receives the model id — useful because Zen fronts several vendors and they do not all accept the same parameters.messages array and the AI Client already sends one), but the capability was never declared and the AI Client routes on the declaration, so conversation requests were going to other providers. Every official WordPress AI provider declares this.OpenCodeZen\OpenCodeZenAiProvider\ (was AlAminAhamed\OpenCodeZenAiProvider\).OpenCodeZen prefix, which the namespace already carries: OpenCodeZenProvider is Provider, OpenCodeZenSettings is Settings, OpenCodeZenModelMetadataDirectory is ModelMetadataDirectory, OpenCodeZenTextGenerationModel is TextGenerationModel, and OpenCodeZenProviderAvailability is ProviderAvailability.AI_Provider_For_OpenCode_Zen singleton in class-ai-provider-for-opencode-zen.php, so every hook the plugin registers is visible in one file. Matches the layout used across this author's other plugins.OPENCODE_ZEN_VERSION, OPENCODE_ZEN_URL and OPENCODE_ZEN_PATH constants; only OPENCODE_ZEN_PLUGIN_FILE existed before.
Both renames are internal. No hook, option, setting or model id changes, and nothing a site has configured is affected — but any code referencing these classes directly needs updating.qwen3.7-max and qwen3.7-plus, which were offered in the model list and are not served by OpenCode Zen. Selecting either produced a failed generation rather than an invalid-setting warning.connectors_ai_opencode_zen_api_key) now correctly used for live model list fetching — previously fell back to the hardcoded model list even when the Connectors key was set.get_settings() now returns all 6 default fields when the saved option is corrupt or missing; previously returned only temperature and max_tokens.
Changed
templates/admin/ for cleaner separation of logic and presentation.
src/ to includes/ per WordPress plugin conventions.Requires at least to 7.0.OPENCODE_ZEN_API_KEY environment variable.