Skip to content

Instantly share code, notes, and snippets.

@ensean
Created July 6, 2026 06:26
Show Gist options
  • Select an option

  • Save ensean/1e6eea96956a341cbbaed19b4cb229bd to your computer and use it in GitHub Desktop.

Select an option

Save ensean/1e6eea96956a341cbbaed19b4cb229bd to your computer and use it in GitHub Desktop.
sonnet-5 and fable-5 测试
  1. Bedrock root 账号生成 Bedrock API 短期密钥
  2. export 环境变量执行命令

export AWS_BEARER_TOKEN_BEDROCK=bedrock-api-key-YmVkcm9jay

# sonnet-5 激活
curl -X POST \
    "https://bedrock-runtime.us-east-1.amazonaws.com/model/global.anthropic.claude-sonnet-5/invoke" \
    -H "Authorization: Bearer $AWS_BEARER_TOKEN_BEDROCK" \
    -H "Content-Type: application/json" \
    -d '{
    "anthropic_version": "bedrock-2023-05-31",
    "max_tokens": 1024,
    "messages": [
        {
        "role": "user",
        "content": "你好,请介绍一下你自己。"
        }
    ]
    }'


# fable-5 开启数据共享
curl -X PUT \
  "https://bedrock.us-east-1.amazonaws.com/data-retention" \
  -H "Authorization: Bearer $AWS_BEARER_TOKEN_BEDROCK" \
  -H "Content-Type: application/json" \
  -d '{"mode": "provider_data_share"}'

# fable-5 激活
curl -X POST \
  "https://bedrock-runtime.us-east-1.amazonaws.com/model/global.anthropic.claude-fable-5/invoke" \
  -H "Authorization: Bearer $AWS_BEARER_TOKEN_BEDROCK" \
  -H "Content-Type: application/json" \
  -d '{
    "anthropic_version": "bedrock-2023-05-31",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": "你好"
      }
    ]
  }'
  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment