Managed Agents API Comparison 2026: DashScope vs Gemini vs OpenAI Agent Orchestration
Three major platforms now offer managed agent orchestration APIs. We compared DashScope Application API, Gemini Managed Agents, and OpenAI Agents SDK on architecture, tool support, MCP integration, background execution, pricing, and developer experience — with code samples and a decision matrix.
Three platforms, three philosophies for building managed agent systems. DashScope (Alibaba Cloud Bailian) offers a console-first application orchestration API, Google ships Gemini Managed Agents with background execution and remote MCP, and OpenAI provides a code-first Agents SDK with hosted sandboxes. We dug into all three to see where they actually differ — and where routing across them gives you the flexibility to pick the right tool for each job.
OpenAI-compatible means a provider exposes a chat-completions endpoint whose request and response shape matches the OpenAI API contract closely enough that an unmodified OpenAI SDK call works against it after swapping three values: API key, base URL, and model name. The minimum surface in practice is POST /v1/chat/completions with messages, model, and an OpenAI-shaped streaming response.
Sources: DashScope Application Calling Guide (Alibaba Cloud), retrieved 2026-07-24; Gemini Managed Agents Docs (Google AI), retrieved 2026-07-24; OpenAI Agents SDK Guide, retrieved 2026-07-24; Gemini Interactions API Overview, retrieved 2026-07-24; Alibaba Cloud Agent Infra Blog, retrieved 2026-07-24; Google Managed Agents Background Execution (The Decoder), retrieved 2026-07-24.
TL;DR — DashScope vs Gemini Managed Agents vs OpenAI Agents SDK
| Dimension | DashScope Application API | Gemini Managed Agents | OpenAI Agents SDK |
|---|---|---|---|
| Provider | Alibaba Cloud (Bailian) | Google (Gemini API) | OpenAI |
| Architecture | Console-built apps exposed via API | Hosted runtime on Interactions API | Code-first SDK — you own the loop |
| Agent definition | Console UI (agent, workflow, orchestration) | API-defined agent + environment | Code-defined agent classes |
| Language support | Python, Java, PHP, Node.js, C#, cURL | Python, JavaScript, cURL | Python, TypeScript |
| Multi-agent model | Agent orchestration (console-configured routing) | Coordinator + delegate, custom agents extending Antigravity | Handoffs + agents-as-tools |
| Background execution | No (synchronous request-response) | Yes (async, no open HTTP connection) | No native background (BYO async) |
| MCP support | Via Bailian plugin ecosystem | Remote MCP servers (native) | Local MCP connections + remote MCP |
| Built-in tools | RAG, plugins, web search, code interpreter | Bash, file ops, web search, sandbox | File search, code interpreter, web search |
| Sandbox | Cloud-hosted (Bailian managed) | Managed Linux sandbox with credential refresh | OpenAI Sandbox (container-based) or BYO |
| Pricing model | Model tokens only (no runtime fee) | Model tokens only (no separate runtime fee) | SDK is free (MIT); sandbox from $0.03/hr |
| Open source | No (proprietary platform) | No (proprietary runtime) | Yes (MIT license) |
| Best for | China-region apps, Qwen-native workflows | Long-running autonomous tasks, Google ecosystem | Custom orchestration, tight product integration |
Key distinction: DashScope is a platform-first approach — you build agents in a console and expose them as API endpoints. Gemini Managed Agents is a hosted runtime — you define agents via API and Google runs them with a full sandbox. OpenAI's Agents SDK is a library — you embed it in your code and own the orchestration loop.
Architecture: Console-First vs Hosted Runtime vs Code-First
DashScope — Build in Console, Call via API
DashScope's agent approach centers on Alibaba Cloud's Bailian (百炼) platform. You create agent applications, workflow applications, or agent orchestration applications through a visual console, then expose them via the DashScope SDK or HTTP API using an APP_ID.
import os
from dashscope import Application
response = Application.call(
api_key=os.getenv("DASHSCOPE_API_KEY"),
app_id="YOUR_APP_ID",
prompt="Analyze the quarterly sales data and generate a summary report."
)
print(response.output.text)
The API surface is deliberately simple: one Application.call() endpoint handles single-round conversations, multi-turn sessions (via session_id), streaming, and file uploads. The orchestration complexity lives in the console — you wire up RAG knowledge bases, plugins, and multi-agent routing through a visual builder, and the API just triggers it.
For multi-agent scenarios, Alibaba Cloud's AgentTeams platform (announced at the 2026 Summit) adds cross-framework orchestration using the Matrix protocol, letting you mix agents built with different frameworks in a Leader-Worker collaboration model.
Gemini Managed Agents — Google Runs the Loop
Gemini Managed Agents, built on the Interactions API (GA since June 2026), provides a fully hosted agent runtime. You define a custom agent that extends Google's Antigravity agent with your own instructions, skills, and data. Google manages the agent loop, sandbox lifecycle, and tool execution.
from google import genai
client = genai.Client()
agent = client.agents.create(
display_name="Code Reviewer",
model="gemini-3.5-flash",
instruction="Review code for security vulnerabilities.",
tools=[{"code_execution": {}}],
)
session = client.agents.sessions.create(agent_id=agent.id)
response = client.agents.sessions.send_message(
session_id=session.id,
message="Review auth.py for SQL injection risks."
)
print(response.text)
The standout features shipped in July 2026:
- Background execution — agents run asynchronously with no open HTTP connection required. You poll for results or receive webhooks.
- Remote MCP servers — connect agents directly to internal databases and APIs via the Model Context Protocol.
- Custom functions — use your own functions alongside built-in sandbox tools.
- Credential refresh — tokens refresh between interactions without losing sandbox state.
OpenAI Agents SDK — You Own the Runtime
The OpenAI Agents SDK is an open-source (MIT) Python/TypeScript library. You define agent classes with instructions, tools, and handoff rules, then the SDK's Runner executes the agent loop locally:
from agents import Agent, Runner
agent = Agent(
name="Code Reviewer",
instructions="Review code for security vulnerabilities and suggest fixes.",
tools=[code_interpreter],
)
result = Runner.run_sync(agent, "Review auth.py for SQL injection risks.")
print(result.final_output)
The key trade-off: more control over orchestration, state management, and tool execution, but you manage the infrastructure. OpenAI's hosted tools (file search, code interpreter, web search) and OpenAI Sandbox (container-based, from $0.03/hr for 1 GB) provide optional managed components.
For multi-agent workflows, the SDK supports handoffs (delegated ownership transfer) and agents-as-tools (manager calls specialist, retains control) — two patterns that cover most orchestration needs without a coordination protocol.
Tool Support and MCP Integration
Tool ecosystems differ significantly across the three platforms:
| Capability | DashScope | Gemini | OpenAI |
|---|---|---|---|
| Function calling | Yes (via app plugins) | Yes (custom functions) | Yes (native) |
| Code execution | Console-configured | Built-in sandbox | Code Interpreter tool |
| Web search | Plugin-based | Built-in | Platform tool |
| File operations | RAG knowledge base | Built-in sandbox file ops | File Search tool |
| Remote MCP | Via Bailian plugin bridge | Native (July 2026) | SDK MCP connections |
| Custom tools | Console plugin builder | Custom functions API | Function definitions |
Gemini's native remote MCP support is the most seamless: you register MCP servers when creating the agent, and the runtime handles discovery, invocation, and credential management. OpenAI's SDK connects to MCP servers locally. DashScope routes tool access through Bailian's plugin ecosystem, which requires console configuration but supports a rich set of Alibaba Cloud integrations (OSS, RDS, Function Compute).
Background Execution and Long-Running Tasks
This is where the architectures diverge most sharply:
- Gemini Managed Agents — full background execution. Start an agent task, disconnect, poll or receive webhooks when done. Designed for tasks that take minutes or hours (data analysis, multi-step research, code generation with iterative testing).
- DashScope — synchronous request-response with streaming. Long-running tasks require the client to maintain a connection. For truly async workflows, you wrap the API call in your own job queue.
- OpenAI Agents SDK — the SDK runs the loop locally, so background execution is whatever your infrastructure provides. The SDK itself doesn't manage async job queues, but you can wrap
Runner.run()in your own task runner.
If your workloads involve agents that need to run for extended periods — researching, writing, iterating — Gemini's background execution is the most mature hosted solution.
Pricing: What You Actually Pay
| Component | DashScope | Gemini | OpenAI |
|---|---|---|---|
| Agent runtime fee | None | None | None (SDK is free) |
| Model tokens | Per-model pricing (e.g., Qwen3.7-Max: ¥2/¥6 per 1M tokens) | Per-model pricing (e.g., Gemini 3.5 Flash: $1.50/$9 per 1M) | Per-model pricing (e.g., GPT-4o: $2.50/$10 per 1M) |
| Sandbox/compute | Included in Bailian | Included in Interactions API | From $0.03/hr (1 GB container) |
| Tool calls | Token cost of tool input/output | Token cost of tool input/output | Token cost + platform tool fees |
| Background execution | N/A | Included (no extra charge) | N/A (BYO) |
DashScope and Gemini both bundle runtime and sandbox costs into model token pricing — you pay for tokens, not for compute time. OpenAI's approach splits the cost: the SDK is free (MIT license), but hosted sandboxes and platform tools have separate pricing.
For China-region workloads, DashScope's Qwen model pricing is significantly lower than international alternatives — Qwen3.7-Max at ¥2/¥6 per million tokens (approximately $0.28/$0.83 at current exchange rates) compared to GPT-4o at $2.50/$10.
Code Snippets: Creating an Agent on Each Platform
DashScope — Console + API
# Step 1: Create an agent app in Bailian console (UI-based)
# Step 2: Get APP_ID from the application management page
# Step 3: Call via API
curl -X POST https://dashscope-intl.aliyuncs.com/api/v1/apps/YOUR_APP_ID/completion \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": {
"prompt": "Analyze the quarterly sales data and generate a summary report."
},
"parameters": {}
}'
Gemini — Full API-Defined Agent
from google import genai
client = genai.Client()
# Create a custom agent with remote MCP server
agent = client.agents.create(
display_name="Data Analyst",
model="gemini-3.5-flash",
instruction="Analyze data and produce structured reports.",
tools=[
{"code_execution": {}},
{"mcp_servers": [{"uri": "https://your-mcp-server.example.com"}]},
],
)
# Start a background execution session
session = client.agents.sessions.create(
agent_id=agent.id,
execution_mode="background",
)
# Send task — agent runs asynchronously
task = client.agents.sessions.send_message(
session_id=session.id,
message="Pull Q2 revenue data from the connected database and produce a trend report.",
)
# Poll for completion
result = client.agents.sessions.get(session_id=session.id)
OpenAI — Code-First SDK
from agents import Agent, Runner, function_tool
@function_tool
def query_database(sql: str) -> str:
"""Execute a SQL query against the analytics database."""
# Your database connection logic here
return execute_query(sql)
analyst = Agent(
name="Data Analyst",
instructions="Analyze data and produce structured reports.",
tools=[query_database],
)
result = Runner.run_sync(
analyst,
"Pull Q2 revenue data and produce a trend report.",
)
print(result.final_output)
Interoperability: What's Portable and What's Locked In
A critical question for teams evaluating these platforms: can you switch later?
| Dimension | DashScope | Gemini | OpenAI |
|---|---|---|---|
| Agent definitions | Console-locked (no export format) | API-defined (JSON) | Code-defined (portable) |
| Model portability | Qwen models only (DashScope-hosted) | Gemini models only | Any OpenAI model; SDK supports custom providers |
| Tool definitions | Bailian plugin format | Gemini function declarations + MCP | OpenAI function schema + MCP |
| State/session | Server-managed session_id | Server-managed sessions | Client-managed or SDK sessions |
| OpenAI SDK compatible | DashScope supports OpenAI-compatible /v1/chat/completions for models, but not for agent apps | No | Native |
OpenAI's Agents SDK is the most portable: it's open source (MIT), supports custom model providers, and your agent definitions live in your codebase. Gemini agent definitions are API objects that can be version-controlled but are tied to Google's runtime. DashScope's agent logic lives in the Bailian console — you can call it from anywhere, but the orchestration itself isn't exportable.
For teams that want to avoid lock-in, a routing layer like TheRouter lets you route the underlying model calls across providers while keeping agent orchestration in your own code or the SDK of your choice. The agent sub-calls — the model invocations inside the orchestration loop — can be routed through a unified endpoint with automatic fallback across providers.
Decision Matrix: Pick the Right Platform
| If you need… | Pick |
|---|---|
| China-region compliance + Qwen-native | DashScope — Bailian runs in China regions, Qwen models have the best Chinese language performance |
| Long-running background tasks with no infra | Gemini — background execution is the most mature hosted solution |
| Remote MCP server integration | Gemini — native support shipped July 2026 |
| Visual agent builder for non-developers | DashScope — Bailian console is the most accessible |
| Maximum control over orchestration | OpenAI Agents SDK — open-source, code-first, you own everything |
| Multi-provider model routing inside agents | OpenAI Agents SDK — supports custom providers; combine with a routing gateway |
| Enterprise multi-agent governance | DashScope — AgentTeams platform provides cross-framework governance |
| Cost-optimized high-volume workloads | DashScope — Qwen model pricing is 3–10x lower than Western alternatives |
| Google Cloud ecosystem integration | Gemini — native integration with Google Cloud services |
TheRouter Integration: Routing Agent Sub-Calls
Regardless of which orchestration platform you choose, the model calls inside your agents can be routed through TheRouter's OpenAI-compatible endpoint. This gives you:
- Provider fallback — if one provider is down, agent sub-calls automatically route to an alternative
- Cost optimization — route different agent tasks to different price tiers based on complexity
- Unified billing — track token spend across providers through a single dashboard
For OpenAI Agents SDK users, this is straightforward — the SDK supports custom model providers. For DashScope and Gemini, the managed runtimes handle model selection internally, but you can use TheRouter as a proxy for any external tool calls or secondary model invocations that your agent makes.
Conclusion
The managed agents landscape in 2026 reflects three distinct platform philosophies:
- DashScope bets on accessibility and the Chinese AI ecosystem — build agents visually, pay only for tokens, and leverage Qwen's cost advantage.
- Gemini bets on hosted infrastructure — let Google run everything, including background execution, MCP integration, and sandbox management.
- OpenAI bets on developer control — open-source the SDK, let you own the loop, and charge for hosted compute when you want it.
There is no single best choice. The right answer depends on your region, your infrastructure preferences, and whether you'd rather configure agents in a console or define them in code.