Back to Guides
OpenAI APIAWS Bedrock

OpenAI to AWS Bedrock: Enterprise Migration Guide

15 min read
OpenAIAWSEnterpriseSecurityCompliance
Share: Tweet Share

AWS Bedrock provides enterprise-grade AI with VPC isolation, SOC 2 compliance, and unified access to Claude, Llama, and Titan models. Essential for regulated industries.

Why Enterprise Teams Choose AWS Bedrock

When standard API access isn't sufficient due to compliance requirements, AWS Bedrock offers:

  • Data Privacy: Your prompts and completions are never used to train foundation models
  • VPC Deployment: Run inference within your private network, never touching the public internet
  • Compliance: SOC 2 Type 2, HIPAA, ISO 27001, PCI DSS, FedRAMP compliant
  • Model Diversity: Claude 3.5, Llama 3, Mistral, Titan, and Stable Diffusion in one API
  • Cost Management: AWS consolidated billing, reserved capacity discounts
  • Audit Logging: Complete CloudTrail integration for all API calls
  • Typical use cases: Healthcare (HIPAA), Finance (SOC 2/PCI), Government (FedRAMP), Legal (data residency)

    Found this guide useful?

    Get weekly AI credit updates — new programs, price drops, migration tips. Free, always.

    Using our affiliate links supports free access to all guides.

    Available Models in Bedrock

    Anthropic Claude:

  • Claude 3.5 Sonnet (anthropic.claude-3-5-sonnet-20241022-v2:0)
  • Claude 3 Haiku (anthropic.claude-3-haiku-20240307-v1:0)
  • Claude 3 Opus (anthropic.claude-3-opus-20240229-v1:0)
  • Meta Llama:

  • Llama 3 70B Instruct (meta.llama3-70b-instruct-v1:0)
  • Llama 3 8B Instruct (meta.llama3-8b-instruct-v1:0)
  • Mistral:

  • Mistral Large (mistral.mistral-large-2402-v1:0)
  • Mixtral 8x7B (mistral.mixtral-8x7b-instruct-v0:1)
  • Step 1: Enable Bedrock Access

  • Log into AWS Console
  • Navigate to Amazon Bedrock > Model access
  • Request access to specific models (takes 0-2 minutes for most)
  • Set your region (us-east-1 or us-west-2 have best model availability)
  • Step 2: Install AWS SDK

    text
    pip install boto3 anthropic-bedrock
    # or for direct Bedrock client:
    pip install boto3
    
    Set up credentials:
    aws configure  # or use IAM roles in production

    Step 3: Migrate Your API Calls

    BEFORE (Direct OpenAI):

    text
    from openai import OpenAI
    client = OpenAI(api_key="sk-...")
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": "Analyze this contract for risks."}]
    )

    AFTER (AWS Bedrock with Claude):

    import boto3
    import json
    
    bedrock = boto3.client("bedrock-runtime", region_name="us-east-1")
    body = json.dumps({
        "anthropic_version": "bedrock-2023-05-31",
        "max_tokens": 2048,
        "messages": [{"role": "user", "content": "Analyze this contract for risks."}]
    })
    response = bedrock.invoke_model(
        modelId="anthropic.claude-3-5-sonnet-20241022-v2:0",
        body=body
    )
    result = json.loads(response["body"].read())
    text = result["content"][0]["text"]

    Step 4: Set Up VPC Isolation

    For maximum security, use Bedrock VPC endpoints:

    In your Terraform/CloudFormation:

    text
    aws_vpc_endpoint:
      service_name: com.amazonaws.us-east-1.bedrock-runtime
      vpc_id: your-vpc-id
      subnet_ids: [private-subnet-1, private-subnet-2]
      security_group_ids: [bedrock-sg]

    With VPC endpoints, all Bedrock traffic stays within AWS network and never traverses the public internet.

    Step 5: Streaming Responses

    For real-time applications:

    text
    response = bedrock.invoke_model_with_response_stream(
        modelId="anthropic.claude-3-5-sonnet-20241022-v2:0",
        body=json.dumps(body)
    )
    for event in response["body"]:
        chunk = json.loads(event["chunk"]["bytes"])
        if chunk["type"] == "content_block_delta":
            print(chunk["delta"]["text"], end="")

    Cost Considerations

    Bedrock pricing is slightly higher than direct API access due to enterprise features:

  • Claude 3.5 Sonnet: $3.00 input, $15.00 output per 1M tokens
  • Claude 3 Haiku: $0.25 input, $1.25 output per 1M tokens
  • Use AWS Cost Explorer to monitor Bedrock spending and set billing alerts.

    Apply for AWS Activate Credits

    AWS Activate for startups offers up to $100K in credits including Bedrock usage. If you're an enterprise, contact your AWS account manager about Bedrock Enterprise Discount Plans.

    Platform actively maintained

    If this saved you research time...

    No ads, no paywalls. A quick share on Reddit or LinkedIn goes a long way for an independent project.  ·  53 verified AI credit programs  ·  Content refreshed June 2026.

    We use cookies & analytics

    We use cookies for analytics (GA4, Umami) and to improve your experience. No personal data is sold. Privacy Policy