Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aisdk/vercel

GitHub Workflow Status Latest Version License


Official Vercel AI Gateway provider for the PHP AI SDK. Uses Vercel's OpenAI-compatible Chat Completions API.

Installation

composer require aisdk/vercel

Basic Usage

use AiSdk\Generate;
use AiSdk\Vercel;

Vercel::create(['apiKey' => $_ENV['AI_GATEWAY_API_KEY']]);

$result = Generate::text('Explain this code briefly.')
    ->model(Vercel::model('anthropic/claude-sonnet-4.5'))
    ->run();

Configuration

Variable Description Default
AI_GATEWAY_API_KEY Vercel AI Gateway API key Required
VERCEL_BASE_URL Base URL for API requests https://ai-gateway.vercel.sh/v1

Supported Capabilities

Capability Support
Text generation and streaming Native OpenAI-compatible chat
Tool calling, structured output, reasoning Passed through for selected gateway models
Image input Passed through for compatible gateway models

Provider Options

Use providerOptions('vercel', ['raw' => [...]]) for documented AI Gateway fields outside the portable SDK surface. Model IDs use Vercel's provider/model form and remain opaque strings.

Documentation

About

Official Vercel AI Gateway provider for the PHP AI SDK.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages