Create an openai_hosted environment using POST /v1/agents/environments with packages, files, and setup_commands. Poll the environment until it reaches ready, or use a webhook. When the task arrives, pass the resulting environment_id while creating the Agent Session. Official guidance also permits attaching while setup continues; agent access waits until setup completes. Pre-warm close to expected task arrival, as unattached environments expire after about five minutes. Official examples require at least Python SDK 3.27.0 or Node.js SDK 7.31.0, with language-specific minimum versions for others. Pre-warming is free only before attachment; standard container billing applies afterward. Check permissions, SDK versions, reuse behavior, and expiry handling. This is a documentation-based walkthrough, not an independently executed test.