[Update] Amazon Bedrock now supports OpenAI's Responses API #AWSreInvent

[Update] Amazon Bedrock now supports OpenAI's Responses API #AWSreInvent

2025.12.28

This page has been translated by machine translation. View original

Hello! I'm Takakuni (@takakuni_) from the Cloud Business Division Consulting Department.

At re:Invent 2025, Amazon Bedrock announced support for OpenAI's Responses API.

https://aws.amazon.com/about-aws/whats-new/2025/12/amazon-bedrock-responses-api-from-openai/

Even though the year is coming to an end, I'd like to explore this update.

Responses API

The Responses API is provided through the OpenAI SDK.

When working with text generation models in the OpenAI SDK, there are two APIs: Chat Completions API and Responses API. The Responses API is newer compared to the Chat Completions API.

There are migration guides from Completions API to Responses API as shown below. (Nostalgic)

https://platform.openai.com/docs/guides/migrate-to-responses

Update Details

This update is essentially "Amazon Bedrock now supports OpenAI's Responses API."

I wasn't aware of this, but apparently it was already possible to execute OpenAI's open-weight models (on Amazon Bedrock) using the OpenAI SDK by utilizing an Amazon Bedrock API Key.

However, until now, only the Chat Completions API was available.

from openai import OpenAI

client = OpenAI(
    base_url="https://bedrock-runtime.us-west-2.amazonaws.com/openai/v2",
    api_key="$AWS_BEARER_TOKEN_BEDROCK" # Replace with actual API key
)

completion = client.chat.completions.create(
    model="gpt-oss-20b",
    messages=[
        {
            "role": "developer",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "Hello!"
        }
    ]
)

print(completion.choices[0].message)

https://docs.aws.amazon.com/bedrock/latest/userguide/inference-chat-completions.html

With this update, the Responses API is now also supported.

As of today, the models gpt-oss-20b and gpt-oss-120b are supported, with more model support coming soon.

Responses API support is available today starting with OpenAI's GPT OSS 20B/120B models, with support for other models coming soon.

Amazon Bedrock now supports Responses API from OpenAI

Project Mantle

The method of executing the Completions API with a Bedrock API key that I mentioned earlier utilized Amazon Bedrock Runtime endpoints.

  • Make an HTTP request with an Amazon Bedrock Runtime endpoint.
  • Use an OpenAI SDK request with an Amazon Bedrock Runtime endpoint.

https://docs.aws.amazon.com/bedrock/latest/userguide/inference-chat-completions.html

Although there isn't much public information, a new distributed inference engine called Mantle has been announced for Amazon Bedrock.

With this update, OpenAI-compatible API endpoints are provided through Mantle.

Amazon Bedrock provides OpenAI compatible API endpoints for model inference, powered by Mantle, a distributed inference engine for large-scale machine learning model serving.

Generate responses using OpenAI APIs

By the way, endpoints provided by Project Mantle support both Completions and Responses APIs. That's great.

Overview

Let me briefly summarize the following documentation:

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

Authentication Methods

First, the Responses API can be accessed either via HTTP requests or through the OpenAI SDK.

Next, Amazon Bedrock can be used with either Amazon Bedrock API Keys or AWS IAM.

When using Amazon Bedrock API keys, the OpenAI SDK is required. When using AWS IAM, HTTP requests are also supported.

Environment Variables

Using specific environment variables can prevent hardcoding credentials in your code. Let's actively use them.

https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html#bedrock-mantle-prereq

Trying it Out

Let's try it out.

Since gpt-oss-20b and gpt-oss-120b are available in Northern Virginia, Ohio, and Oregon regions, I chose Oregon for this test.

https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html

I'll try the following three access methods:

  • Amazon Bedrock API key short-term API key
  • Amazon Bedrock API key long-term API key
  • AWS IAM

Via OpenAI SDK

Registering the Endpoint

To use models through Mantle, you need to update the request URL. Set the environment variable OPENAI_BASE_URL.

Since I'm using the Oregon region, I set the following environment variable. Don't forget to add /v1 at the end.

export OPENAI_BASE_URL=https://bedrock-mantle.us-west-2.api.aws/v1

Check Supported Regions and Endpoints for available regions and endpoint names.

Models API

Before making inferences, let's use the Models API to get a list of models available through Mantle.

models.py
# List all available models using the OpenAI SDK
# Requires OPENAI_API_KEY and OPENAI_BASE_URL environment variables

from openai import OpenAI

client = OpenAI()

models = client.models.list()

for model in models.data:
    print(model.id)

Amazon Bedrock API key short-term API key

Let's start with a short-term API key.

In addition to OPENAI_BASE_URL, register AWS_REGION and OPENAI_API_KEY.

