WP Manifestindependent plugin directory
manifest / ai / ai-provider-for-bedrock

AI Provider for Bedrock

AI Provider for Amazon Bedrock for the WordPress AI Client — connects Bedrock's multi-vendor model catalogue (OpenAI, Qwen, DeepSeek, Mistral, Meta) to WordPress 7.0's AI Connectors.

by Khokan Sardar · github.com/itzmekhokan/ai-provider-for-bedrock · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/itzmekhokan/ai-provider-for-bedrock/archive/refs/heads/master.zip

Readme

AI Provider for Bedrock

AI Provider for Amazon Bedrock for the WordPress AI Client. Works as both a Composer package and a WordPress plugin.

This provider registers Amazon Bedrock with the AI Client, exposing the foundation models AWS hosts on Bedrock — models from OpenAI, Qwen, DeepSeek, Mistral, Meta, NVIDIA, Moonshot, MiniMax and more — for text generation through Bedrock's OpenAI-compatible Chat Completions API.

Requirements

No AWS SDK and no SigV4 request signing are needed: Bedrock API keys authenticate with a plain Authorization: Bearer header, exactly like every other provider in this family.

How it works

Amazon Bedrock exposes an OpenAI-compatible API, so this provider is intentionally thin:

Class Responsibility
Provider\BedrockProvider Registers the provider, composes the region-specific base URL, API-key auth, and metadata.
Metadata\BedrockModelMetadataDirectory Lists models from GET /v1/models, filters out non-text models, and maps capabilities/options.
Models\BedrockTextGenerationModel Sends POST /v1/chat/completions via the shared OpenAI-compatible base class.

Because Bedrock speaks the Chat Completions format, BedrockTextGenerationModel extends AbstractOpenAiCompatibleTextGenerationModel from the SDK and only overrides request construction.

Configuration

Bedrock differs from the other providers in this family in one way: it has no single global API host. Every endpoint is region-specific, and Bedrock API keys are region-scoped — so the base URL is composed at runtime rather than hardcoded.

Region

Defaults to us-east-1. Precedence, highest last:

  1. AI_PROVIDER_FOR_BEDROCK_REGION default
  2. AWS_REGION / AWS_DEFAULT_REGION environment variables
  3. AI_PROVIDER_FOR_BEDROCK_REGION constant
  4. ai_provider_for_bedrock_region filter
define( 'AI_PROVIDER_FOR_BEDROCK_REGION', 'eu-west-1' );

Endpoint

Defaults to bedrock-runtime (https://bedrock-runtime.{region}.amazonaws.com/v1), which is available in every Bedrock region. AWS recommends bedrock-mantle (https://bedrock-mantle.{region}.api.aws/v1) for new OpenAI-compatible integrations; it is available in a subset of regions and offers a broader model catalogue and higher initial throughput.

define( 'AI_PROVIDER_FOR_BEDROCK_ENDPOINT', 'bedrock-mantle' );

Or via filter:

add_filter( 'ai_provider_for_bedrock_endpoint', fn() => 'bedrock-mantle' );

Full base URL

For endpoints the region/endpoint settings cannot express — a VPC interface endpoint (AWS PrivateLink), or a gateway fronting Bedrock:

add_filter( 'ai_provider_for_bedrock_base_url', fn() => 'https://vpce-....bedrock-runtime.eu-west-1.vpce.amazonaws.com/v1' );

The URL must speak the OpenAI-compatible API, and must not include a trailing slash or the /chat/completions path.

Model list

Bedrock is a multi-vendor catalogue rather than a single model family, and GET /v1/models returns everything available on the endpoint — including models that cannot generate text. The metadata directory therefore does more work than its siblings:

  • Filters out embedding, rerank, image, video and speech models, which would fail a text generation request.
  • Detects multimodal models by ID and advertises image input for them.
  • Renames raw IDs into something readable in a picker: us.anthropic.claude-sonnet-4-6 becomes claude-sonnet-4-6 (Anthropic, US).
  • Sorts by vendor, preferring cross-region inference profiles over single-region IDs for the same model.

Which models you actually see depends on your region and on the model access enabled in your Bedrock console.

Supported capabilities

  • Text generation (chat) with the foundation models available on your Bedrock endpoint
  • Image input on multimodal models
  • Function calling and JSON / structured output

logprobs / top_logprobs are deliberately not advertised: support varies across Bedrock's multi-vendor catalogue, so claiming it for every model would be wrong.

Installation

As a WordPress plugin

Copy this directory into wp-content/plugins/ and activate it alongside the WordPress AI Client.

As a Composer package

composer require itzmekhokan/ai-provider-for-bedrock

Author

Khokan Sardar

License

GPL-2.0-or-later

Read the full README on GitHub →