Amazon Bedrock Claude provider for WordPress AI Client.
This plugin extends the WordPress AI Client SDK to enable Claude model access through Amazon Bedrock Runtime API. It supports text generation, tool use, function calling, and structured outputs with JSON schemas.
| Model | Bedrock Model ID |
|---|---|
| Claude Opus 4.6 | anthropic.claude-opus-4-20250514 |
| Claude Sonnet 4.6 | anthropic.claude-sonnet-4-20250514 |
| Claude Haiku 4.5 | anthropic.claude-haiku-4-20250514 |
- PHP 8.1 or higher
- WordPress 6.9 or higher
- WordPress AI Client SDK (
wordpress/php-ai-client) - AWS account with Bedrock access
- Download or clone the plugin into
wp-content/plugins/ai-provider-for-bedrock/ - Run
composer installfrom the plugin directory - Activate the plugin in WordPress admin
- Configure AWS credentials (see Configuration section)
Add to your wp-config.php:
define('BEDROCK_ACCESS_KEY_ID', 'AKIAIOSFODNN7EXAMPLE');
define('BEDROCK_SECRET_ACCESS_KEY', 'wJalrXUtnFEMI/K7MDENG/bPlusCfrISMYEXAMPLE');
define('BEDROCK_REGION', 'eu-north-1');Navigate to Settings > Bedrock AI Provider in the WordPress admin panel and enter your AWS credentials.
- PHP constants (highest priority)
- WordPress options (database)
- Defaults (empty for keys,
eu-north-1for region)
The IAM user needs the bedrock:InvokeModel permission:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "bedrock:InvokeModel",
"Resource": "arn:aws:bedrock:*::foundation-model/anthropic.*"
}
]
}- Text generation with Claude models via Bedrock
- System instructions
- Tool use and function calling
- Structured outputs with JSON schemas
- Token usage tracking
- AWS SigV4 request signing via AWS SDK
eu-north-1(default)us-east-1us-west-2eu-west-1ap-southeast-1
composer install
vendor/bin/phpunitvendor/bin/phpstan analyse src/vendor/bin/phpcs src/ plugin.phpGPL-2.0-or-later