export AWS_REGION=us-west-2
export OPENAI_API_KEY=bedrock-api-key-hoge # Get from Amazon Bedrock console
export OPENAI_BASE_URL=https://bedrock-mantle.us-west-2.api.aws/v1

It worked without any issues!

takakuni@ short-term % uv run models.py
mistral.magistral-small-2509
deepseek.v3.1
google.gemma-3-27b-it
moonshotai.kimi-k2-thinking
openai.gpt-oss-safeguard-120b
nvidia.nemotron-nano-3-30b
qwen.qwen3-coder-30b-a3b-instruct
openai.gpt-oss-120b
qwen.qwen3-next-80b-a3b-instruct
mistral.ministral-3-14b-instruct
openai.gpt-oss-20b
minimax.minimax-m2
nvidia.nemotron-nano-9b-v2
google.gemma-3-4b-it
openai.gpt-oss-safeguard-20b
nvidia.nemotron-nano-12b-v2
mistral.mistral-large-3-675b-instruct
qwen.qwen3-32b
qwen.qwen3-vl-235b-a22b-instruct
google.gemma-3-12b-it
zai.glm-4.6
mistral.voxtral-small-24b-2507
qwen.qwen3-coder-480b-a35b-instruct
mistral.ministral-3-3b-instruct
mistral.voxtral-mini-3b-2507
qwen.qwen3-235b-a22b-2507
mistral.ministral-3-8b-instruct

Amazon Bedrock API key long-term API key

Next, let's try with a long-term API key.

export AWS_REGION=us-west-2
+ export OPENAI_API_KEY=bedrock-api-key-hoge # Get from Amazon Bedrock console
- export OPENAI_API_KEY=bedrock-api-key-hoge # Get from Amazon Bedrock console
export OPENAI_BASE_URL=https://bedrock-mantle.us-west-2.api.aws/v1

We got an error.

takakuni@ openai-api % uv run models.py
Traceback (most recent call last):
  File "/Users/takakuni/Documents/openai-api/models.py", line 8, in <module>
    models = client.models.list()
             ^^^^^^^^^^^^^^^^^^^^
  File "/Users/takakuni/Documents/openai-api/.venv/lib/python3.12/site-packages/openai/resources/models.py", line 91, in list
    return self._get_api_list(
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/takakuni/Documents/openai-api/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1308, in get_api_list
    return self._request_api_list(model, page, opts)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/takakuni/Documents/openai-api/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1159, in _request_api_list
    return self.request(page, options, stream=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/takakuni/Documents/openai-api/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1047, in request
    raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404

Upon investigation, it appears that a new API schema starting with bedrock-mantle has emerged.

For example, in this case, an API like bedrock-mantle:ListModels.

Long-term Amazon Bedrock API Keys are assigned the AmazonBedrockLimitedAccess policy by default, which does not include permissions for bedrock-mantle.

{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "BedrockAPIs",
			"Effect": "Allow",
			"Action": [
				"bedrock:Get*",
				"bedrock:List*",
				"bedrock:CallWithBearerToken",
				"bedrock:BatchDeleteEvaluationJob",
				"bedrock:CreateEvaluationJob",
				"bedrock:CreateGuardrail",
				"bedrock:CreateGuardrailVersion",
				"bedrock:CreateInferenceProfile",
				"bedrock:CreateModelCopyJob",
				"bedrock:CreateModelCustomizationJob",
				"bedrock:CreateModelImportJob",
				"bedrock:CreateModelInvocationJob",
				"bedrock:CreatePromptRouter",
				"bedrock:CreateProvisionedModelThroughput",
				"bedrock:DeleteCustomModel",
				"bedrock:DeleteGuardrail",
				"bedrock:DeleteImportedModel",
				"bedrock:DeleteInferenceProfile",
				"bedrock:DeletePromptRouter",
				"bedrock:DeleteProvisionedModelThroughput",
				"bedrock:StopEvaluationJob",
				"bedrock:StopModelCustomizationJob",
				"bedrock:StopModelInvocationJob",
				"bedrock:TagResource",
				"bedrock:UntagResource",
				"bedrock:UpdateGuardrail",
				"bedrock:UpdateProvisionedModelThroughput",
				"bedrock:ApplyGuardrail",
				"bedrock:InvokeModel",
				"bedrock:InvokeModelWithResponseStream"
			],
			"Resource": "*"
		},
		{
			"Sid": "DescribeKey",
			"Effect": "Allow",
			"Action": ["kms:DescribeKey"],
			"Resource": "arn:*:kms:*:::*"
		},
		{
			"Sid": "APIsWithAllResourceAccess",
			"Effect": "Allow",
			"Action": [
				"iam:ListRoles",
				"ec2:DescribeVpcs",
				"ec2:DescribeSubnets",
				"ec2:DescribeSecurityGroups"
			],
			"Resource": "*"
		},
		{
			"Sid": "MarketplaceOperationsFromBedrockFor3pModels",
			"Effect": "Allow",
			"Action": [
				"aws-marketplace:Subscribe",
				"aws-marketplace:ViewSubscriptions",
				"aws-marketplace:Unsubscribe"
			],
			"Resource": "*",
			"Condition": {
				"StringEquals": {
					"aws:CalledViaLast": "bedrock.amazonaws.com"
				}
			}
		}
	]
}

