Monitoring and logging
AWS CloudTrail can capture all requests to Claude Platform on AWS. Workspace, external key, compliance, vault, and webhook operations are logged as Management events by default. Inference, batch, file, skill, model, user profile, and Claude Managed Agents operations (other than vaults and webhooks) are classified as Data events and require explicit data event logging configuration, which incurs additional CloudTrail charges. See the IAM actions reference for the full event type classification and the AWS CloudTrail documentation for configuration details.
Request IDs
Each response includes two request IDs in the response headers:
AWS request ID (
x-amzn-requestid): The primary ID, indexed in CloudTrail. Use this when investigating requests through AWS tooling or when contacting AWS support.Anthropic request ID (
request-id): The secondary ID. Use this when contacting Anthropic support.bash# Replace us-west-2 with your AWS region in both the URL and --aws-sigv4 # -i includes the response headers in the output # Omit the x-amz-security-token header if you use long-term IAM user credentials curl -i "https://aws-external-anthropic.us-west-2.api.aws/v1/messages" \ --aws-sigv4 "aws:amz:us-west-2:aws-external-anthropic" \ --user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \ -H "x-amz-security-token: $AWS_SESSION_TOKEN" \ -H "content-type: application/json" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-workspace-id: $ANTHROPIC_AWS_WORKSPACE_ID" \ -d '{ "model": "claude-sonnet-5", "max_tokens": 1024, "messages": [ {"role": "user", "content": "Hello!"} ] }'bash# The ant CLI's output formats print the response body, not response headers. # To read x-amzn-requestid, use the cURL example (-i) or an SDK example.pythonfrom anthropic import AnthropicAWS client = AnthropicAWS() response = client.messages.with_raw_response.create( model="claude-sonnet-5", max_tokens=1024, messages=[{"role": "user", "content": "Hello!"}], ) print(response.headers.get("x-amzn-requestid")) # AWS request ID print(response.headers.get("request-id")) # Anthropic request ID message = response.parse() print(message.content)typescriptimport AnthropicAws from "@anthropic-ai/aws-sdk"; const client = new AnthropicAws(); const { data: message, response } = await client.messages .create({ model: "claude-sonnet-5", max_tokens: 1024, messages: [{ role: "user", content: "Hello!" }] }) .withResponse(); console.log(response.headers.get("x-amzn-requestid")); // AWS request ID console.log(response.headers.get("request-id")); // Anthropic request ID console.log(message.content);csharpusing Anthropic; using Anthropic.Aws; var client = new AnthropicAwsClient(); var response = await client.WithRawResponse.Messages.Create(new() { Model = Model.ClaudeSonnet5, MaxTokens = 1024, Messages = [new() { Role = Role.User, Content = "Hello!" }] }); Console.WriteLine(response.Headers.GetValues("x-amzn-requestid").First()); // AWS request ID Console.WriteLine(response.Headers.GetValues("request-id").First()); // Anthropic request ID Console.WriteLine(response.Value.Content);goclient, err := anthropicaws.NewClient(context.Background(), anthropicaws.ClientConfig{}) if err != nil { panic(err) } var response *http.Response message, err := client.Messages.New( context.Background(), anthropic.MessageNewParams{ Model: anthropic.ModelClaudeSonnet5, MaxTokens: 1024, Messages: []anthropic.MessageParam{ anthropic.NewUserMessage(anthropic.NewTextBlock("Hello!")), }, }, option.WithResponseInto(&response), ) if err != nil { panic(err) } fmt.Println(response.Header.Get("x-amzn-requestid")) // AWS request ID fmt.Println(response.Header.Get("request-id")) // Anthropic request ID fmt.Println(message.Content)javaimport com.anthropic.aws.backends.AwsBackend; import com.anthropic.client.AnthropicClient; import com.anthropic.client.okhttp.AnthropicOkHttpClient; import com.anthropic.core.http.HttpResponseFor; import com.anthropic.models.messages.Message; import com.anthropic.models.messages.MessageCreateParams; import com.anthropic.models.messages.Model; void main() { AnthropicClient client = AnthropicOkHttpClient.builder() .backend(AwsBackend.fromEnv()) .build(); HttpResponseFor<Message> response = client.messages().withRawResponse().create( MessageCreateParams.builder() .model(Model.CLAUDE_SONNET_5) .maxTokens(1024) .addUserMessage("Hello!") .build() ); IO.println(response.headers().values("x-amzn-requestid").get(0)); // AWS request ID IO.println(response.requestId().orElse(null)); // Anthropic request ID IO.println(response.parse().content()); }phpuse Anthropic\Aws\Client; $client = new Client(); $response = $client->messages->raw->create( model: 'claude-sonnet-5', maxTokens: 1024, messages: [['role' => 'user', 'content' => 'Hello!']], ); echo $response->getHeaderLine('x-amzn-requestid') . "\n"; // AWS request ID echo $response->getHeaderLine('request-id') . "\n"; // Anthropic request ID echo $response->parse()->content;ruby# Accessing raw response headers is not currently supported in the Ruby SDK. # To inspect the x-amzn-requestid header, use one of the other SDK examples.
Anthropic recommends logging your activity on at least a 30-day rolling basis to understand usage patterns and investigate issues.
AWS CloudTrail is configured within your AWS account. Enabling logging does not provide AWS or Anthropic access to your content beyond what is necessary for billing and service operation.