Adapters and Workers
An adapter is a package you install next to your agent code. When a tool needs a shell, the framework calls the adapter. The adapter creates and destroys sandboxes using your BoxRouter API key. For a hosted agent, the vendor runs the agent itself. A worker runs inside your sandbox and connects outbound to the vendor. It receives the agent’s tool calls and runs them in the sandbox, so no inbound port is needed. You launch the sandbox withboxrouter launch and destroy it yourself. Ending the vendor’s session does not
destroy it.
Which OpenAI Integration
- For the Agents SDK, use the adapter. The Python library runs in your process.
- For the Agents API, use a worker. OpenAI hosts the agent and cannot reach your process, so each OpenAI session gets one executor in its own sandbox.
What Stays Separate
Your application or the hosted agent service holds the model API key. The adapter or launch uses your BoxRouter API key. A hosted worker also needs an environment key, supplied as a BoxRouter secret, to connect to the vendor’s service. Each integration guide lists the keys it needs. If no route meets yourrequirements, creation fails with no_eligible_route (Sandboxes).
For calls outside a framework, use the Python or TypeScript SDK.
Next Steps
Use the OpenAI Agents SDK
Adapter for the Python library.
Use the OpenAI Agents API
Executor for OpenAI-hosted agent sessions.
Run Claude Managed Agents
Worker for Anthropic-hosted agents.