https://docs.aws.amazon.com/ja_jp/aws-managed-policy/latest/reference/AmazonBedrockLimitedAccess.html

With this update, new AWS managed policies have been added: AmazonBedrockMantleFullAccess, AmazonBedrockMantleReadOnly, and AmazonBedrockMantleInferenceAccess.

Let's try using AmazonBedrockMantleInferenceAccess.

{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "BedrockMantleInference",
			"Effect": "Allow",
			"Action": [
				"bedrock-mantle:Get*",
				"bedrock-mantle:List*",
				"bedrock-mantle:CreateInference"
			],
			"Resource": "arn:aws:bedrock-mantle:*:*:project/*"
		},
		{
			"Sid": "BedrockMantleCallWithBearerToken",
			"Effect": "Allow",
			"Action": ["bedrock-mantle:CallWithBearerToken"],
			"Resource": "*"
		}
	]
}

After adding this permission, it worked properly.

takakuni@ long-term % uv run models.py
qwen.qwen3-vl-235b-a22b-instruct
openai.gpt-oss-safeguard-120b
qwen.qwen3-32b
mistral.ministral-3-8b-instruct
openai.gpt-oss-safeguard-20b
mistral.voxtral-mini-3b-2507
mistral.magistral-small-2509
nvidia.nemotron-nano-3-30b
mistral.ministral-3-3b-instruct
openai.gpt-oss-20b
zai.glm-4.6
google.gemma-3-4b-it
nvidia.nemotron-nano-12b-v2
mistral.ministral-3-14b-instruct
deepseek.v3.1
google.gemma-3-27b-it
openai.gpt-oss-120b
qwen.qwen3-coder-480b-a35b-instruct
nvidia.nemotron-nano-9b-v2
google.gemma-3-12b-it
moonshotai.kimi-k2-thinking
qwen.qwen3-next-80b-a3b-instruct
qwen.qwen3-coder-30b-a3b-instruct
minimax.minimax-m2
mistral.voxtral-small-24b-2507
qwen.qwen3-235b-a22b-2507
mistral.mistral-large-3-675b-instruct

AWS IAM

According to the documentation prerequisites, an Amazon Bedrock API key is required when using the OpenAI SDK.

Amazon Bedrock API key (required for OpenAI SDK)

In contrast, when using AWS IAM, HTTP requests are supported.

AWS credentials (supported for HTTP requests)

https://docs.aws.amazon.com/ja_jp/bedrock/latest/userguide/bedrock-mantle.html#bedrock-mantle-prereq

However, as mentioned in the following article, IAM authentication can also be used with the OpenAI SDK by including IAM authentication credentials in the http_client when creating the Client.

https://zenn.dev/clouddevcode/articles/c238ce16d390ec

Let's create an http_client and send a request.

import boto3
import httpx
from openai import OpenAI
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest

class AWSBedrockMantleAuth(httpx.Auth):
    def __init__(self, service: str, region: str, credentials):
        self.service = service
        self.region = region
        self.credentials = credentials

    def auth_flow(self, request: httpx.Request):
        # 1. Carefully select headers to be signed
        # Including all headers can cause signature errors when httpx modifies them during sending
        # Keep only essential ones with consistent case
        headers_to_sign = {
            'host': request.url.host,
            'x-amz-date': None, # SigV4Auth will add this later
        }

        # Extract headers
        aws_request = AWSRequest(
            method=request.method,
            url=str(request.url),
            data=request.content,
            headers=headers_to_sign
        )

        # Signature processing
        signer = SigV4Auth(self.credentials, self.service, self.region)
        signer.add_auth(aws_request)

        # Apply headers generated by the signature (Authorization, X-Amz-Date, X-Amz-Security-Token) to the original httpx request
        for key, value in aws_request.headers.items():
            request.headers[key] = value

        yield request

# --- Configuration ---
region = "us-west-2"
session = boto3.Session()
credentials = session.get_credentials().get_frozen_credentials()

client = OpenAI(
    api_key="dummy",
    http_client=httpx.Client(
        auth=AWSBedrockMantleAuth("bedrock-mantle", region, credentials)
    )
)

