Search by

vercel-labs / ai-gateway-provider

felixarntz

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

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 17

Open Issues: 0

1.0.2 2026-08-07 14:00 UTC

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

  1. Visit Plugins > Add New.
  2. Search for Vercel AI Gateway, then install and activate the AI Gateway Provider plugin.
  3. Visit Settings > Connectors and paste your AI Gateway API key.

Manual installation

  1. Upload the entire vercel-ai-gateway-provider folder to the /wp-content/plugins/ directory.
  2. Visit Plugins, and activate the Vercel AI Gateway Provider plugin.
  3. 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