AI 服務暫時不可用,以下為來源正文,待恢復後補全翻譯。
Canadian organizations building generative AI applications on Amazon Bedrock often need the latest foundation models (FMs), such as OpenAI GPT-6.1, OpenAI GPT-6, and GPT-5.6, accessible from the Canadian AWS Regions. With Amazon Bedrock cross-Region inference (CRIS), you can now access these models from Canada. OpenAI GPT-5.6 models (Sol, Terra, and Luna), GPT-6 (Astra, Sol, and Luna), and GPT-6.1 Sol are available from the Canada (Central) and Canada West (Calgary) Regions. Inference is processed in North America, with data-residency controls described later in this post. Cross-Region inference is a capacity mechanism. Your application calls the Amazon Bedrock Runtime endpoint in your source Region. Amazon Bedrock then routes the request to a supported destination Region for processing. With this approach, you get access to a broader capacity pool that can help your application sustain throughput during demand spikes. You don’t need to manage destination Region routing in your application. In this post, we walk through the GPT-5.6, GPT-6, and GPT-6.1 models available from Canada and the cross-Region inference profiles that serve them. We then show how to set up permissions and invoke the models with the OpenAI Responses API, Chat Completions API, and the Amazon Bedrock Converse API. For the Responses API, we include streaming and tool-use examples. Finally, we cover how to request quota increases, review the observability signals available in your source Region, and clean up when you are done. Models available from Canada With Amazon Bedrock, you can access three families of OpenAI models in Canada through cross-Region inference. The following table summarizes each model and its positioning. Model Positioning GPT-6.1 Sol Strong reasoning and coding for tasks where both performance and cost matter GPT-6 Astra Complex end-to-end reasoning and agentic tasks GPT-6 Sol Strong reasoning and coding for recurring tasks with economics suited to regular use GPT-6 Luna Fast, low-cost inference for high-volume repeated tasks with adjustable reasoning effort per request GPT-5.6 Sol High reasoning, coding, and agentic workloads GPT-5.6 Terra Balanced performance and cost for everyday production GPT-5.6 Luna Fast and affordable for high-volume, latency-sensitive applications These models accept text and image inputs, return text, and support a 1-million-token context window, reasoning mode, and tool calling. GPT-6.1 Sol supports the same context window and tool calling, with additional input and output modalities documented in its model card. GPT-5.6, GPT-6, and GPT-6.1 also support prompt caching on Amazon Bedrock (see the Prompt caching section). These models are available through the OpenAI Responses API, the OpenAI Chat Completions API, and the Amazon Bedrock Converse API on the bedrock-runtime endpoint. For pricing, see Amazon Bedrock pricing. For per-model Region availability, see the model cards in the Amazon Bedrock User Guide. Cross-Region inference profiles from Canada Amazon Bedrock inference profiles are logical identifiers you pass in place of a raw model ID. Each profile defines a model and the set of Regions to which Amazon Bedrock can route a request. Two profile types are available from Canada: US geographic (prefixed us.) routes requests to your Canadian source Region and US Regions. Choose this profile when your workload requires inference processing to remain within North America (Canada and the US). Global (prefixed global.) routes requests to supported commercial AWS Regions where the model is deployed. This draws on a broader capacity pool at the time of the request. Endpoint availability differs by model and source Region, as shown in the following table. Model US geographic profile Global profile GPT-6.1 Sol ca-central-1, ca-west-1 ca-central-1, ca-west-1 GPT-6 Astra / Sol / Luna ca-central-1, ca-west-1 ca-central-1, ca-west-1 GPT-5.6 Sol / Terra / Luna ca-central-1, ca-west-1 ca-central-1 Profile membership and model availability can change. The global profile for the GPT-5.6 models is available only from ca-central-1. From ca-west-1, use the US geographic profile for GPT-5.6. Verify the active profiles for your source Region before deployment, either with the AWS Command Line Interface (AWS CLI) or on the console (see the following section), or see the Cross-Region inference support documentation. Getting started The following sections walk through the setup and code needed to invoke these models from your Canadian source Region. Prerequisites Before you begin, confirm that you have the following: An AWS account with the Canada (Central) ca-central-1 or Canada West (Calgary) ca-west-1 Region enabled as your source Region. An AWS Identity and Access Management (IAM) role or user with permissions to invoke the inference profiles (see Set up permissions). A service control policy (SCP) that allows the inference profiles in your source Region, if your organization enforces SCPs (see SCP considerations). Python 3.9 or later with the openai, boto3, and aws-bedrock-token-generator packages installed. Set up permissions For quick exploration, attach the AWS managed policy AmazonBedrockLimitedAccess. For deployed workloads with stricter access controls, use a least-privilege custom policy. The following example grants access to the GPT-6 Astra global profile from ca-central-1: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["bedrock:InvokeModel*"], "Resource": [ "arn:aws:bedrock:ca-central-1::inference-profile/global.openai.gpt-6-astra" ] }, { "Effect": "Allow", "Action": ["bedrock:InvokeModel*"], "Resource": ["arn:aws:bedrock:*::foundation-model/openai.gpt-6-astra"], "Condition": { "StringLike": { "bedrock:InferenceProfileArn": "arn:aws:bedrock:ca-central-1::inference-profile/global.openai.gpt-6-astra" } } } ] } If you authenticate through the API-key path (bearer token for the OpenAI SDK), also grant bedrock:CallWithBearerToken. For the Responses API, add bedrock:InvokeModel on arn:aws:bedrock:ca-central-1:*:project/default. SCP considerations If your organization restricts Regions through SCPs, use the bedrock:InferenceProfileArn condition key to allow CRIS traffic while blocking direct calls to unapproved Regions. The following SCP denies Amazon Bedrock inference outside your approved source Regions unless the request uses a CRIS inference profile: { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyBedrockOutsideCanadaUnlessCris", "Effect": "Deny", "Action": ["bedrock:InvokeModel*"], "Resource": "*", "Condition": { "StringNotEquals": { "aws:RequestedRegion": ["ca-central-1", "ca-west-1"] }, "ArnNotLike": { "bedrock:InferenceProfileArn": [ "arn:aws:bedrock:*:*:inference-profile/us.openai.*", "arn:aws:bedrock:*:*:inference-profile/global.openai.*" ] } } } ] } With this condition, Amazon Bedrock can route to the profile’s destination Regions even when those Regions are otherwise denied by your SCP. Every destination Region in your chosen profile must be allowed for the request to succeed. For more detail, see Set up cross-Region inference in multi-account environments. Verify active inference profiles Before invoking a model, you can verify which profiles are active in your source Region with the AWS CLI. The following command lists the active OpenAI profiles from ca-central-1. To run the same check from Calgary, replace ca-central-1 with ca-west-1. aws bedrock list-inference-profiles \ --region ca-central-1 \ --type-equals SYSTEM_DEFINED \ --query "inferenceProfileSummaries[?contains(inferenceProfileId, 'openai')].[inferenceProfileId,status]" \ --output table The Amazon Bedrock console offers the same view. Open the console, choose Canada (Central) or Canada West (Calgary) as your Region, choose Cross-Region inference under Inference, and review the available profiles. The following screenshot shows the active OpenAI inference profiles listed on the Amazon Bedrock console for the Canada (Central) Region. Figure 1: Active OpenAI cross-Region inference profiles on the Amazon Bedrock console (Canada (Central)) Invoke the models through Amazon Bedrock Runtime GPT-5.6, GPT-6, and GPT-6.1 support three access paths on the bedrock-runtime endpoint: the OpenAI Responses API, the OpenAI Chat Completions API, and the Amazon Bedrock Converse API. The OpenAI-compatible APIs are called on the /openai/v1 paths of the endpoint. The endpoint accepts either AWS Signature Version 4 (SigV4) or an Amazon Bedrock API key. The following examples use the Amazon Bedrock token generator for Python to create a short-term Amazon Bedrock API key from your current AWS credentials, so your application does not need to store a static key. OpenAI Responses API For applications that already use the OpenAI SDK with the Responses API, point the client at the Regional Amazon Bedrock Runtime endpoint and pass the inference profile ID as the model. from aws_bedrock_token_generator import provide_token from openai import OpenAI region = "ca-central-1" # Use "ca-west-1" for Calgary client = OpenAI( base_url=f"https://bedrock-runtime.{region}.amazonaws.com/openai/v1", api_key=provide_token(region=region), ) response = client.responses.create( model="global.openai.gpt-6-astra", input="What are the key considerations for AI governance in Canadian financial services?", max_output_tokens=1024, ) print(response.output_text) For streaming output, set stream=True and iterate over the response events, printing text as it arrives: stream = client.responses.create( model="global.openai.gpt-6-luna", input="List five generative AI use cases for Canadian healthcare.", max_output_tokens=512, stream=True, ) for event in stream: if event.type == "response.output_text.delta": print(event.delta, end="", flush=True) OpenAI Chat Completions API The OpenAI Chat Completions format works through the same endpoint. response = client.chat.completions.create( model="global.openai.gpt-5.6-terra", messages=[{"role": "user", "content": "Summarize recent AI regulatory trends in Canada."}], max_completion_tokens=1024, reasoning_effort="low", ) print(response.choices[0].message.content) For the full list of supported parameters, including reasoning effort levels, see the model cards in the Amazon Bedrock User Guide. Amazon Bedrock Converse API Use the Converse API when your application calls Amazon Bedrock through an AWS SDK. Boto3 resolves credentials through the standard AWS credential chain. import boto3 bedrock = boto3.client("bedrock-runtime", region_name="ca-central-1") response = bedrock.converse( modelId="us.openai.gpt-5.6-terra", messages=[{"role": "user", "content": [{"text": "Summarize recent AI regulatory trends in Canada."}]}], inferenceConfig={"maxTokens": 1024}, ) # GPT-5.6 and GPT-6 may return a reasoningContent block alongside the text. # Select the block that contains the text output. text_output = next(block["text"] for block in response["output"]["message"]["content"] if "text" in block) print(text_output) The same call works for GPT-6 Sol, GPT-6 Luna, and GPT-6.1 Sol by changing the inference profile ID. The following example uses the US geographic profile for GPT-6 Sol and the global profile for GPT-6 Luna. Both were validated from ca-central-1. # GPT-6 Sol, GPT-6 Luna, and GPT-6.1 Sol are called the same way. Swap the inference profile ID, and choose a us. (US geographic) or global. profile to match your data boundary. # For example, GPT-6.1 Sol via the US geographic profile: modelId="us.openai.gpt-6.1-sol" # GPT-6 Sol via the US geographic profile: strong reasoning and coding for complex work. response = bedrock.converse( modelId="us.openai.gpt-6-sol", messages=[{"role": "user", "content": [{"text": "Summarize recent AI regulatory trends in Canada."}]}], inferenceConfig={"maxTokens": 512}, ) # GPT-6 Luna via the global profile: fast, low-cost inference for high-volume tasks such as c [truncated for AI cost control]