I tried Web Search for GPT models on Amazon Bedrock with GPT-5.6 Luna

I tried Web Search for GPT models on Amazon Bedrock with GPT-5.6 Luna

Amazon Bedrock now offers general availability of the Web Search tool for OpenAI GPT models. By simply adding tools=[{"type": "web_search"}] in the Responses API, you can use web search grounding. I confirmed retrieval of Japanese responses and source citations with GPT-5.6 Luna.
2026.08.07

This page has been translated by machine translation. View original

Introduction

On August 4, 2026, Web Search tool for OpenAI GPT models became generally available on Amazon Bedrock.

https://aws.amazon.com/about-aws/whats-new/2026/08/amazon-bedrock-web/

Web Search is a server-side built-in tool enabled via the tools parameter compatible with the OpenAI Responses API. At the time of writing, search is served from a web index and cache operated by Amazon, and request data does not leave the AWS boundary. Responses include source URLs and page titles as citations.

In this article, we use Web Search with GPT-5.6 Luna to verify Japanese responses and source citation retrieval. How to use the Mantle endpoint and the required IAM settings are covered in the following articles.

https://dev.classmethod.jp/articles/bedrock-mantle-lambda-layer-4-routes/

https://dev.classmethod.jp/articles/bedrock-openai-gpt56-sol-terra-luna/

Verification Details

Verification Environment

Item Value
Region us-east-1
Endpoint https://bedrock-mantle.us-east-1.api.aws/openai/v1
Model openai.gpt-5.6-luna
Python 3.12
openai 2.40.0
aws-bedrock-token-generator 1.1.0

At the time of writing, the regions where Web Search is available are us-east-1, us-east-2, and us-west-2. Supported models are GPT-5.4, GPT-5.5, and GPT-5.6 (Sol/Terra/Luna). For the latest region and model availability, please check the official documentation.

Simply add tools=[{"type": "web_search"}] to enable it. In this article, external_web_access: False is also specified to make the search source explicit.

from openai import OpenAI
from aws_bedrock_token_generator import provide_token

REGION = "us-east-1"
MODEL = "openai.gpt-5.6-luna"
BASE_URL = f"https://bedrock-mantle.{REGION}.api.aws/openai/v1"

client = OpenAI(base_url=BASE_URL, api_key=provide_token(region=REGION))

response = client.responses.create(
    model=MODEL,
    instructions="あなたは親切なアシスタントです。必ず日本語で回答してください。",
    input="週間aws 2026",
    tools=[{"type": "web_search", "external_web_access": False}],
)

The external_web_access parameter controls the search source. The documentation states that a future release may enable retrieval from the external web, but at this time, specifying this value still retrieves from Bedrock's web index and cache.

Today, retrieval is served entirely from the Amazon Bedrock web index and cache, so no request data leaves the AWS boundary even when this permission is granted. In a future release, this configuration may allow search and fetch to retrieve content from the live external web.

https://docs.aws.amazon.com/bedrock/latest/userguide/web-search.html

Japanese responses are specified via the instructions parameter. In this verification, omitting it caused responses to be returned in languages other than Japanese, so it was specified explicitly. At the time of writing, no dedicated language specification parameter appears to exist in the OpenAI Responses API.

Verification Results

We verified with 2 query patterns.

Pattern Query Purpose
1 "週間aws 2026" Simple query
2 "bedrock mantle GPT モデルを Lambdaレイヤで実行する方法を教えて" Technical question

Pattern 1: Simple Query

The code shown in "Enabling Web Search" was run as-is.

Search Query Expansion

The model expands the user's input "週間aws 2026" into multiple search queries and executes the searches. You can see this expansion process by looking at web_search_call in response.output.

{
  "type": "web_search_call",
  "status": "completed",
  "action": {
    "type": "search",
    "query": "週間AWS 2026",
    "queries": ["週間AWS 2026", "AWS 週間 2026 日本", "週刊AWS 2026"]
  }
}

Additional searches include site: restrictions, narrowing results to official AWS domains.

