# MIOSA Documentation (full text) > MIOSA is an operating layer for agent products, sandboxes, desktop computers, immutable deployments, managed data, integrations, and customer infrastructure. Every documentation page follows, in sidebar order, as Markdown. The index is https://miosa.ai/llms.txt. --- # MIOSA Documentation URL: https://miosa.ai/docs Source: https://miosa.ai/docs.md Description: Build, preview, deploy, prove, and operate AI-generated applications on MIOSA sandboxes, computers, Docker Host, and white-label domains. Start with the [Quickstart](https://miosa.ai/docs/quickstart.md), or read the [Agent operating guide](https://miosa.ai/docs/guides/agent-operating-guide.md) if you are an automated worker. Every page is listed in https://miosa.ai/llms.txt. ## Sections - **Get started**: [Overview](https://miosa.ai/docs/quickstart.md), [Sandbox to deployment](https://miosa.ai/docs/quickstart/sandbox-to-deployment.md), [Agent-driven build](https://miosa.ai/docs/quickstart/agent-driven-build.md), [Docker Host](https://miosa.ai/docs/quickstart/app-engine.md), [Install the CLI or SDK](https://miosa.ai/docs/cli/install.md), [Sandboxes or Computers?](https://miosa.ai/docs/sandboxes-or-computers.md), [First production app](https://miosa.ai/docs/learn/first-production-app.md), [What you can build](https://miosa.ai/docs/use-cases.md) - **Learn**: [Start learning](https://miosa.ai/docs/learn.md), [Learn and earn](https://miosa.ai/docs/learn/earn.md), [Learn the words](https://miosa.ai/docs/glossary.md), [Learn with games](https://miosa.ai/docs/learn/games.md), [Learn with videos](https://miosa.ai/docs/learn/videos.md), [Overview](https://miosa.ai/docs/concepts.md), [Resource model](https://miosa.ai/docs/concepts/resource-model.md), [The publish pipeline](https://miosa.ai/docs/concepts/publish-pipeline.md) - **Services & projects**: [Overview](https://miosa.ai/docs/projects.md), [Project lifecycle](https://miosa.ai/docs/projects/lifecycle.md), [Project resources](https://miosa.ai/docs/projects/resources.md), [Members and usage](https://miosa.ai/docs/projects/members-and-usage.md), [Overview](https://miosa.ai/docs/services/overview.md), [Quick start](https://miosa.ai/docs/services/quickstart.md), [Run modes and types](https://miosa.ai/docs/services/services.md), [Static sites from Git](https://miosa.ai/docs/services/static.md) - **Sandboxes**: [Overview](https://miosa.ai/docs/develop/sandboxes.md), [Capabilities](https://miosa.ai/docs/develop/sandboxes/capabilities.md), [Create and connect](https://miosa.ai/docs/develop/sandboxes/create.md), [Docker in sandboxes](https://miosa.ai/docs/develop/sandboxes/docker.md), [Lifecycle](https://miosa.ai/docs/develop/sandboxes/lifecycle.md), [Files, exec, and artifacts](https://miosa.ai/docs/develop/files-and-exec.md), [Sizing and limits](https://miosa.ai/docs/develop/sandboxes/sizing.md), [Timeouts and auto-stop](https://miosa.ai/docs/develop/sandboxes/timeouts.md) - **Computers**: [Overview](https://miosa.ai/docs/computers/overview.md), [Inside a Computer](https://miosa.ai/docs/computers/anatomy.md), [Computers vs sandbox](https://miosa.ai/docs/computers/vs-sandbox.md), [Fast start and readiness](https://miosa.ai/docs/computers/fast-start.md), [Embedding and streaming](https://miosa.ai/docs/computers/embedding.md), [Lifecycle and sizing](https://miosa.ai/docs/computers/lifecycle.md), [Production checklist](https://miosa.ai/docs/computers/production-checklist.md), [Overview and concepts](https://miosa.ai/docs/computer-use.md) - **Databases & storage**: [Overview](https://miosa.ai/docs/data/overview.md), [Postgres](https://miosa.ai/docs/data/postgres.md), [MySQL](https://miosa.ai/docs/data/mysql.md), [Redis cache](https://miosa.ai/docs/data/redis.md), [Qdrant vectors](https://miosa.ai/docs/data/qdrant.md), [MongoDB](https://miosa.ai/docs/data/mongodb.md), [Storage and buckets](https://miosa.ai/docs/data/storage.md), [Volumes](https://miosa.ai/docs/data/volumes.md) - **Networking & domains**: [Domains](https://miosa.ai/docs/services/domains.md), [Previews](https://miosa.ai/docs/develop/previews.md), [Internet access and egress](https://miosa.ai/docs/develop/sandboxes/internet-access.md), [Network access rules](https://miosa.ai/docs/security/network.md), [Edge middleware](https://miosa.ai/docs/services/middleware.md), [Protection and WAF](https://miosa.ai/docs/services/protection.md), [Public database endpoint](https://miosa.ai/docs/data/public-endpoint.md) - **Agents**: [Operating guide for agents](https://miosa.ai/docs/guides/agent-operating-guide.md), [What agents can do](https://miosa.ai/docs/guides/agent-capabilities.md), [Agent CLI workflow](https://miosa.ai/docs/guides/agent-cli-workflow.md), [Agent safety and status](https://miosa.ai/docs/guides/agent-safety.md), [Integrating an AI agent](https://miosa.ai/docs/guides/agent.md), [Configure an agent](https://miosa.ai/docs/guides/configure-agent.md), [Chat with an agent on a machine](https://miosa.ai/docs/agents/chat-on-a-machine.md), [Agent Studio](https://miosa.ai/docs/agents/agent-studio.md) - **Optimal**: [What Optimal is](https://miosa.ai/docs/optimal.md), [Quickstart](https://miosa.ai/docs/optimal/quickstart.md), [Chats and modes](https://miosa.ai/docs/optimal/chats.md), [Brains and agents](https://miosa.ai/docs/optimal/brains.md), [Build on your machines](https://miosa.ai/docs/optimal/machines.md), [Approvals](https://miosa.ai/docs/optimal/approvals.md), [Tasks, artifacts and history](https://miosa.ai/docs/optimal/workspace.md), [Team chats and sharing](https://miosa.ai/docs/optimal/team-chats.md) - **Optimal Engine**: [What Optimal Engine is](https://miosa.ai/docs/optimal-engine.md), [Concepts](https://miosa.ai/docs/optimal-engine/concepts.md), [Quickstart](https://miosa.ai/docs/optimal-engine/quickstart.md), [Install and configure](https://miosa.ai/docs/optimal-engine/install.md), [Operations](https://miosa.ai/docs/optimal-engine/operations.md), [Sources and ingestion](https://miosa.ai/docs/optimal-engine/ingestion.md), [Memory and retrieval](https://miosa.ai/docs/optimal-engine/memory-and-retrieval.md), [Agents and workflows](https://miosa.ai/docs/optimal-engine/agents-and-workflows.md) - **Platform builders**: [Overview](https://miosa.ai/docs/integrations.md), [Platform builder guide](https://miosa.ai/docs/platform/overview.md), [Patterns](https://miosa.ai/docs/platform/patterns.md), [Agents in your product](https://miosa.ai/docs/platform/agents-in-your-product.md), [Templates and sizing](https://miosa.ai/docs/platform/templates-and-sizing.md), [Backend orchestration](https://miosa.ai/docs/integrations/backend-orchestration.md), [Example applications](https://miosa.ai/docs/integrations/examples.md), [Build an internal Business OS](https://miosa.ai/docs/guides/internal-business-os.md) - **Build**: [Build an app like...](https://miosa.ai/docs/build.md), [Lovable](https://miosa.ai/docs/build/lovable.md), [Bolt](https://miosa.ai/docs/build/bolt.md), [v0](https://miosa.ai/docs/build/v0.md), [Replit Agent](https://miosa.ai/docs/build/replit.md), [Base44](https://miosa.ai/docs/build/base44.md), [Emergent](https://miosa.ai/docs/build/emergent.md), [Rork](https://miosa.ai/docs/build/rork.md) - **CLI, SDKs & MCP**: [CLI or MCP: which to use](https://miosa.ai/docs/cli/cli-vs-mcp.md), [CLI overview](https://miosa.ai/docs/cli.md), [Account and environment](https://miosa.ai/docs/cli/account.md), [Machines and lifecycle](https://miosa.ai/docs/cli/machines.md), [Run commands and move files](https://miosa.ai/docs/cli/work-inside.md), [Snapshots, checkpoints and restore](https://miosa.ai/docs/cli/snapshots.md), [Environments](https://miosa.ai/docs/cli/environments.md), [Agents, chats and runs](https://miosa.ai/docs/cli/agents.md) - **API reference**: [Authentication](https://miosa.ai/docs/authentication.md), [Overview](https://miosa.ai/docs/fundamentals.md), [Authentication](https://miosa.ai/docs/fundamentals/authentication.md), [Requests, limits, and errors](https://miosa.ai/docs/fundamentals/requests.md), [Events (SSE)](https://miosa.ai/docs/fundamentals/events.md), [Ownership and external attribution](https://miosa.ai/docs/fundamentals/attribution.md), [Tenant configuration](https://miosa.ai/docs/fundamentals/tenant-config.md), [Rate limits](https://miosa.ai/docs/rate-limits.md) - **Organization & billing**: [Workspaces](https://miosa.ai/docs/api-reference/workspaces.md), [Members and invites](https://miosa.ai/docs/api-reference/members.md), [API keys](https://miosa.ai/docs/platform/api-keys.md), [Pricing and limits](https://miosa.ai/docs/pricing.md), [Plans and limits](https://miosa.ai/docs/plans-and-limits.md), [Billing and usage](https://miosa.ai/docs/platform/usage-and-billing.md) - **Security & compliance**: [Security overview](https://miosa.ai/docs/security.md), [API key scopes and rotation](https://miosa.ai/docs/security/api-keys.md), [Audit log](https://miosa.ai/docs/security/audit-log.md), [Data retention and deletion](https://miosa.ai/docs/data-retention.md), [Shared responsibility](https://miosa.ai/docs/infrastructure/shared-responsibility.md), [Security troubleshooting](https://miosa.ai/docs/security/troubleshooting.md) - **Self-hosting**: [Infrastructure options](https://miosa.ai/docs/infrastructure/overview.md), [Bring your own cloud](https://miosa.ai/docs/infrastructure/byoc/overview.md), [AWS](https://miosa.ai/docs/infrastructure/byoc/aws.md), [Google Cloud](https://miosa.ai/docs/infrastructure/byoc/gcp.md), [External computer providers](https://miosa.ai/docs/integrations/external-computers.md), [Compare compute providers](https://miosa.ai/docs/integrations/comparison.md) - **Compare**: [MIOSA vs other platforms](https://miosa.ai/docs/compare.md), [MIOSA vs Railway](https://miosa.ai/docs/compare/railway.md), [MIOSA vs Render](https://miosa.ai/docs/compare/render.md), [MIOSA vs Fly.io](https://miosa.ai/docs/compare/fly.md), [MIOSA vs E2B](https://miosa.ai/docs/compare/e2b.md), [MIOSA vs Daytona](https://miosa.ai/docs/compare/daytona.md), [MIOSA vs Modal](https://miosa.ai/docs/compare/modal.md), [MIOSA vs Vercel Sandbox](https://miosa.ai/docs/compare/vercel.md) - **Reference**: [Release notes](https://miosa.ai/docs/changelog.md), [Moving from Vercel](https://miosa.ai/docs/migrate/vercel.md), [Migrating from miosa-sandbox](https://miosa.ai/docs/migrating-from-miosa-sandbox.md), [Availability and roadmap](https://miosa.ai/docs/availability.md), [Known limitations](https://miosa.ai/docs/known-limitations.md), [Recovery playbooks](https://miosa.ai/docs/operations/recovery.md), [Evaluations](https://miosa.ai/docs/evaluations.md), [Benchmarks](https://miosa.ai/docs/benchmarks.md) - **Help**: [Overview](https://miosa.ai/docs/faq.md), [Getting started](https://miosa.ai/docs/faq/getting-started.md), [Sandboxes and computers](https://miosa.ai/docs/faq/sandboxes-and-computers.md), [Browser and computer use](https://miosa.ai/docs/faq/browser-and-computer-use.md), [Agents](https://miosa.ai/docs/faq/agents.md), [SOMA and runtimes (early access)](https://miosa.ai/docs/faq/runtimes.md), [White-label and platform builders](https://miosa.ai/docs/faq/white-label.md), [Business OS and internal use](https://miosa.ai/docs/faq/business-os.md) --- # Quickstart URL: https://miosa.ai/docs/quickstart Source: https://miosa.ai/docs/quickstart.md Description: Install the CLI, start a sandbox, let an agent build something inside it, and open it at a live URL. MIOSA runs isolated Linux sandboxes and full cloud desktops for your code and your AI agents, then publishes the result to a live URL. This page takes you from install to an app that an agent built, in four steps. Video: [Quickstart, explained](https://miosa.ai/videos/quickstart-explained.mp4) (1:35) ## Let your agent drive MIOSA Most people run MIOSA through a coding agent, not by hand. Your agent can run on your laptop and control the whole platform. It has four ways in: | Way in | What to do | |---|---| | CLI | Your agent runs `miosa` commands. Start it with the [Agent operating guide](https://miosa.ai/docs/guides/agent-operating-guide.md). | | MCP server | `miosa mcp install --client claude` (also `cursor` and `gemini`). OSA and Hermes use a config file instead: see [MCP](https://miosa.ai/docs/mcp.md). | | Skills | Claude Code skills for sandboxes, computers, and deploys. See [Claude Code skills](https://miosa.ai/docs/guides/skills.md). | | `llms.txt` | Point any agent at [miosa.ai/llms.txt](https://miosa.ai/llms.txt). It lists every docs page in plain text. | This works with OSA, Claude Code, Codex, OpenCode, Hermes, Kimi Code, and more. The rest of this page puts an agent inside a sandbox. Already know what you need? - [Sandbox to deployment](https://miosa.ai/docs/quickstart/sandbox-to-deployment.md): the recommended first walkthrough. - [Agent-driven build](https://miosa.ai/docs/quickstart/agent-driven-build.md): dispatch work, stream events, and collect artifacts from your backend. - [Docker Host](https://miosa.ai/docs/quickstart/app-engine.md): run containerized applications on a workspace Docker Host host; check [availability](https://miosa.ai/docs/availability.md) first. - [Connect your own server](https://miosa.ai/docs/opencomputers/connect.md): run your first command on a Linux machine you operate. ## 1. Install **macOS / Linux** ```bash curl -fsSL https://raw.githubusercontent.com/Miosa-osa/miosa-cli-go/main/install.sh | sh ``` **Windows** ```powershell npm i -g @miosa/cli ``` The installer does these steps: 1. Detects your OS and CPU. 2. Downloads the matching `miosa` binary and checks its SHA-256. 3. Installs it to `~/.local/bin/miosa` (or `/usr/local/bin` when run as root). Then run `miosa login` to sign in: it opens your browser, and the key for this machine is stored in `~/.miosa/config.toml`. Prefer npm, Homebrew, or a manual download? See [Install the CLI or SDK](https://miosa.ai/docs/cli/install.md). ## 2. Start a sandbox ```bash miosa create my-box --wait # provision a sandbox and wait until it is ready miosa list # see all your sandboxes ``` A sandbox is a fast, isolated Linux VM. Your agent writes files into it, runs commands, and opens ports as live preview URLs. Its filesystem persists when the sandbox pauses, so you can resume it later. Read [Sandboxes](https://miosa.ai/docs/develop/sandboxes.md) for sizes, limits, and lifecycle. ## 3. Run an agent inside it Pick your agent. MIOSA installs it in the sandbox and runs it there. The agent uses your own model account, so you pay your own provider. MIOSA credits never pay for the model. Each agent has three parts: connect your account, start the agent, and give it a task. **OSA** OSA is MIOSA's own agent. It works with the model you connect. **Connect.** Open the MIOSA console, go to **Agents**, and connect your model key for OSA. **Start it and give it a task.** ```bash miosa prompt --harness osa --sandbox my-box \ "Build a landing page and serve it on port 3000" ``` **Claude Code** **Connect.** Sign in with your Claude plan. The command prints a link and a code. Approve it in your browser, then paste the code back. ```bash miosa connections add models claude --sandbox my-box ``` Or use your own Anthropic key: ```bash miosa connections add models anthropic --key-stdin <<< "$ANTHROPIC_API_KEY" ``` **Start it and give it a task.** ```bash miosa prompt --harness claude-code --sandbox my-box \ "Build a landing page and serve it on port 3000" ``` **Codex** **Connect.** Sign in with your ChatGPT plan. The command prints a link and a code. Approve it in your browser. ```bash miosa connections add models chatgpt --sandbox my-box ``` Or use your own OpenAI key: ```bash miosa connections add models openai --key-stdin <<< "$OPENAI_API_KEY" ``` **Start it and give it a task.** ```bash miosa prompt --harness codex --sandbox my-box \ "Build a landing page and serve it on port 3000" ``` **OpenCode** **Connect.** In the MIOSA console, go to **Agents** and connect one of these for OpenCode: an Anthropic, OpenAI, OpenRouter, or Mistral key, or your ChatGPT plan. `miosa connections` does not cover this agent yet. **Start it and give it a task.** ```bash SANDBOX_ID=$(miosa info my-box --json | jq -r .id) RUN=$(miosa api POST /runs -d "{ \"runner\": \"opencode\", \"sandbox_id\": \"$SANDBOX_ID\", \"instruction\": \"Build a landing page and serve it on port 3000\" }" | jq -r .data.id) miosa run follow $RUN ``` **Hermes** Hermes Agent is a first-class runner in the run API. It is not in the CLI `--harness` list yet, so start it with the run API. **Connect.** In the MIOSA console, go to **Agents**, and connect a ChatGPT plan, a Claude plan (Max with extra usage), or an Anthropic, OpenAI, or OpenRouter key. `miosa connections` does not cover this agent yet. **Start it and give it a task.** ```bash SANDBOX_ID=$(miosa info my-box --json | jq -r .id) RUN=$(miosa api POST /runs -d "{ \"runner\": \"hermes\", \"sandbox_id\": \"$SANDBOX_ID\", \"instruction\": \"Build a landing page and serve it on port 3000\" }" | jq -r .data.id) miosa run follow $RUN ``` **Kimi Code** **Connect.** In the MIOSA console, go to **Agents** and connect your Kimi Code plan or your Moonshot key. `miosa connections` does not cover this agent yet. **Start it and give it a task.** ```bash SANDBOX_ID=$(miosa info my-box --json | jq -r .id) RUN=$(miosa api POST /runs -d "{ \"runner\": \"kimi\", \"sandbox_id\": \"$SANDBOX_ID\", \"instruction\": \"Build a landing page and serve it on port 3000\" }" | jq -r .data.id) miosa run follow $RUN ``` **Pi** **Connect.** In the MIOSA console, go to **Agents** and connect one of these for Pi: an Anthropic, OpenAI, OpenRouter, or Mistral key, or your Claude or ChatGPT plan. `miosa connections` does not cover this agent yet. **Start it and give it a task.** ```bash SANDBOX_ID=$(miosa info my-box --json | jq -r .id) RUN=$(miosa api POST /runs -d "{ \"runner\": \"pi\", \"sandbox_id\": \"$SANDBOX_ID\", \"instruction\": \"Build a landing page and serve it on port 3000\" }" | jq -r .data.id) miosa run follow $RUN ``` **Mistral** **Connect.** In the MIOSA console, go to **Agents** and connect your Mistral Vibe plan or your Mistral key. `miosa connections` does not cover this agent yet. **Start it and give it a task.** ```bash SANDBOX_ID=$(miosa info my-box --json | jq -r .id) RUN=$(miosa api POST /runs -d "{ \"runner\": \"mistral\", \"sandbox_id\": \"$SANDBOX_ID\", \"instruction\": \"Build a landing page and serve it on port 3000\" }" | jq -r .data.id) miosa run follow $RUN ``` If you have not connected an account, the run is refused or fails. MIOSA never falls back to its own keys. ## 4. See what it built ```bash miosa preview create my-box 3000 --visibility public ``` Open the URL it prints. That is the page your agent built, served from inside the sandbox. If nothing loads, the agent did not leave a server running. Start one yourself: ```bash miosa process start my-box --name web --cwd /workspace -- python3 -m http.server 3000 --bind 0.0.0.0 ``` ## Or do it by hand You do not need an agent for this. Write a file, start a server, and open a preview yourself. **CLI** ```bash miosa exec my-box -- echo "hello from MIOSA" echo "
Built in a sandbox.
` ) // Start the server in the background. This call returns right away. await sandbox.exec( "nohup python3 -m http.server 3000 --bind 0.0.0.0 > /tmp/web.log 2>&1 &", { cwd: "/workspace" } ) const preview = await sandbox.previews.create(3000) console.log(preview.url) // https://3000-abc12345.sandbox.miosa.ai ``` You can also hand the whole job to an agent: `await sandbox.run("Build a landing page and serve it on port 3000", { runner: "codex" })`. **Python** ```python import os from miosa import Miosa miosa = Miosa(api_key=os.environ["MIOSA_API_KEY"]) sandbox = miosa.sandboxes.create( template_id="miosa-sandbox", workspace_slug="default", # the workspace it belongs to; every create names one wait=True, ) print(sandbox.id, sandbox.state) # sbx_a1b2c3d4e5 running sandbox.files.write( "/workspace/index.html", """Built in a sandbox.
""", ) # Start the server in the background. This call returns right away. sandbox.processes.start("python3 -m http.server 3000 --bind 0.0.0.0", name="web") preview = sandbox.previews.create(port=3000) print(preview["url"]) # https://3000-abc12345.sandbox.miosa.ai ``` Open the preview URL MIOSA returns. Your `index.html` is served live from inside the sandbox. ## Pick what you need | You want to | Product | Start here | |---|---|---| | Run code, builds, tests, and dev servers | [Sandbox](https://miosa.ai/docs/develop/sandboxes.md) | [Create and connect](https://miosa.ai/docs/develop/sandboxes/create.md) | | Drive a browser, a desktop app, screenshots | [Computer](https://miosa.ai/docs/computers/overview.md) | [Computers overview](https://miosa.ai/docs/computers/overview.md) | | Ship an always-on app at a public URL | [Docker Host](https://miosa.ai/docs/docker-host/docker-deploy.md) | [Deploy overview](https://miosa.ai/docs/docker-host/overview.md) | | Run an AI agent against a sandbox or computer | [Agent Runs](https://miosa.ai/docs/api-reference/agent-runs.md) | [Agent operating guide](https://miosa.ai/docs/guides/agent-operating-guide.md) | | Build a white-label product on MIOSA | [Platform builders](https://miosa.ai/docs/platform/overview.md) | [Platform overview](https://miosa.ai/docs/platform/overview.md) | ## Next - [Sandbox to deployment](https://miosa.ai/docs/quickstart/sandbox-to-deployment.md): The full first walkthrough: create a sandbox, write files, preview, publish to production, and prove the deployment is live. - [Agent-driven build](https://miosa.ai/docs/quickstart/agent-driven-build.md): Dispatch work to your agent, stream events, and collect artifacts from your backend, with external attribution. - [Docker Host](https://miosa.ai/docs/quickstart/app-engine.md): Run containerized applications on a workspace Docker Host host. - [Connect your own server](https://miosa.ai/docs/opencomputers/connect.md): Run your first command on a Linux machine you operate. - [Concepts](https://miosa.ai/docs/concepts.md): Every MIOSA primitive in one architecture reference. - [API reference](https://miosa.ai/docs/api-reference.md): Every endpoint, error code, and webhook. --- # Sandbox to deployment URL: https://miosa.ai/docs/quickstart/sandbox-to-deployment Source: https://miosa.ai/docs/quickstart/sandbox-to-deployment.md Description: The full first walkthrough: create a sandbox, write code, preview it live, publish to production, and prove the deployment is running. Start with **Track 1: Sandbox to deployment**. The recommended first walkthrough. Your first success is a small site running at the production URL returned by MIOSA, with its deployment verified. Complete that path before adding agent orchestration or another runtime. > **Building a white-label product?** If your goal is to ship a SaaS where your customers never see the MIOSA brand, start with the [White-Label Integrator Guide](https://miosa.ai/docs/integrations.md) instead. It covers per-user provisioning, custom domains, iframe embeds, webhooks, and usage billing from scratch. ## Prerequisites ### Account and workspace Create a MIOSA account at [miosa.ai](https://miosa.ai) and a workspace. ### API key Create a key in Settings → API Keys for the intended workspace. See [API keys](https://miosa.ai/docs/platform/api-keys.md) for key types and scopes. Export your key in the terminal where you will run the examples: ```bash export MIOSA_API_KEY="msk_u_..." ``` ### Install tooling for your language **TypeScript** ```bash npm install @miosa/cli @miosa/sdk # or: pnpm add @miosa/cli @miosa/sdk ``` **Python** ```bash pip install --upgrade miosa ``` **Elixir** ```elixir # mix.exs - published on Hex.pm: https://hex.pm/packages/miosa {:miosa, "~> 1.1"} ``` Then run `mix deps.get`. **MCP (Claude Code / Cursor / Windsurf)** **Zero-install option - just a URL + API key:** ```json { "mcpServers": { "miosa": { "url": "https://api.miosa.ai/api/v1/mcp", "headers": { "Authorization": "Bearer msk_u_..." } } } } ``` Add this to `~/.claude/mcp.json` (Claude Code), Cursor's MCP settings, or Windsurf's `mcp_config.json`. No pip, no npm - the current capability-scoped tool catalog appears immediately after a client restart. This is the easiest way to get started. **Local server (optional):** ```bash pip install git+https://github.com/Miosa-osa/miosa-mcp.git ``` Or via the TypeScript CLI: ```bash npx @miosa/cli mcp serve ``` > **Caution: Never put msk_* in a browser** > > Workspace API keys are server-only. For browser-side preview embedding, your backend mints a short-lived share token. See [Browser Tokens](https://miosa.ai/docs/platform/browser-tokens.md). ## Step 1 - Create a sandbox. **TypeScript** ```typescript import { Miosa } from "@miosa/sdk" const miosa = new Miosa({ apiKey: process.env.MIOSA_API_KEY! }) const sandbox = await miosa.sandboxes.create({ templateId: "miosa-sandbox", workspaceSlug: "default", // the workspace it belongs to; every create names one }) console.log(sandbox.id, sandbox.state) // sbx_a1b2c3d4e5 running ``` **Python** ```python import os from miosa import Miosa miosa = Miosa(api_key=os.environ["MIOSA_API_KEY"]) sandbox = miosa.sandboxes.create(template_id="miosa-sandbox", workspace_slug="default") print(sandbox.id, sandbox.state) # sbx_a1b2c3d4e5 running ``` ## Step 2 - Write a small static site into `/workspace`. **TypeScript** ```typescript await sandbox.files.write( "/workspace/index.html", `Built in a sandbox.
` ) ``` **Python** ```python sandbox.files.write( "/workspace/index.html", """Built in a sandbox.
""", ) ``` ## Step 3 - Start a dev server so you can preview it. **TypeScript** ```typescript // Start the dev server. `exec.stream` keeps the process running and yields its output. const events = sandbox.exec.stream("python3 -m http.server 3000 --bind 0.0.0.0", { cwd: "/workspace" }) for await (const event of events) console.log(event) ``` **Python** ```python # Start the dev server in the background. server = sandbox.commands.run( "python3 -m http.server 3000 --bind 0.0.0.0", cwd="/workspace", background=True, ) ``` ## Step 4 - Create a preview and open it. **TypeScript** ```typescript const preview = await sandbox.previews.create(3000) console.log(preview.url) // https://3000-abc12345.sandbox.miosa.ai ``` **Python** ```python preview = sandbox.previews.create(port=3000) print(preview.url) # https://5173-abc12345.sandbox.miosa.ai ``` Open the URL in your browser. You see your `index.html` served live from inside the sandbox. ## Step 5 - Publish to production. **CLI** ```bash miosa deploy create --from-sandboxDeployed with MIOSA