← All docs

AWS Bedrock

Wrap the Bedrock runtime client. Works with any foundation model on Bedrock.

Wrap the AWS Bedrock runtime client. Captures invocations across Claude, Llama, Titan, Mistral, Cohere — any foundation model on Bedrock.

Install

npm install @cisora/sdk @aws-sdk/client-bedrock-runtime

Quickstart

import { BedrockRuntimeClient, InvokeModelCommand } from '@aws-sdk/client-bedrock-runtime';
import { wrapBedrock } from '@cisora/sdk/bedrock';

const bedrock = wrapBedrock(
  new BedrockRuntimeClient({ region: 'us-east-1' }),
  {
    apiKey: process.env.CISORA_API_KEY!,
    agentName: 'bedrock-agent',
  }
);

const res = await bedrock.send(new InvokeModelCommand({
  modelId: 'anthropic.claude-sonnet-4-5-v1:0',
  body: JSON.stringify({
    anthropic_version: 'bedrock-2023-05-31',
    max_tokens: 1024,
    messages: [{ role: 'user', content: 'hi' }],
  }),
  contentType: 'application/json',
  accept: 'application/json',
}));

What gets captured

  • Model ID (anthropic.claude-…, meta.llama-…, mistral.…, cohere.…)
  • Full request body and response body (PII auto-redacted)
  • Input + output tokens from Bedrock-reported usage
  • USD cost computed from per-model Bedrock pricing
  • AWS region and account ID for tracing in multi-account setups
  • tool_use blocks for Claude on Bedrock captured as nested actions

Notes

Works with InvokeModel and Converse

Cisora supports both the legacy InvokeModel API and the unified Converse API across all foundation models.

IAM-friendly

The wrapper preserves the underlying AWS credentials chain. Use IAM roles in production — no AWS keys in your code.

Next steps