Skip to main content
Run Codex or another coding agent in a cloud sandbox from your application. Give it a prompt, collect the files it creates, and continue the conversation when you need another turn. For scored runs against a dataset, use the evaluation SDK.

Install

Use Node.js 18 or later. Python also requires Python 3.10 or later and Node.js, because the direct-agent SDK uses a Node bridge.

Set your API key

Create a key on the dashboard and export it in the terminal where you will run the example:
With only this key, Evolve supplies model access and an E2B sandbox. If your environment contains sandbox provider credentials, they take precedence. See sandbox configuration.

Run one agent

This example starts a billable run and asks Codex to write a release note. The finally block destroys the sandbox after the output is read.
Save as run.mjs. The example uses the TypeScript SDK from JavaScript, so it runs directly with Node.
run.mjs
The program prints the generated Markdown. The wording varies by run. output.files maps file names to their contents; paths are relative to the sandbox’s output/ directory.

Continue building

Last modified on November 9, 2026