This guide covers the Anthropic model SDK. If you use the Claude Agent SDK or Claude Code, follow the Claude integration instead.
Supported APIs
Not documented means the surface is outside the verified coverage for that language.
The Anthropic Bedrock client is not included in this provider integration. To trace direct Boto3 or AWS SDK v3 Bedrock Runtime calls, follow the AWS Bedrock guide. Other Anthropic SDK calls continue to work normally, but unsupported surfaces do not automatically create PromptLayer traces or request logs.
Prerequisites
- A PromptLayer API key for the workspace that should receive the traces
- An Anthropic API key, or the standard Google Cloud credentials and project configuration for Anthropic Vertex
- Python 3.10 or later for Python, or Node.js 20 or later for JavaScript
Python
1. Install the SDKs
AnthropicVertex.
2. Configure Anthropic instrumentation
anthropic selector instruments AnthropicVertex. Sync and async clients are supported.
Use an existing PromptLayer client
Use an existing PromptLayer client
If your application already creates a PromptLayer client, select Anthropic when enabling tracing:Omit
tracing_providers to instrument every supported provider SDK that is installed.JavaScript
1. Install the SDKs
@anthropic-ai/vertex-sdk.
2. Preload PromptLayer instrumentation
The preload must run before the application imports the Anthropic SDK:3. Use the Anthropic SDK normally
configureTracing({ providers: ["anthropic"] }) in a bootstrap module and dynamically import the application afterward. See Select Providers.
Verify the Integration
Run one supported Anthropic request, flush or shut down tracing, and open Traces in PromptLayer. The Anthropic span should have an associated request log. If no span appears:- Confirm instrumentation is configured before the first Anthropic request.
- In JavaScript, confirm the preload or bootstrap runs before the Anthropic SDK module loads.
- Confirm the call uses an API surface listed in Supported APIs.
- Confirm
PROMPTLAYER_API_KEYbelongs to the workspace you are checking. - Flush or shut down tracing before a short-lived process exits.

