Pay-i Amazon Bedrock (Proxy) icon

Pay-i Amazon Bedrock (Proxy)

Amazon Bedrock chat model routed through Pay-i proxy for cost tracking and budget enforcement

Pay-i Amazon Bedrock (Proxy)

AI-generated

Summary

Supplies a LangChain ChatBedrockConverse chat model to an AI Agent or chain, routing Amazon Bedrock requests through the Pay-i proxy so usage is tracked for cost attribution and limit enforcement.

Inputs

  • model (required) — Bedrock model ID (default anthropic.claude-3-5-sonnet-20241022-v2:0). Also sent to Pay-i as the xProxy-PriceAs-Resource header for pricing.
  • region (required) — AWS region of the Bedrock model (default us-east-1); overrides the region in AWS credentials.
  • options — Sampling Temperature (0–1, default 0.7), Maximum Number of Tokens (default 4096), Top P (0–1, default 1).
  • userId — User identifier for cost attribution; sent as xProxy-User-ID when non-empty.
  • useCaseName — Use case definition name; defaults to the workflow name with spaces replaced by hyphens.
  • useCaseId — Use case instance ID; defaults to the n8n execution ID.
  • useCaseStep — Step label within the use case. If empty or left at the default 'Pay-i Amazon Bedrock (Proxy)', the node's canvas name is used instead.
  • advancedTracking — Collection for use case version, use case properties (JSON), limit IDs (comma-separated, enforced by Pay-i) and debug logging. Intended for use with Pay-i Support guidance. A 'Flatten Gemini Content' option is listed but not used by this node's code. Debug logging writes masked headers and routing details to the n8n server log.

Output shape

A single AI Language Model connection (output 'Model') carrying a ChatBedrockConverse instance, for connection to Agent, Chain or other AI root nodes. It does not process input items or return data itself.

Requires two credentials: Pay-i API (baseUrl, apiKey) and AWS (accessKeyId, secretAccessKey, optional sessionToken). Requests go to /api/v1/proxy/aws.bedrock with xProxy-* headers (API key and tracking fields). Header values are sanitized to ASCII. Calls are traced via n8n's LLM tracing.

Examples

Example 1: Use Claude on Bedrock in an AI Agent with per-run cost tracking

Model ID anthropic.claude-3-5-sonnet-20241022-v2:0, region us-east-1, defaults for use case fields; connect Model output to an AI Agent.

Example 2: Attribute spend to a specific user and step across multiple Pay-i nodes

Set User ID to an expression like {{ $json.email }}, Use Case Step to 'Step 1 - Outline', temperature 0.2.

Example 3: Enforce Pay-i budget limits

Under Advanced Tracking, set Limit IDs to a comma-separated list of Pay-i limit IDs.

Links

Discussion