# Connect Montagea to your coding assistant Official website: https://montagea.com Official API origin: https://api.montagea.com Personal connection and revocation: https://montagea.com/connect This guide is for a coding assistant with a terminal and Python 3.10+ on macOS or Linux. Editing and rendering remain local. ## Setup 1. Pick --client for the assistant you are running in: Claude Code: claude | Codex: codex | Cursor (editor or cursor-agent): cursor | Gemini CLI: gemini VS Code / GitHub Copilot: vscode | Windsurf: windsurf | anything else: other If unsure, use other: setup authorizes and prints an MCP entry for the user to add manually. Check that Python 3.10+ is available. 2. Download the official client to a temporary working directory, inspect it, then run it: curl -fSL https://api.montagea.com/api/agent/client.py -o montagea.py python3 montagea.py setup --client --api-base https://api.montagea.com Client 0.6.0 supports the official production and staging API/frontend pairs, plus local development (API port 8000; frontend port 3000/3001). Do not substitute an unrelated API origin or authorization page. Setup checks the assistant before asking for approval. To add another assistant later, run setup again with its --client; an existing valid connection is reused without a new approval. Use --no-browser in a headless terminal. Keep setup running while the user completes browser consent. It prints the connect page link and a code. Show the user that code. They open the page, sign in to their Montagea account, type the code themselves and approve the connection. The link never contains the code; never send the code to anyone else. Every connection can generate, create and edit the user's draft projects, and publish works and games when the user asks; the consent page says so. If they need credits or a plan, the connect page opens the existing pricing and checkout flow in another tab. Only the user confirms the purchase. Keep the authorization tab open; approve after returning. Do not request passwords, card details, browser cookies, or API keys in the conversation. The client creates a scoped credential locally; only its SHA-256 hash reaches the server. Setup installs the standalone client under ~/.montagea, saves the credential privately, and registers the montagea stdio MCP server through the assistant's own CLI (claude, codex, gemini, code) or by adding one entry to its MCP JSON file (Cursor, Windsurf). It preserves everything else, keeps a .montagea-backup of a changed file, and refuses to replace a different montagea entry. With other, add the printed entry yourself. If MCP tools do not appear, reload/reconnect MCP in the host or start a new conversation. Credentials expire after 90 days and can be revoked at /connect. Rerun setup when needed. ## Use Use models to discover available slugs, then model to read the current capabilities and JSON schema. Models come from Montagea's website registry, covering text, image, video, speech (audio), and music. Compatible new models require no reinstall. Visibility does not override account tier, availability or quota. Use account and estimate before spending. unlimited_models uses catalog slugs; unlimited_coverage includes parameter constraints (H3 Unlimited covers 720p). Estimates are not hard spending caps; normal website billing, allowances, content checks, queues, refunds, watermark and retention apply to these personal connections. These personal sessions are separate from /api/v1 developer/distributor keys and their billing contracts. Use upload for local reference files. Fill parameters from the model schema, not guessed parameter names. Use generate with a stable request_id. Persist that ID and reuse IDENTICAL parameters after any interruption. Never create a new ID to retry an uncertain submission: that creates and may charge for a new generation. Generate returns an asynchronous kind + id. Poll job every 5 seconds or longer. Download completed jobs with download to a new path; it handles the standard download resolver and never overwrites a file. For proxy Fake-IP DNS, the client resolves only the artifact hostname through Google Public DNS over HTTPS and pins a verified public unicast address. If that fails, exclude the hostname from Fake-IP DNS and retry downloading the same job; do not generate again or disable private-address checks. Use local tools such as FFmpeg for editing, subtitles, audio mixing and rendering. ## Projects A film of several shots is made as a project: a draft work (visible only to the user) holding the script, the scenes, one chosen clip per scene and the assets, so the published work page keeps all of them. A single short clip needs no project: generate it directly (and publish it without project_id). Order of calls: 1. project_create with a title and aspect_ratio (16:9, 9:16 or 1:1). 2. script_write with a prompt (an async text job billed in credits as on the website); poll job with kind text, then project_update with script_job_id to save it verbatim. script_polish works the same way. Or pass your own script to project_create / project_update. 3. scenes_split (async, credits) turns the saved script into scenes; read them with project. It replaces every scene and is refused once a scene has a chosen clip; then use scene_add, scene_update (sort_order moves a scene) and scene_delete. 4. assets_extract (async, credits) lists the characters, locations and props; call it again with the finished job_id to save them into the project's library. asset_add registers a reference picture, music, ambience or an uploaded file (a finished job of the user's, a local path or the user's media URL); name attaches it to a library entry. 5. For each scene: generate the video with project_id and scene_id (same request_id rules), poll it, then scene_clip with the finished job_id. The work page shows each scene with its clip. 6. Download the clips, edit the film locally, then publish with project_id (every scene needs its clip). Only the user's own draft project can change; a published, funded or expired work answers project_locked. At most 30 projects a day can be created from an assistant. ## Publish Only when the user asks you to publish. Use publish with the finished film, a cover image, a title (up to 100 characters) and a description (up to 500). film and cover may be local paths (uploaded for you, film up to 200 MiB) or URLs of the user's own media on Montagea. A published work is link-only until Montagea has reviewed its frames; it then becomes public, or stays unlisted when public is false. Poll work with the returned work_id (review: pending, passed, adult = stays link-only, blocked = taken down, unreviewed = link-only until a person looks). Publishing the same film again returns the same work, so retry the same film after an interruption. A published work cannot be edited from here; the user unpublishes it on its page to change it. A film made as a project is published with its project_id: the project itself becomes the work. Publishing requires at least one paid video generation on the account. ## Make a game Make an original single-player HTML5 game: a self-contained static package, no runtime network access, no multiplayer servers, ads, purchases, camera or microphone. Use original names, characters and art; do not copy commercial games. Package limits: 100 MB total, 25 MB per file, 400 files. Allowed extensions: html js mjs css json png jpg jpeg webp gif svg mp3 ogg wav m4a mp4 webm glb gltf bin ktx2 wasm woff2 ttf txt. The package root needs montagea.game.json and its entry (normally index.html). The manifest declares sdk:1, title, description, entry, optional cover, orientation (portrait/landscape/any), input ([touch], [keyboard], or both), and params. Device support comes from the check, not your declaration. Use /sdk/v1.js and the fixed libraries /lib/phaser-3.90.0.min.js, /lib/three-0.170.0.module.min.js, and /lib/three-addons/... as absolute paths. Bundle every other asset locally; do not load remote CDNs. The game runs in an opaque sandbox. CSP names the play origin explicitly, without 'self' or unsafe-eval. Use crossOrigin='anonymous' for images and textures (Phaser: this.load.setCORS('anonymous')). Never use localStorage directly: use Montagea.save(data), up to 64 KB. SDK loading sends hello; the host replies init with locale, muted, params, save and input. Register Montagea.on('init', ...) and call Montagea.ready() within 10 seconds. Support pause, resume, mute and restart; call Montagea.gameOver({score}) when a round ends. Support touch and keyboard when claiming both devices. No eval or new Function. Workflow: 1. game_starter(kind=phaser|three, directory=) downloads a working starting point. The starter remembers the configured play origin for library downloads. 2. Edit locally, then inspect under the real sandbox conditions: python3 ~/.montagea/montagea.py game-serve --port 5181 Open http://127.0.0.1:5181/ in a browser. Libraries are cached in ~/.montagea/platform/. For a directory made by hand, set --play-origin or MONTAGEA_PLAY_ORIGIN; the development default is http://127.0.0.1:8000. The three starter's optional GLB example takes params.model='models/your-model.glb'; include that local file in the package. 3. game_create(title, description) returns game_id; game_push(game_id, directory) replaces the draft and queues a check. Hidden files, symlinks and files outside the whitelist are skipped locally. 4. Poll game(game_id) for check.state, works_on, report and screenshot URLs. Inspect the screenshots and correct failures, then push again. At least one device must pass before publication. 5. Only when the user requests publication: game_publish(game_id, public=true|false). It is link-only until picture and text review pass. public=false keeps it unlisted afterwards. No paid-video-spend prerequisite. Create and publish each default to 10 per account per UTC day. A retry of the same published version returns already_published=true. game_pull(handle, directory=) downloads an owned or public game's source with SHA-256 verification. Publishing makes the package files publicly readable. Unlisted games are playable by link; another user's unlisted source cannot be pulled. The game tools require the default game scope, which existing connections receive automatically; no new consent is required. ## CLI fallback python3 ~/.montagea/montagea.py models --kind video python3 ~/.montagea/montagea.py model python3 ~/.montagea/montagea.py estimate --params @parameters.json python3 ~/.montagea/montagea.py generate --params @parameters.json --request-id python3 ~/.montagea/montagea.py job video python3 ~/.montagea/montagea.py download video output.mp4 python3 ~/.montagea/montagea.py publish --film final.mp4 --cover cover.png --title --description <text> python3 ~/.montagea/montagea.py work <work_id> python3 ~/.montagea/montagea.py project-create --title <title> --aspect-ratio 9:16 python3 ~/.montagea/montagea.py project <project_id> python3 ~/.montagea/montagea.py generate <slug> --params @shot1.json --request-id <stable-id> --project-id <id> --scene-id <id> python3 ~/.montagea/montagea.py scene-clip <project_id> <scene_id> <job_id> python3 ~/.montagea/montagea.py disconnect A connection cannot change account settings, buy anything, delete works, edit a published work or administer accounts. The server may refuse generation for insufficient funds, tier limits, quota, invalid inputs or unavailable capacity. Report the actual error; never silently switch the requested model or invent a successful result.