AI Provider for OpenRouter

描述

This plugin provides OpenRouter integration for the PHP AI Client SDK. It enables WordPress sites to use hundreds of AI models from various providers through OpenRouter’s unified, OpenAI-compatible API.

External services

This plugin connects to the Open Router API to generate text using a wide range of AI models.

Using this plugin requires an OpenRouter API key, which can be obtained by creating an account on the OpenRouter website. Create an account and generate an API key at https://openrouter.ai/settings/keys.

You can find the OpenRouter terms of service here: https://openrouter.ai/terms, and their privacy policy here: https://openrouter.ai/privacy.

Features:

  • Text generation with any OpenRouter-supported model
  • Automatic model discovery from the OpenRouter API
  • Automatic provider registration

Available models are dynamically discovered from the OpenRouter /models endpoint, including models from OpenAI, Anthropic, Google, Meta, Mistral, and many more.

Requirements:

  • PHP 7.4 or higher
  • For WordPress 6.9, the wordpress/php-ai-client package must be installed
  • For WordPress 7.0 and above, no additional changes are required
  • OpenRouter API key

安装

  1. Upload the plugin files to /wp-content/plugins/ai-provider-for-openrouter/
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Configure your OpenRouter API key via the OPENROUTER_API_KEY environment variable or constant

常见问题

How do I get an OpenRouter API key?

Visit OpenRouter to create an account and generate an API key at https://openrouter.ai/settings/keys.

Does this plugin work without the PHP AI Client?

No, this plugin requires the PHP AI Client plugin to be installed and activated. It provides the OpenRouter-specific implementation that the PHP AI Client uses.

评价

2026 年 3 月 25 日 1 回复
Works exactly as I was hoping – nice work!
阅读所有1条评价

贡献者及开发者

「AI Provider for OpenRouter」是开源软件。 以下人员对此插件做出了贡献。

贡献者

「AI Provider for OpenRouter」插件已被翻译至 2 种本地化语言。 感谢所有译者为本插件所做的贡献。

帮助将「AI Provider for OpenRouter」翻译成简体中文。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

1.0.0

  • Initial release
  • Support for text generation models via OpenRouter
  • Automatic model discovery from the OpenRouter API