OpenAI Agents API Compatible Platform: Hosted Path vs OpenAI and Self-Hosted Sandboxes

An OpenAI Agents API compatible platform choice: OpenAI-hosted sandboxes, a self-hosted executor, or SandBase hosted Sessions on one API key.

OpenAI Agents API Hosted Path: vs OpenAI-hosted / self-hosted

If you are building with the OpenAI Agents API, the sandbox choice is not the first fork. OpenAI’s docs split the product into a managed Codex harness and an optional environment. You can leave the environment as none, let OpenAI host the sandbox, or run codex exec-server on compute you control. A third path is an OpenAI Agents API compatible platform: the official SDK, a different base_url, and a host that runs the Session. SandBase documents that path. It is not an OpenAI-compatible chat gateway, and it rejects self_hosted.

Key takeaway

  • Agents API compatibility means Agents, Sessions, events, items, turns, and Skills. A chat base_url swap is a different product.
  • On OpenAI, none, openai_hosted, and self_hosted choose the shell. OpenAI still runs the harness. Self-hosted does not make the API Zero Data Retention eligible.
  • Vercel, CoreWeave, E2B, and the other names on OpenAI’s provider list attach a sandbox to that harness. You still own the executor.
  • SandBase hosts the Session. Pass environment={"type":"openai_hosted"} because the SDK requires the field. self_hosted returns 400. This article did not run the snippet.

Agents API is not a chat gateway

OpenAI’s Agents guide separates three runtimes. The Agents API is for long-running tasks where OpenAI manages the agent. The Agents SDK runs the loop inside your app. The Responses API is direct model calls. People searching “OpenAI-compatible” usually want the third shape: Chat Completions or Responses with another provider’s models.

An OpenAI Agents API compatible platform implements the Agents resources so client.beta.agents and Sessions work after you change base_url and the key. SandBase’s compatibility doc states that scope: Agents, Sessions, events, items, turns, and Skills. MCP connections and Secrets are SandBase HTTP resources, not SDK methods.

If you only need model calls and data APIs, you do not need this protocol. That buyer path is One-Key Agent Stack. If you only need a code sandbox for the E2B SDK, that path is Free E2B Alternative for AI Agents.

What OpenAI’s environment setting chooses

OpenAI’s architecture page, retrieved 2026-11-07, is blunt: OpenAI runs the agent harness. Your application sends work and receives results. The environment is optional compute for files and commands.

environment.typeWho runs the harnessWho runs shell and filesWhat your app still owns
noneOpenAINobody. No executor, no built-in shellInput, tools you implement, the event stream
openai_hostedOpenAIOpenAI creates and manages the sandboxTasks, events, any function tools
self_hostedOpenAIYou, via codex exec-serverProvision, reconnect, shutdown, files, the environment key

The overview prices this as model API rates, standard built-in tool rates, and container rates for OpenAI-hosted sandboxes. It also says the Agents API supports data residency only in the United States and does not support Zero Data Retention. A self-hosted sandbox does not make the API ZDR-eligible. SandBase’s compatibility page does not offer a ZDR mode either. Do not shop for ZDR here.

Self-hosted still means OpenAI runs the harness

The self-hosted guide says the executor runs shell commands, reads and writes files, and uses local MCP servers at the harness’s request. Connections are outbound: https://api.openai.com to register, and a WebSocket to wss://codex-cloud-environments.chatgpt.com for commands. The application uses OPENAI_API_KEY. A separate environment key goes into the sandbox as CODEX_API_KEY. The executor cannot authorize other API calls, but agent-written code can read that key.

Your app opens the event stream, starts codex exec-server with the session’s remote_url and environment id, and sends input only after the environment connects. Webhooks are the other way to manage startup and shutdown. The longer boundary of that split, including what your application still controls, is OpenAI Agents API: What a Self-Hosted Sandbox Does—and Does Not—Control. This page does not repeat that teardown.

What the sandbox-vendor guides optimize for

OpenAI’s self-hosted page lists providers that can run that executor, including Vercel, CoreWeave, E2B, Daytona, Modal, and Cloudflare. Vercel’s guide and CoreWeave’s guide are that pattern: their sandbox, OpenAI’s harness. They are the right docs when the requirement is “keep OpenAI’s Codex loop, put the shell on our compute.” They are not a hosted Agents API on a non-OpenAI key.

SandBase’s hosted compatible path

SandBase Agents says the product is OpenAI Agents API compatible for Agents and Sessions. SandBase hosts the runtime. You pick a catalog model and tools, then start a hosted Session. The page says SandBase Agents runs on OpenAgentCore, MiniMax’s MIT-licensed implementation of the protocol, and that a Session can run a Codex, Claude Code, or MiniMax Code harness in a hosted sandbox. That is a SandBase product statement. It is not a claim that you receive OpenAI’s cloud account or OpenAI’s container.

SandBase Agents page with an OpenAI SDK panel SandBase /agents — hosted personal AI agent / Session story with OpenAI SDK panel.

The compatibility doc is the contract. Point the official SDK at https://api.sandbase.ai/v1 with a SandBase API key. Direct HTTP may omit environment. The SDK may not. Python raises TypeError without it. Pass {"type":"openai_hosted"}. SandBase accepts that value and runs every Session in its hosted cloud. Any other value, including self_hosted, returns 400 with only openai_hosted environment is supported. You do not read the returned environment object to place a machine.

You do not run codex exec-server, you do not create an OpenAI environment key, and you do not stand up a webhook provisioner for the Session. MCP is not the inline OpenAI tool form. That form returns 400. Register a connection with POST /v1/mcp-connections and reference mcp_connections on the Agent. Secrets are SandBase records, not OpenAI vaults. Vault calls 404.