models = client.models.list()

for model in models.data:
    print(model.id)

This is also working well.

takakuni@ iam % uv run models.py
openai.gpt-oss-20b
google.gemma-3-27b-it
mistral.voxtral-mini-3b-2507
moonshotai.kimi-k2-thinking
qwen.qwen3-coder-30b-a3b-instruct
mistral.magistral-small-2509
google.gemma-3-4b-it
mistral.ministral-3-8b-instruct
mistral.mistral-large-3-675b-instruct
zai.glm-4.6
nvidia.nemotron-nano-9b-v2
qwen.qwen3-next-80b-a3b-instruct
qwen.qwen3-235b-a22b-2507
qwen.qwen3-coder-480b-a35b-instruct
openai.gpt-oss-120b
nvidia.nemotron-nano-12b-v2
mistral.ministral-3-3b-instruct
openai.gpt-oss-safeguard-20b
deepseek.v3.1
nvidia.nemotron-nano-3-30b
google.gemma-3-12b-it
openai.gpt-oss-safeguard-120b
minimax.minimax-m2
mistral.ministral-3-14b-instruct
qwen.qwen3-vl-235b-a22b-instruct
mistral.voxtral-small-24b-2507
qwen.qwen3-32b

Responses API

Let's use the Responses API for model inference.

# Create a basic response using the OpenAI SDK
# Requires OPENAI_API_KEY and OPENAI_BASE_URL environment variables

from openai import OpenAI

client = OpenAI()

response = client.responses.create(
    model="openai.gpt-oss-120b",
    input=[
        {"role": "user", "content": "Hello! How can you help me today?"}
    ]
)

# Extract text from message in response.output
messages = [
    item for item in getattr(response, "output", [])
    if getattr(item, "type", None) == "message"
]
texts = []
for msg in messages:
    for content in getattr(msg, "content", []) or []:
        text = getattr(content, "text", None)
        if text:
            texts.append(text)
text = "\n".join(texts) if texts else None

if text:
    print(text)
else:
    # Also print the entire response for verification
    print(response)

Although there are some differences in the output, it's running successfully.

Amazon Bedrock API key short-term API key

takakuni@ short-term % uv run responses.py
Hello! 👋 I'm here to help with almost anything you need. Some of the things I can do include:

- **Answering questions**from quick facts to deep‑dive explanations on science, history, tech, art, and more.
- **Writing & editing** – essays, blog posts, emails, stories, poems, jokes, resumes, cover letters, etc.
- **Brainstorming & planning** – ideas for projects, gifts, events, business strategies, study schedules, travel itineraries, and so on.
- **Learning & tutoring** – step‑by‑step help with math, programming, language learning, exam prep, or any subject you're curious about.
- **Coding assistance** – writing, debugging, or explaining code in many languages (Python, JavaScript, Java, C++, SQL,).
- **Data & analysis guidance** – tips on working with spreadsheets, statistics, visualizations, or interpreting results.
- **Creative fun** – role‑playing, world‑building, character creation, puzzles, riddles, or just a friendly chat.

Just let me know what you'd like to work on or learn about, and we'll dive right in! 🚀

Amazon Bedrock API key long-term API key

takakuni@ long-term % uv run responses.py
Hey there! 👋 I'm here to assist with a wide range of tasks, such as:

- **Answering questions** – from quick facts to deeper explanations on science, history, tech, and more.
- **Writing & editing** – blog posts, essays, reports, creative stories, emails, resumes, cover letters, social‑media copy, etc.
- **Problem‑solving** – math, programming, logic puzzles, data‑analysis guidance, troubleshooting tech issues.
- **Learning & tutoring** – breaking down concepts, creating study guides, designing practice problems, language practice.
- **Planning & organization** – itineraries, project outlines, meeting agendas, goal‑setting frameworks, habit trackers.
- **Brainstorming** – ideas for products, marketing campaigns, gifts, events, scripts, game mechanics, etc.
- **Research assistance** – finding reliable sources, summarizing articles, comparing options.
- **Conversational support** – practicing interview answers, role‑playing scenarios, offering motivation or a friendly chat.

…and pretty much anything else that can be expressed in text.

What's on your mind today? Let me know how I can help!

AWS IAM

import boto3
import httpx
from openai import OpenAI
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest

