Download the PHP package aisdk/bedrock without Composer

On this page you can find all versions of the php package aisdk/bedrock. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bedrock

aisdk/bedrock

GitHub Workflow Status Total Downloads Latest Version License Why PHP in 2026


Official Amazon Bedrock provider for the framework-agnostic PHP AI SDK. Anthropic models use native InvokeModel by default, other text models use Converse, and images and embeddings use InvokeModel. Bedrock's OpenAI-compatible Chat Completions and Responses surfaces are also available.

Installation

Basic Usage

Bedrock model IDs pass through unchanged and do not need to be registered. This package does not ship a model inventory; the SDK performs internal adapter validation before Bedrock validates support for the selected model in the current account and region.

API surfaces

Anthropic model IDs automatically use the native Messages format through InvokeModel. You can override that choice per request:

Supported values are converse, invoke, mantle_chat, and mantle_responses. Mantle selections automatically use the regional bedrock-mantle.{region}.api.aws/v1 endpoint unless you configured a custom base URL. You can also set api in Bedrock::create() to choose one surface for that provider instance.

Streaming

Image generation

Embeddings

Amazon Titan Text Embeddings V1/V2 and Cohere Embed v3/v4 use their native Bedrock request and response formats:

Cohere requires an input_type: search_document, search_query, classification, or clustering. Cohere v4 supports 256, 512, 1024, or 1536 dimensions; Cohere v3 has a fixed output size.

Titan V2 supports 256, 512, or 1024 dimensions and its normalize option can be passed through providerOptions(). Titan V1 has a fixed output size. Bedrock accepts one Titan text per invocation, so the SDK invokes the model once per input when you pass a list.

Other Bedrock embedding model families are rejected because their native wire formats are not interchangeable.

Video generation

Amazon Nova Reel writes generated videos to your S3 bucket.

Live voice with Nova 2 Sonic

Nova Sonic uses Bedrock's full-duplex InvokeModelWithBidirectionalStream operation. Install the ready-made transport package for HTTP/2:

The input is signed 16-bit little-endian linear PCM. Input sample rate defaults to 16 kHz and output defaults to 24 kHz. Provider-specific Nova settings can be overridden without expanding the shared core API:

AiSdk\Live and its transport contracts are provided by aisdk/core, so the ready-made transport is optional. Without aisdk/transport, pass an application transport that supports core's Http2Endpoint:

The custom transport only moves full-duplex HTTP/2 byte frames and implements half-closing. AWS signing, EventStream framing, and Nova event semantics remain inside aisdk/bedrock.

sendText() provides Nova's cross-modal text input. Tools registered through ->tools() are sent in promptStart; tool calls are normalized by core and their results are returned with Nova's required tool event sequence.

Nova Sonic continuously applies server turn detection, so it does not expose manual commitAudio(), clearAudio(), requestResponse(), or cancelResponse() actions. Bedrock also does not expose dedicated Live::transcribe() or Live::translate() sessions; voice sessions still emit normalized transcription events.

The legacy amazon.nova-sonic-v1:0 model remains protocol-compatible for audio sessions, but it does not support Nova 2's cross-modal sendText() or configurable endpointing sensitivity.

Bedrock bearer API keys cannot authenticate bidirectional streaming. Live uses standard AWS credentials with SigV4. Explicit keys work without the AWS SDK; profiles and the default credential chain require aws/aws-sdk-php.

Authentication

Bedrock supports the full range of AWS authentication:

Profiles and the default chain use the official aws/aws-sdk-php credential providers. Install it to enable them:

Bearer tokens and explicit static keys work without it for ordinary Bedrock requests. Live voice specifically requires SigV4 credentials and does not support bearer tokens.

Variable Description
AWS_BEARER_TOKEN_BEDROCK Bedrock API key (bearer token)
AWS_ACCESS_KEY_ID AWS access key (SigV4)
AWS_SECRET_ACCESS_KEY AWS secret key (SigV4)
AWS_SESSION_TOKEN Optional session token (SigV4)
AWS_PROFILE Named profile for SSO / shared config
AWS_REGION / AWS_DEFAULT_REGION Region (defaults to us-east-1)

Reasoning

Testing

The default suite is fixture- and conformance-based. Credentialed Live network verification is separate and is not run by composer test.

Documentation

Community


All versions of bedrock with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
aisdk/core Version ^0.11.0
aisdk/openai-compatible Version ^0.11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aisdk/bedrock contains the following files

Loading the files please wait ...