{
  "type": "web_search_call",
  "status": "completed",
  "action": {
    "type": "search",
    "query": "site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8\"",
    "queries": [
      "site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8\"",
      "site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8/3週\"",
      "site:aws.amazon.com/jp/blogs/news/ \"週刊AWS\" \"2026/7/27週\""
    ]
  }
}
Final Answer and Source Citations

The response generated from the search results is included in the message block of response.output. References are attached as url_citation in annotations (only one is shown here as an excerpt).

{
  "type": "message",
  "phase": "final_answer",
  "content": [
    {
      "type": "output_text",
      "text": "「**週刊AWS 2026**」をお探しなら...",
      "annotations": [
        {
          "type": "url_citation",
          "title": "週刊AWS | Amazon Web Services ブログ",
          "url": "https://aws.amazon.com/jp/blogs/news/tag/%E9%80%B1%E5%88%8Aaws/",
          "start_index": 41,
          "end_index": 124
        }
      ]
    }
  ]
}

start_index and end_index indicate the corresponding location in the response text. The code to extract citations is as follows.

for item in response.output:
    if item.type == "message":
        for block in item.content:
            if block.type == "output_text":
                for ann in block.annotations:
                    if ann.type == "url_citation":
                        print(f"{ann.title}: {ann.url}")

Token usage was 11,516 input, 495 output, and 12,011 total. The large input count is because search result snippets are included in the context.

Pattern 2: Technical Question

response = client.responses.create(
    model=MODEL,
    instructions="あなたは親切なアシスタントです。必ず日本語で回答してください。",
    input="bedrock mantle GPT モデルを Lambdaレイヤで実行する方法を教えて",
    tools=[{"type": "web_search", "external_web_access": False}],
)
Search Query Expansion

For technical questions, more search patterns are generated.

{
  "type": "web_search_call",
  "action": {
    "type": "search",
    "query": "Amazon Bedrock Mantle GPT model Lambda layer 実行方法",
    "queries": [
      "Amazon Bedrock Mantle GPT model Lambda layer 実行方法",
      "site:docs.aws.amazon.com Amazon Bedrock Mantle GPT Lambda",
      "site:aws.amazon.com/bedrock Mantle GPT"
    ]
  }
}

Additional searches also include queries targeting documentation and GitHub.

{
  "type": "web_search_call",
  "action": {
    "type": "search",
    "query": "site:docs.aws.amazon.com/bedrock/latest/userguide bedrock mantle IAM bearer token Lambda",
    "queries": [
      "site:docs.aws.amazon.com/bedrock/latest/userguide bedrock mantle IAM bearer token Lambda",
      "site:github.com/aws aws-bedrock-token-generator-python Lambda",
      "site:docs.aws.amazon.com/lambda/latest/dg layers python dependencies"
    ]
  }
}
Final Answer and Citations

After two searches and one page fetch, a detailed response was returned containing 11 citations.

{
  "type": "message",
  "phase": "final_answer",
  "content": [
    {
      "type": "output_text",
      "text": "以下は、**Amazon Bedrock Mantle 経由の GPT モデルを、Python Lambda+Lambda Layer から呼び出す構成**です...",
      "annotations": [
        {
          "type": "url_citation",
          "title": "Inference using Responses API - Amazon Bedrock",
          "url": "https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html",
          "start_index": 278,
          "end_index": 473
        },
        {
          "type": "url_citation",
          "title": "Endpoints supported by Amazon Bedrock - Amazon Bedrock",
          "url": "https://docs.aws.amazon.com/en_us/bedrock/latest/userguide/endpoints.html",
          "start_index": 278,
          "end_index": 473
        }
      ]
    }
  ]
}

Referenced sources (excerpted from 11 citations / 4 unique URLs):

  • docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html
  • docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-luna.html
  • aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/

Structure of response.output

response.output contains the entire process from search to response generation.

type Content
reasoning Thinking process (encrypted)
web_search_call Search (action.type: search) or page fetch (action.type: open_page)
message Final answer + annotations

