> ## Documentation Index
> Fetch the complete documentation index at: https://opensandbox-oc-s-762ac928075c46d2828bcb22.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Session

Create an ephemeral session. The platform creates a sandbox, writes `input` to `/tmp/agent_input.json`, sets `AGENT_INPUT_PATH`, and runs the agent's entrypoint.

<ParamField path="agentId" type="string" required>
  Agent ID
</ParamField>

<ParamField body="input" type="object">
  Input data written to `/tmp/agent_input.json` in the sandbox
</ParamField>

<ParamField body="metadata" type="object">
  Arbitrary metadata
</ParamField>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "sess_98adcc7e",
    "agent_id": "issue-resolver",
    "status": "creating",
    "input": { "repo": "acme/backend", "issue_number": 42 },
    "result": null,
    "preview_url": null,
    "metadata": { "trigger": "github_webhook" },
    "created_at": "2026-04-09T10:30:00Z",
    "updated_at": "2026-04-09T10:30:00Z"
  }
  ```
</ResponseExample>
