Skip to main content
AWS Bedrock AgentCore Runtime is a serverless hosting environment for deploying agents built with any framework (Strands, LangGraph, CrewAI) at production scale, without managing infrastructure. Connect the AI Gateway from inside AgentCore to access 300+ models across 20+ providers with automatic fallbacks, cost tracking, and full observability.

AI Gateway

Connect the AI Gateway to an AgentCore entrypoint to access 300+ LLMs across 20+ providers, with automatic fallbacks, cost tracking, and observability.

OpenAI Agents SDK

Install:
pip install openai-agents openai bedrock-agentcore
Configure an AsyncOpenAI client with the AI Gateway base URL, then wrap the agent in a BedrockAgentCoreApp entrypoint:
import os
from openai import AsyncOpenAI
from agents import Agent, Runner, set_default_openai_client, set_tracing_disabled
from bedrock_agentcore.runtime import BedrockAgentCoreApp

client = AsyncOpenAI(
    api_key=os.getenv("ORQ_API_KEY"),
    base_url="https://api.orq.ai/v3/router"
)
set_tracing_disabled(True)
set_default_openai_client(client)

agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant.",
    model="openai/gpt-4o"
)

app = BedrockAgentCoreApp()

@app.entrypoint
async def agent_invocation(payload, context):
    query = payload.get("prompt", "How can I help you?")
    result = await Runner.run(agent, query)
    return {"result": result.final_output}

app.run()

Strands Agents

Install:
pip install strands-agents bedrock-agentcore
Use OpenAIModel with the AI Gateway base URL inside a Strands agent:
import os
from strands import Agent
from strands.models.openai import OpenAIModel
from bedrock_agentcore.runtime import BedrockAgentCoreApp

model = OpenAIModel(
    model_id="openai/gpt-4o",
    client_args={
        "api_key": os.getenv("ORQ_API_KEY"),
        "base_url": "https://api.orq.ai/v3/router"
    }
)

agent = Agent(
    model=model,
    system_prompt="You are a helpful assistant."
)

app = BedrockAgentCoreApp()

@app.entrypoint
def agent_invocation(payload, context):
    result = agent(payload.get("prompt", "How can I help?"))
    return {"result": str(result)}

app.run()

Orq Agents

Invoke any Orq.ai Agent by key using model="agent/YOUR_AGENT_KEY" with the OpenAI Responses API. The AI Gateway executes the configured agent including its system prompt, tools, evaluators, and model settings.
Find the agent key on the Agents page in Orq.ai.
import os
from openai import AsyncOpenAI
from bedrock_agentcore.runtime import BedrockAgentCoreApp

client = AsyncOpenAI(
    api_key=os.getenv("ORQ_API_KEY"),
    base_url="https://api.orq.ai/v3/router"
)

app = BedrockAgentCoreApp()

@app.entrypoint
async def agent_invocation(payload, context):
    query = payload.get("prompt", "How can I help you?")
    response = await client.responses.create(
        model="agent/YOUR_AGENT_KEY",
        input=query
    )
    return {"result": response.output_text}

app.run()