The model autonomously executes multiple searches and page fetches, collects the necessary information, and then generates a response. For the full text, please refer to "Full response.output" at the end of the article.

Summary

There is no longer a need to prepare your own search infrastructure when you want GPT models on Bedrock to reference the latest information. In this verification, the tools specification for the OpenAI API could be used as-is.

Looking at response.output, you can see that the model autonomously executes multiple searches and page fetches. For the two AWS-related queries tested this time, domain restrictions such as site:docs.aws.amazon.com and site:aws.amazon.com were applied to the search queries, resulting in many references to official AWS documentation and blogs.

If external_web_access: True enables retrieval from the external web, the range of searchable targets would expand and more use cases would become possible.

Full response.output (IDs masked)

Pattern 1: Simple Query (週間aws 2026)

[
  {
    "id": "rs_xxxxx",
    "type": "reasoning",
    "encrypted_content": "(Encrypted thinking process)"
  },
  {
    "id": "ws_xxxxx",
    "type": "web_search_call",
    "status": "completed",
    "action": {
      "type": "search",
      "query": "週間AWS 2026",
      "queries": ["週間AWS 2026", "AWS 週間 2026 日本", "週刊AWS 2026"]
    }
  },
  {
    "id": "rs_xxxxx",
    "type": "reasoning",
    "encrypted_content": "(Encrypted thinking process)"
  },
  {
    "id": "ws_xxxxx",
    "type": "web_search_call",
    "status": "completed",
    "action": {
      "type": "search",
      "query": "site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8\"",
      "queries": [
        "site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8\"",
        "site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8/3週\"",
        "site:aws.amazon.com/jp/blogs/news/ \"週刊AWS\" \"2026/7/27週\""
      ]
    }
  },
  {
    "id": "rs_xxxxx",
    "type": "reasoning",
    "encrypted_content": "(Encrypted thinking process)"
  },
  {
    "id": "ws_xxxxx",
    "type": "web_search_call",
    "status": "completed",
    "action": {
      "type": "open_page",
      "url": "https://aws.amazon.com/jp/blogs/news/tag/%E9%80%B1%E5%88%8Aaws/"
    }
  },
  {
    "id": "msg_xxxxx",
    "type": "message",
    "role": "assistant",
    "status": "completed",
    "phase": "final_answer",
    "content": [
      {
        "type": "output_text",
        "text": "「**週刊AWS 2026**」をお探しなら、AWS公式ブログの一覧はこちらです...",
        "annotations": [
          {
            "type": "url_citation",
            "title": "週刊AWS | Amazon Web Services ブログ",
            "url": "https://aws.amazon.com/jp/blogs/news/tag/%E9%80%B1%E5%88%8Aaws/",
            "start_index": 41,
            "end_index": 124
          },
          {
            "type": "url_citation",
            "title": "週刊AWS | Amazon Web Services ブログ",
            "url": "https://aws.amazon.com/jp/blogs/news/tag/%E9%80%B1%E5%88%8Aaws/",
            "start_index": 499,
            "end_index": 582
          },
          {
            "type": "url_citation",
            "title": "週刊AWS | Amazon Web Services ブログ",
            "url": "https://aws.amazon.com/jp/blogs/news/tag/%E9%80%B1%E5%88%8Aaws/",
            "start_index": 715,
            "end_index": 798
          }
        ]
      }
    ]
  }
]

Pattern 2: Technical Question (How to run with Lambda Layer)