The model id in the compatibility example is DeepSeek V4 Flash. The agents page also shows anthropic/claude-sonnet-5.5 as a configuration example. Use a model the selected runtime supports. A Session keeps its model for its life. Build Agent is the console path: define, test in a Session, then call from code. Sessions is the stream and history reference. Open the live stream before you send input. events.create returns 202 and carries exactly one event.

This client setup is the documented pattern. This article did not execute it.

Python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["SANDBASE_API_KEY"],
    base_url="https://api.sandbase.ai/v1",
)

agent = client.beta.agents.create(
    model="deepseek/deepseek-v4-flash",
    name="Research assistant",
    instructions="Keep output brief.",
)
session = client.beta.agents.sessions.create(
    agent_id=agent.id,
    environment={"type": "openai_hosted"},
)
print(agent.id, session.id)

Verified SDK versions on that page: openai-python 3.13.0 and 3.24.0, openai-node 7.28.0. On Node 26, force HTTP/1.1. A shared HTTP/2 connection can stall a post while the event stream is open. The SDK sends OpenAI-Beta: agents=v1. SandBase accepts that value or no header. Any other value is 400.

If the job is only “run this shell command,” use the sandbox and the E2B SDK. That is a code sandbox, not an Agents Session.

Which path for which team

NeedOpenAI end to endOpenAI harness + your sandboxSandBase hosted path
Who operates the loopOpenAIOpenAISandBase, on OpenAgentCore
Where the shell runsOpenAI, if you set openai_hostedYour executorSandBase hosted cloud only
Private network or custom imageOpenAI-hosted limits, or self-hostedThe point of self_hostedNot offered. self_hosted is 400
US-only residency / no ZDRStated on the Agents API overviewSame API, so same limitNot a ZDR product. Confirm SandBase’s own retention separately
Catalog models plus data APIs on one keyOpenAI models and OpenAI toolsStill an OpenAI key for the harnessSandBase key, catalog models, SandBase MCP
Ops you must runTasks and eventsEnvironment key, codex exec-server, reconnect, cleanupAgent definition, Session input, stream
BillModel + tools + hosted container ratesOpenAI usage plus the sandbox vendorOne SandBase balance. Catalog prices. Sandbox lifecycle is a separate product

What SandBase returns 400 for

The compatibility page’s “Not supported” table, retrieved 2026-11-07, is the list to read before production. These are the calls that matter for the path choice:

SandBase compatibility doc, Not supported table SandBase OpenAI Agents API compatibility doc — Not supported includes self_hosted → 400 (only openai_hosted is supported).

  • environment self_hosted: 400, only openai_hosted environment is supported.
  • agents.create with multi_agent.enabled: 400, multi_agent is not supported.
  • Inline MCP tools, tool_search, programmatic_tool_calling, and computer_use: 400. Only function and one web_search tool are accepted on create.
  • events.create with a tool_result or a computer-use approval: 400. Sessions that reach requires_action are not supported.
  • More than one event per request: 400.
  • vault_ids: 400. beta.agents.vaults: 404, plain text, not the JSON error envelope.
  • sessions.traces, sessions.subagents, environments.templates: 404.
  • skills.versions.delete: 404. A Skill at the root of the zip, instead of inside one top-level folder, is 400.

Last-Event-ID or ?after= on the live stream is 400. The stream does not replay. Failures are on session.failure, not session.error. Image input events are called out as unsupported on the agents page FAQ. None of this is a full OpenAI feature surface with a different logo.

How the bill is shaped

OpenAI’s overview bills model usage at the selected model’s API rates, tools at standard built-in rates, and OpenAI-hosted sandboxes at container rates. This article does not copy those rate cards. A self-hosted provider adds its own compute bill on top of OpenAI usage.

SandBase’s agents page says Agent token use and tool calls come off one balance at catalog prices, and that each Session and charge shows in Activities. The sandbox FAQ is a different meter: creating, running, and stopping E2B-compatible sandboxes is free for now, fair-use caps may apply, and pricing will be announced before a change. Models and APIs are billed as usual. The pricing page is where Build is pay per call with no subscription, and where failed model or API calls are not charged. Do not treat “sandboxes free for now” as “Agent Sessions are a published $0 runtime.” The agents page prices Sessions as model tokens and tool calls.

SandBase pricing page, included-on-every-plan strip SandBase pricing — models, APIs and runtimes on one balance; Included strip shows $0 sandboxes (free for now).

FAQ

What is an OpenAI Agents API compatible platform?

A host that implements Agents, Sessions, events, items, turns, and Skills so the official OpenAI SDK works with a different base URL and key. On SandBase that URL is https://api.sandbase.ai/v1. That is not a chat-completions gateway.

OpenAI-hosted sandbox, self-hosted sandbox, or SandBase?

OpenAI-hosted when OpenAI should provision the Linux workspace and you accept that API’s billing and US-only residency. Self-hosted when the shell must sit on compute you control and you will run codex exec-server. SandBase when you want the SDK’s Agents and Sessions on one SandBase key, with catalog models and SandBase tools, and you do not need self_hosted.

Can the OpenAI SDK create SandBase Sessions?

Yes, on the supported surface. The SDK requires environment. Pass {"type":"openai_hosted"}. self_hosted returns 400. Check the compatibility doc for the verified SDK versions before production. The snippet above was not run for this article.

Key takeaway

Pick the path by who must run the harness and who must run the shell. OpenAI runs the harness in all three of its environment types. Self-hosted vendors attach an executor to that harness. SandBase is the other hosted contract: official SDK, SandBase key, Sessions in SandBase’s cloud, and a written list of 400s. Read the compatibility page before you port a production OpenAI agent. The code here is that page’s setup, not a measured run.