vercel-labs / ai-gateway-provider
Vercel AI Gateway provider for the PHP AI Client SDK. Works as a Composer package and WordPress plugin.
Package info
github.com/vercel-labs/ai-gateway-provider-php
pkg:composer/vercel-labs/ai-gateway-provider
Requires
- php: >=7.4
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- felixarntz/terminal-image: ^1.0
- guzzlehttp/guzzle: ^7.0
- phpcompatibility/php-compatibility: dev-develop
- phpstan/phpstan: ~2.1
- phpunit/phpunit: ^9.5
- slevomat/coding-standard: ^8.20
- squizlabs/php_codesniffer: ^3.7 || ^4.0
- symfony/dotenv: ^5.4
- wordpress/php-ai-client: ^1.3
Suggests
- wordpress/php-ai-client: Required. The core PHP AI Client SDK that this provider extends.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-14 20:52:56 UTC
README
Vercel AI Gateway provider for the PHP AI Client SDK. Works as a Composer package and WordPress plugin.
The Vercel AI Gateway allows you to use hundreds of generative AI models from over 40 different providers, to generate text, images, video, and more.
Tip
There's a skill for that! Teach your coding agent about how this provider can be used.
npx skills add vercel-labs/ai-gateway-provider-php --skill use-ai-gateway-provider
Installation
As a Composer Package
Make sure you're using WordPress/php-ai-client 1.3.0 or higher.
composer require vercel-labs/ai-gateway-provider
As a WordPress Plugin
Make sure you're using WordPress 7.0 or higher.
Installation from within WordPress
- Visit Plugins > Add New.
- Search for Vercel AI Gateway, then install and activate the AI Gateway Provider plugin.
- Visit Settings > Connectors and paste your AI Gateway API key.
Manual installation
- Upload the entire
vercel-ai-gateway-providerfolder to the/wp-content/plugins/directory. - Visit Plugins, and activate the Vercel AI Gateway Provider plugin.
- Visit Settings > Connectors and paste your AI Gateway API key.
Usage
With WordPress
The provider automatically registers itself with the PHP AI Client on the init hook. Simply configure the API key under Settings > Connectors, and you can start using all the models via the AI Gateway.
// Use the provider $result = wp_ai_client_prompt( 'Hello, world!' ) ->using_provider( 'ai_gateway' ) ->generate_text_result();
See docs/wordpress.md for more examples.
As a Standalone Package
use WordPress\AiClient\AiClient; use Vercel\AiGatewayProvider\Provider\AiGatewayProvider; // Register the provider $registry = AiClient::defaultRegistry(); $registry->registerProvider(AiGatewayProvider::class); // Set your API key putenv('AI_GATEWAY_API_KEY=your-api-key'); // Generate text $result = AiClient::prompt('Explain quantum computing') ->usingProvider('ai_gateway') ->generateTextResult(); echo $result->toText();
See docs/php.md for more examples.
License
MIT