[
  {
    "id": "rs_xxxxx",
    "type": "reasoning",
    "encrypted_content": "(Encrypted thinking process)"
  },
  {
    "id": "ws_xxxxx",
    "type": "web_search_call",
    "status": "completed",
    "action": {
      "type": "search",
      "query": "Amazon Bedrock Mantle GPT model Lambda layer 実行方法",
      "queries": [
        "Amazon Bedrock Mantle GPT model Lambda layer 実行方法",
        "site:docs.aws.amazon.com Amazon Bedrock Mantle GPT Lambda",
        "site:aws.amazon.com/bedrock Mantle GPT"
      ]
    }
  },
  {
    "id": "ws_xxxxx",
    "type": "web_search_call",
    "status": "completed",
    "action": {
      "type": "search",
      "query": "site:docs.aws.amazon.com/bedrock/latest/userguide bedrock mantle IAM bearer token Lambda",
      "queries": [
        "site:docs.aws.amazon.com/bedrock/latest/userguide bedrock mantle IAM bearer token Lambda",
        "site:github.com/aws aws-bedrock-token-generator-python Lambda",
        "site:docs.aws.amazon.com/lambda/latest/dg layers python dependencies"
      ]
    }
  },
  {
    "id": "ws_xxxxx",
    "type": "web_search_call",
    "status": "completed",
    "action": {
      "type": "open_page",
      "url": "https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html"
    }
  },
  {
    "id": "msg_xxxxx",
    "type": "message",
    "role": "assistant",
    "status": "completed",
    "phase": "final_answer",
    "content": [
      {
        "type": "output_text",
        "text": "以下は、**Amazon Bedrock Mantle 経由の GPT モデルを、Python Lambda+Lambda Layer から呼び出す構成**です...",
        "annotations": [
          {
            "type": "url_citation",
            "title": "Inference using Responses API - Amazon Bedrock",
            "url": "https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html",
            "start_index": 278,
            "end_index": 473
          },
          {
            "type": "url_citation",
            "title": "Endpoints supported by Amazon Bedrock - Amazon Bedrock",
            "url": "https://docs.aws.amazon.com/en_us/bedrock/latest/userguide/endpoints.html",
            "start_index": 278,
            "end_index": 473
          },
          {
            "type": "url_citation",
            "title": "Get started with OpenAI GPT-5.6 Sol, Terra, and Luna on Amazon Bedrock",
            "url": "https://aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/",
            "start_index": 1089,
            "end_index": 1224
          },
          {
            "type": "url_citation",
            "title": "Get started with OpenAI GPT-5.6 Sol, Terra, and Luna on Amazon Bedrock",
            "url": "https://aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/",
            "start_index": 2044,
            "end_index": 2179
          },
          {
            "type": "url_citation",
            "title": "Get started with OpenAI GPT-5.6 Sol, Terra, and Luna on Amazon Bedrock",
            "url": "https://aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/",
            "start_index": 4776,
            "end_index": 4911
          },
          {
            "type": "url_citation",
            "title": "GPT-5.6 Luna - Amazon Bedrock",
            "url": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-luna.html",
            "start_index": 5209,
            "end_index": 5456
          },
          {
            "type": "url_citation",
            "title": "Get started with OpenAI GPT-5.6 Sol, Terra, and Luna on Amazon Bedrock",
            "url": "https://aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/",
            "start_index": 5209,
            "end_index": 5456
          },
          {
            "type": "url_citation",
            "title": "GPT-5.6 Luna - Amazon Bedrock",
            "url": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-luna.html",
            "start_index": 6647,
            "end_index": 6894
          },
          {
            "type": "url_citation",
            "title": "Get started with OpenAI GPT-5.6 Sol, Terra, and Luna on Amazon Bedrock",
            "url": "https://aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/",
            "start_index": 6647,
            "end_index": 6894
          },
          {
            "type": "url_citation",
            "title": "Inference using Responses API - Amazon Bedrock",
            "url": "https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html",
            "start_index": 7275,
            "end_index": 7372
          },
          {
            "type": "url_citation",
            "title": "Inference using Responses API - Amazon Bedrock",
            "url": "https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html",
            "start_index": 8069,
            "end_index": 8166
          }
        ]
      }
    ]
  }
]

AI白書2026 配布中

クラスメソッドが独自に行なったAI診断調査をもとに、企業のAI活用の現在地を調査レポートとしてまとめました。企業規模別の活用度傾向に加え、規模を超えてAI活用を進める企業に共通する取り組みまで、自社の現在地を捉えるためのヒントにぜひ。

AI白書2026

無料でダウンロードする

Share this article

AWSのお困り事はクラスメソッドへ