# AWS Bedrock Proxy (`apify/aws-bedrock-proxy`) Actor

Dev only for now.
Allows proxying requests to AWS Bedrock and charging Apify credits for them.
Used in Apify AI Agent

- **URL**: https://apify.com/apify/aws-bedrock-proxy.md
- **Developed by:** [Apify](https://apify.com/apify) (community)
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 2,666 total users, 923 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.01 / 1,000 bedrock api usages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Amazon Bedrock Proxy

This Actor runs the [Amazon Bedrock](https://aws.amazon.com/bedrock/) models behind the Apify AI Agent. When the AI Agent bills you for model usage, the charge comes from this Actor, at the rates below.

### Available only to the Apify AI Agent

This Actor accepts requests only from the Apify AI Agent. Any other request is refused, including requests from your own Actor runs, scripts and API clients.

### Supported models

The AI Agent lets you choose one of these Claude models. Prices are in US dollars per million tokens (MTok).

| Model      | Input / MTok | Cache write 5m / MTok | Cache write 1h / MTok | Cache read / MTok | Output / MTok |
| ---------- | ------------ | --------------------- | --------------------- | ----------------- | ------------- |
| Haiku 5.5  | $0.11        | $0.1375               | $0.22                 | $0.011            | $0.55         |
| Sonnet 5.5 | $2.20        | $2.75                 | $4.40                 | $0.11             | $11.00        |
| Opus 5.5   | $4.40        | $5.50                 | $8.80                 | $0.22             | $22.00        |

#### Long prompts

Haiku 5.5 charges more for a long prompt. The prompt counts input, cache read and cache write tokens. When it is over 100,000 tokens, every token of that request is billed at higher rates, output included: $0.55 input, $0.6875 cache write 5m, $1.10 cache write 1h, $0.055 cache read and $2.75 output per MTok.

#### Prompt caching

Writing to the cache costs more when the entry lives longer. Bedrock reports the TTL of each cache write, and you are billed at that rate. A cache write with no TTL reported is billed at the 5 minute rate.

Reading from the cache costs the same either way.

### Pricing

This Actor uses pay-per-event pricing. You pay for the tokens you use, at the rates above, and the price is the same on every Apify plan.

- **Event**: `bedrock-api-usage`, $0.00001 per event
- **Each request**: the Bedrock cost, rounded up to the nearest $0.00001

### Support

For issues with this Actor, [open an issue](https://github.com/apify/actor-aws-bedrock-proxy/issues).

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("apify/aws-bedrock-proxy").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("apify/aws-bedrock-proxy").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call apify/aws-bedrock-proxy --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apify/aws-bedrock-proxy"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/mLjwsXifMEuFlfv4W/builds/dACT3nvPl5mf4cKCl/openapi.json