class AWSBedrockMantleAuth(httpx.Auth):
    def __init__(self, service: str, region: str, credentials):
        self.service = service
        self.region = region
        self.credentials = credentials

    def auth_flow(self, request: httpx.Request):
        # 1. Carefully select headers to be signed
        # We need to limit headers since httpx may modify them, causing signature errors
        # Only include essential headers with consistent capitalization
        headers_to_sign = {
            'host': request.url.host,
            'x-amz-date': None, # Will be added later by SigV4Auth
        }

        # Extract headers
        aws_request = AWSRequest(
            method=request.method,
            url=str(request.url),
            data=request.content,
            headers=headers_to_sign
        )

        # Signing process
        signer = SigV4Auth(self.credentials, self.service, self.region)
        signer.add_auth(aws_request)

        # Apply headers generated by signature (Authorization, X-Amz-Date, X-Amz-Security-Token) to the original httpx request
        for key, value in aws_request.headers.items():
            request.headers[key] = value

        yield request

# --- Configuration ---
region = "us-west-2"
session = boto3.Session()
credentials = session.get_credentials().get_frozen_credentials()

client = OpenAI(
    api_key="dummy",
    http_client=httpx.Client(
        auth=AWSBedrockMantleAuth("bedrock-mantle", region, credentials)
    )
)

response = client.responses.create(
    model="openai.gpt-oss-120b",
    input=[
        {"role": "user", "content": "Hello! How can you help me today?"}
    ]
)

# Extract message text from response.output
messages = [
    item for item in getattr(response, "output", [])
    if getattr(item, "type", None) == "message"
]
texts = []
for msg in messages:
    for content in getattr(msg, "content", []) or []:
        text = getattr(content, "text", None)
        if text:
            texts.append(text)
text = "\n".join(texts) if texts else None

if text:
    print(text)
else:
    # Print the entire response as a fallback for verification
    print(response)
takakuni@ iam % uv run responses.py
Hello! 👋 I'm here to help with almost anything you might need—whether that's answering a question, brainstorming ideas, polishing a piece of writing, tackling a bit of code, learning a new concept, planning a trip, drafting an email, solving a puzzle, or just having a friendly chat.

**A quick snapshot of what I can do:**

| Category | Examples of what I can help with |
|----------|-----------------------------------|
| **Information & Research** | Summarize articles, explain complex topics, fact‑check, provide up‑to‑date statistics (as of 2024‑06) |
| **Writing & Editing** | Draft essays, blog posts, letters, resumes, cover letters, poetry, scripts; improve style, grammar, tone, structure |
| **Creative Projects** | Brainstorm story ideas, characters, plot twists, world‑building, jokes, marketing copy, slogans |
| **Programming & Tech** | Explain algorithms, debug code snippets (Python, JavaScript, Java, C++, etc.), write small programs, suggest libraries, help with Git |
| **Learning & Tutoring** | Walk through math problems, science concepts, language practice, test‑prep tips |
| **Productivity & Planning** | Create to‑do lists, project plans, meeting agendas, time‑management strategies |
| **Personal & Lifestyle** | Meal planning, fitness routines, travel itineraries, gift ideas, hobby recommendations |
| **Conversation & Support** | Offer a listening ear, role‑play scenarios, practice interviews, discuss philosophy, explore hobbies |

Just let me know what you're working on or curious about, and we'll dive in together! 🌟

Chat Completions API

In fact, Chat Completions API can now also be executed through Mantle.

As mentioned earlier, previously we had to execute through the Amazon Bedrock Runtime endpoint as follows:

from openai import OpenAI

client = OpenAI(
    base_url="https://bedrock-runtime.us-west-2.amazonaws.com/openai/v1",
    api_key="$AWS_BEARER_TOKEN_BEDROCK" # Replace with actual API key
)

completion = client.chat.completions.create(
    model="openai.gpt-oss-20b:0",
    messages=[
        {
            "role": "developer",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "Hello!"
        }
    ]
)

print(completion.choices[0].message)

HTTP Method

Next, let's try using HTTP. I'll test with cURL. We add the API Key information to the Authorization header and make the request.

# Create a basic response
# Requires OPENAI_API_KEY and OPENAI_BASE_URL environment variables

curl -X POST $OPENAI_BASE_URL/responses \
   -H "Content-Type: application/json" \
   -H "Authorization: Bearer $OPENAI_API_KEY" \
   -d '{
    "model": "openai.gpt-oss-120b",
    "input": [
        {"role": "user", "content": "Hello! How can you help me today?"}
    ]
}'

Models API

# List all available models
# Requires OPENAI_API_KEY and OPENAI_BASE_URL environment variables

curl -X GET $OPENAI_BASE_URL/models \
   -H "Authorization: Bearer $OPENAI_API_KEY"

Amazon Bedrock API key - Short-term API key

