# Create a preview code

Collection: mcp
Human docs: https://zei.sh/docs/mcp

Create temporary HTTP access to a sandbox port.

Tool: sandboxes_create_preview_code
Input: {"sandboxId":"SANDBOX_ID","port":3000,"ttl_seconds":300}
Permission: MACHINE_READ.
Use base_url and the code for agents, and the handoff URL for browsers.

Example:

```
{"name":"sandboxes_create_preview_code","arguments":{"sandboxId":"SANDBOX_ID","port":3000,"ttl_seconds":300}}
```
