Skip to main content
OpenAI’s Agents API runs the agent loop on OpenAI’s servers. With a self_hosted environment, Mirage serves that environment: the agent’s shell commands, file reads and patches run in a Mirage workspace, under its profile and mount modes, and what the agent writes lands in its mounts. The workspace connects through Codex’s exec-server relay, set up on the Codex page. The Agents API is in beta.

Install

Usage

Workspace

/workspace, where OpenAI’s examples work, is scratch space in memory. /redis keeps what the agent saves there after the workspace closes:
workspace.yaml

Create a session

Connect the workspace

Hand the session’s environment.id and environment.remote_url, with an environment key, to codex exec-server forward pointed at workspace demo. The agent’s commands then run in the workspace.

Run a task

Open the session’s event stream, then send the task. The reply streams back while the agent’s commands run in the workspace:
The report stays in Redis after the session ends:

Tools

The agent keeps the Agents API’s own tools. Its shell commands, file reads and patches arrive through the exec-server and run in the workspace as Mirage shell lines and file operations, held to the session’s profile and the mounts’ modes.

Example

examples/python/agents/openai_agents_api/redis_report.py runs the whole flow: it seeds /workspace/orders.csv, starts mirage codex-exec and codex exec-server forward, sends the task and prints the report.