takakuni@ short-term % curl -X GET $OPENAI_BASE_URL/models \
   -H "Authorization: Bearer $OPENAI_API_KEY"
{"data":[{"created":1764460800,"id":"qwen.qwen3-32b","object":"model","owned_by":"system"},{"created":1764460800,"id":"moonshotai.kimi-k2-thinking","object":"model","owned_by":"system"},{"created":1763923750,"id":"mistral.ministral-3-8b-instruct","object":"model","owned_by":"system"},{"created":1763769600,"id":"nvidia.nemotron-nano-12b-v2","object":"model","owned_by":"system"},{"created":1764460800,"id":"google.gemma-3-12b-it","object":"model","owned_by":"system"},{"created":1764460800,"id":"mistral.magistral-small-2509","object":"model","owned_by":"system"},{"created":1765065600,"id":"nvidia.nemotron-nano-3-30b","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-120b","object":"model","owned_by":"system"},{"created":1763923654,"id":"mistral.ministral-3-3b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-235b-a22b-2507","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-next-80b-a3b-instruct","object":"model","owned_by":"system"},{"created":1763769600,"id":"nvidia.nemotron-nano-9b-v2","object":"model","owned_by":"system"},{"created":1764460800,"id":"deepseek.v3.1","object":"model","owned_by":"system"},{"created":1763923896,"id":"mistral.mistral-large-3-675b-instruct","object":"model","owned_by":"system"},{"created":1763923865,"id":"mistral.ministral-3-14b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-safeguard-120b","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-coder-30b-a3b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"mistral.voxtral-mini-3b-2507","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-safeguard-20b","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-vl-235b-a22b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"google.gemma-3-27b-it","object":"model","owned_by":"system"},{"created":1764460800,"id":"mistral.voxtral-small-24b-2507","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-coder-480b-a35b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"minimax.minimax-m2","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-20b","object":"model","owned_by":"system"},{"created":1764460800,"id":"google.gemma-3-4b-it","object":"model","owned_by":"system"},{"created":1764460800,"id":"zai.glm-4.6","object":"model","owned_by":"system"}],"object":"list"}%

Amazon Bedrock API key - Long-term API key

takakuni@ long-term % curl -X GET $OPENAI_BASE_URL/models \
   -H "Authorization: Bearer $OPENAI_API_KEY"
{"data":[{"created":1763923654,"id":"mistral.ministral-3-3b-instruct","object":"model","owned_by":"system"},{"created":1763923750,"id":"mistral.ministral-3-8b-instruct","object":"model","owned_by":"system"},{"created":1763769600,"id":"nvidia.nemotron-nano-12b-v2","object":"model","owned_by":"system"},{"created":1765065600,"id":"nvidia.nemotron-nano-3-30b","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-120b","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-20b","object":"model","owned_by":"system"},{"created":1763923896,"id":"mistral.mistral-large-3-675b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"mistral.voxtral-small-24b-2507","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-next-80b-a3b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-235b-a22b-2507","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-safeguard-20b","object":"model","owned_by":"system"},{"created":1764460800,"id":"mistral.magistral-small-2509","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-coder-30b-a3b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"google.gemma-3-27b-it","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-safeguard-120b","object":"model","owned_by":"system"},{"created":1763769600,"id":"nvidia.nemotron-nano-9b-v2","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-vl-235b-a22b-instruct","object":"model","owned_by":"system"},{"created":1763923865,"id":"mistral.ministral-3-14b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"mistral.voxtral-mini-3b-2507","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-32b","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-coder-480b-a35b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"deepseek.v3.1","object":"model","owned_by":"system"},{"created":1764460800,"id":"minimax.minimax-m2","object":"model","owned_by":"system"},{"created":1764460800,"id":"google.gemma-3-12b-it","object":"model","owned_by":"system"},{"created":1764460800,"id":"moonshotai.kimi-k2-thinking","object":"model","owned_by":"system"},{"created":1764460800,"id":"zai.glm-4.6","object":"model","owned_by":"system"},{"created":1764460800,"id":"google.gemma-3-4b-it","object":"model","owned_by":"system"}],"object":"list"}%

AWS IAM

IAM requires a request with SigV4 signature, so we'll use awscurl to make it easier.

awscurl --service bedrock-mantle \
	--region us-west-2 \
	"https://bedrock-mantle.us-west-2.api.aws/v1/models"

https://dev.classmethod.jp/articles/introduce-awscurl/

This also outputs properly:

takakuni@ iam % awscurl --service bedrock-mantle \
        --region us-west-2 \
        "https://bedrock-mantle.us-west-2.api.aws/v1/models"
{"data":[{"created":1764460800,"id":"mistral.voxtral-small-24b-2507","object":"model","owned_by":"system"},{"created":1764460800,"id":"google.gemma-3-12b-it","object":"model","owned_by":"system"},{"created":1765065600,"id":"nvidia.nemotron-nano-3-30b","object":"model","owned_by":"system"},{"created":1763769600,"id":"nvidia.nemotron-nano-9b-v2","object":"model","owned_by":"system"},{"created":1764460800,"id":"zai.glm-4.6","object":"model","owned_by":"system"},{"created":1763923896,"id":"mistral.mistral-large-3-675b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-coder-30b-a3b-instruct","object":"model","owned_by":"system"},{"created":1763769600,"id":"nvidia.nemotron-nano-12b-v2","object":"model","owned_by":"system"},{"created":1764460800,"id":"mistral.magistral-small-2509","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-32b","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-safeguard-120b","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-120b","object":"model","owned_by":"system"},{"created":1763923654,"id":"mistral.ministral-3-3b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"moonshotai.kimi-k2-thinking","object":"model","owned_by":"system"},{"created":1764460800,"id":"mistral.voxtral-mini-3b-2507","object":"model","owned_by":"system"},{"created":1764460800,"id":"google.gemma-3-27b-it","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-safeguard-20b","object":"model","owned_by":"system"},{"created":1764460800,"id":"minimax.minimax-m2","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-235b-a22b-2507","object":"model","owned_by":"system"},{"created":1763923865,"id":"mistral.ministral-3-14b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-next-80b-a3b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-vl-235b-a22b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"deepseek.v3.1","object":"model","owned_by":"system"},{"created":1763923750,"id":"mistral.ministral-3-8b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"openai.gpt-oss-20b","object":"model","owned_by":"system"},{"created":1764460800,"id":"qwen.qwen3-coder-480b-a35b-instruct","object":"model","owned_by":"system"},{"created":1764460800,"id":"google.gemma-3-4b-it","object":"model","owned_by":"system"}],"object":"list"}

Responses API

There's not much difference, but let's also run the Responses API. The main difference is that the endpoint is /responses.

# Create a basic response
# Requires OPENAI_API_KEY and OPENAI_BASE_URL environment variables

curl -X POST $OPENAI_BASE_URL/responses \
   -H "Content-Type: application/json" \
   -H "Authorization: Bearer $OPENAI_API_KEY" \
   -d '{
    "model": "openai.gpt-oss-120b",
    "input": [
        {"role": "user", "content": "Hello! How can you help me today?"}
    ]
}'

Amazon Bedrock API key - Short-term API key

takakuni@ short-term % curl -X POST $OPENAI_BASE_URL/responses \
   -H "Content-Type: application/json" \
   -H "Authorization: Bearer $OPENAI_API_KEY" \
   -d '{
    "model": "openai.gpt-oss-120b",
    "input": [
        {"role": "user", "content": "Hello! How can you help me today?"}
    ]
}'
{"background":false,"created_at":1766909534.0,"error":null,"id":"resp_JXQHGDL3F37PJMKIZRMNRZK6GGOUMONYLMD36E5ENUQMFQNLB77Q","incomplete_details":null,"instructions":null,"metadata":{},"model":"openai.gpt-oss-120b","object":"response","output":[{"content":[{"text":"The user asks \"Hello! How can you help me today?\" This is a casual greeting and question. We should respond friendly, explain capabilities. Follow policies: don't mention policies. Provide a brief overview of what we can do: answering questions, summarizing, tutoring, creative writing, etc. Ask if they have a specific request.","type":"reasoning_text"}],"id":"msg_8015ade90331c021","status":"completed","summary":[],"type":"reasoning"},{"content":[{"annotations":[],"text":"Hey there! 👋 I'm here to help with a wide range of things, such as:\n\n- **Answering questions** – factual info, explanations, or advice on everyday topics.  \n- **Research & summarizing** – pulling together and condensing information from multiple sources.  \n- **Writing & editing** – essays, reports, emails, stories, poems, code snippets, you name it.  \n- **Learning & tutoring** – walking through concepts, solving problems, or providing study tips.  \n- **Creative brainstorming** – ideas for projects, recipes, travel plans, marketing copy, etc.  \n- **Technical support** – debugging code, explaining algorithms, helping with software tools.\n\nAnything specific on your mind today? Let me know how I can assist you!","type":"output_text"}],"id":"msg_b02edcdf73954830","role":"assistant","status":"completed","type":"message"}],"parallel_tool_calls":true,"service_tier":"default","status":"completed","temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled"}%

Amazon Bedrock API key - Long-term API key

takakuni@ long-term % curl -X POST $OPENAI_BASE_URL/responses \
   -H "Content-Type: application/json" \
   -H "Authorization: Bearer $OPENAI_API_KEY" \
   -d '{
    "model": "openai.gpt-oss-120b",
    "input": [
        {"role": "user", "content": "Hello! How can you help me today?"}
    ]
}'
{"background":false,"created_at":1766909552.0,"error":null,"id":"resp_IYXJEOQGDA3TFZOYC6PXJY3HYZ4MGRTYPU5CRCJQXT35GIADROYA","incomplete_details":null,"instructions":null,"metadata":{},"model":"openai.gpt-oss-120b","object":"response","output":[{"content":[{"text":"User greeted and asked \"How can you help me today?\" We need to respond as AI assistant. It's general greeting and question. Should introduce capabilities and ask follow-up. Keep friendly tone.","type":"reasoning_text"}],"id":"msg_8f283b5d077e772f","status":"completed","summary":[],"type":"reasoning"},{"content":[{"annotations":[],"text":"Hey there! 👋\n\nI'm here to help with a wide range of things, including:\n\n- **Answering questions** – facts, explanations, how‑tos, or deep‑dive research on almost any topic.  \n- **Writing & editing** – essays, reports, blog posts, creative stories, emails, cover letters, social‑media copy, scripts, poetry, you name it.  \n- **Learning & tutoring** – break down complex concepts, walk through problems step‑by‑step, generate practice questions, or create study guides.  \n- **Planning & organizing** – itineraries, project outlines, to‑do lists, meal plans, budgeting spreadsheets, event schedules, etc.  \n- **Technical assistance** – code snippets, debugging help, algorithm explanations, data‑analysis ideas, workflow automation, and more.  \n- **Creative brainstorming** – product names, marketing slogans, game mechanics, plot twists, character backstories, design concepts.  \n- **Personal guidance** – productivity tips, habit‑building strategies, career advice, interview prep, communication skills, etc.  \n\nIf you have something specific in mind—or just want to explore ideas—let me know and we'll dive in together! 🚀","type":"output_text"}],"id":"msg_a24ec82c3c372942","role":"assistant","status":"completed","type":"message"}],"parallel_tool_calls":true,"service_tier":"default","status":"completed","temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled"}%

IAM

awscurl --service bedrock-mantle \
	--region us-west-2 \
	-X POST \
	-H "Content-Type: application/json" \
	-d '{
		"model": "openai.gpt-oss-120b",
		"input": [
			{
				"role": "user",
				"content": "Hello! How can you help me today?"
			}
		]
	}' \
	"https://bedrock-mantle.us-west-2.api.aws/v1/responses"
takakuni@ iam % awscurl --service bedrock-mantle \
        --region us-west-2 \
        -X POST \
        -H "Content-Type: application/json" \
        -d '{
          "model": "openai.gpt-oss-120b",
          "input": [
            {
              "role": "user",
              "content": "Hello! How can you help me today?"
            }
          ]
        }' \
        "https://bedrock-mantle.us-west-2.api.aws/v1/responses"
{"background":false,"created_at":1766909761.0,"error":null,"id":"resp_7IKB4GCGBKJGINLHOLPIP2M2IL2IQYMRP2SMIN6K5PMCVDS37UTQ","incomplete_details":null,"instructions":null,"metadata":{},"model":"openai.gpt-oss-120b","object":"response","output":[{"content":[{"text":"The user says \"Hello! How can you help me today?\" It's a general greeting. We need to respond with a friendly greeting and explain capabilities. Use the style guidelines. Probably ask how can assist. Provide short overview.","type":"reasoning_text"}],"id":"msg_aa80debcdef3f7c3","status":"completed","summary":[],"type":"reasoning"},{"content":[{"annotations":[],"text":"Hi there! 👋  \n\nI'm here to help with a wide range of tasks, such as:\n\n* **Answering questions** – facts, explanations, troubleshooting, or quick look‑ups.  \n* **Writing & editing** – drafts, emails, essays, reports, creative pieces, or polishing existing text.  \n* **Learning & tutoring** – breaking down concepts, generating practice problems, or guiding you through step‑by‑step solutions.  \n* **Planning & organization** – to‑do lists, schedules, project outlines, travel itineraries, recipes, etc.  \n* **Coding assistance** – explaining code, debugging, writing snippets, or teaching programming concepts.  \n* **Fun & brainstorming** – ideas for stories, games, gifts, hobbies, or just a friendly chat.\n\nWhat would you like to work on or discuss today?","type":"output_text"}],"id":"msg_8c819d9e7b34b057","role":"assistant","status":"completed","type":"message"}],"parallel_tool_calls":true,"service_tier":"default","status":"completed","temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled"}

Summary

That's it for "Amazon Bedrock now supports OpenAI's Responses API."

Project Mantle is very intriguing.

I wonder if Bedrock will continue to support native SDKs provided by LLM providers like this in the future.

Looking forward to it. This was Takakuni (@takakuni_) from the Cloud Business Division Consulting Department!

Share this article

FacebookHatena blogX

Related articles