guides/agents-api/environments/providers/runloop.md +0 −29 deleted
File Deleted View Diff
1# Runloop
2
3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.
4
5See the [application-managed example](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/runloop/application_managed) in the OpenAI Cookbook.
6
7This guide uses **application-managed** provisioning: your application starts the Devbox, connects its executor, and shuts it down when finished. See [Sandbox lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle) for the lifecycle behavior.
8
9## Before you begin
10
11Use the Runloop SDK or API to manage a Devbox, and HTTP requests to manage Agents API sessions.
12
13Set `RUNLOOP_API_KEY` and use `OPENAI_API_KEY` for application requests. Set `OPENAI_EXECUTOR_API_KEY` to an [environment key](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted#authentication), and pass only that key into the Devbox as `CODEX_API_KEY`.
14
15## Application-managed
16
171. [Create a self-hosted session](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted#create-or-reuse-a-session) and save its environment ID.
182. Create a Runloop Devbox with the session's working directory and install the Codex CLI inside it.
193. [Start the executor](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted#start-the-executor) in the background with the environment ID and environment key.
204. [Send input and inspect the result](https://developers.openai.com/api/docs/guides/agents-api/sessions). For a file task, create `brief.txt` in the workspace and ask the agent to write a migration plan to `plan.md`.
215. Check that the turn completed, retrieve any files you need, then shut down the Devbox and [delete the session](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#delete-a-session).
22
23Use bounded setup and execution timeouts, plus a Devbox lifetime limit as a fallback if your application exits unexpectedly. Keep the session and Devbox alive if you need follow-up turns. Use one provisioning owner per session; do not attach a provisioning webhook handler to sessions your application manages directly.
24
25## References
26
27- Read [Runloop documentation](https://docs.runloop.ai/)
28- Read [Runloop Python SDK](https://runloopai.github.io/api-client-python/)
29- Read [Runloop TypeScript SDK](https://runloopai.github.io/api-client-ts/stable/)