# Ephemeral Deploy — API Documentation for LLMs > Deploy any website or web app to a live URL with a single HTTP request. > Pay with Solana (x402 protocol). No accounts, no API keys, no CLI. ## Quick Summary You are an AI agent and you want to show your human a live website you built. Send your files to this API, pay a few cents in SOL, and get a public URL back. --- ## Endpoint ``` POST https://ephemeral-deploy.vercel.app/api/deploy ``` ## Authentication There are no API keys. Payment is the authentication. ### Service Wallet (Solana — send payments here): ``` 2gKLymTMCqNwcQznqXJgi19Naix3xUFwHbivYU2WYTCh ``` ### Steps: 1. Create a Solana SOL transfer to the wallet above for the amount matching your TTL 2. Wait for the transaction to be confirmed 3. Include the transaction signature (tx hash) in the `X-Payment` header 4. The server verifies the payment on-chain before deploying If you don't include payment, the server returns HTTP 402 with pricing info and the wallet address. ## Request Format ``` POST /api/deploy Content-Type: application/json X-Payment: { "files": { "": "", "": "" }, "ttl": 24, "framework": "nextjs" } ``` ### Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `files` | object | Yes | Map of file paths to base64-encoded content | | `ttl` | number | No | Time-to-live in hours (1-168). Default: 24 | | `framework` | string | No | "nextjs", "vite", "astro", "nuxt", "remix", "static". Auto-detected if omitted | ### Important Notes on Files - File paths are relative to the project root (e.g. `app/page.tsx`, not `/app/page.tsx`) - All file content MUST be base64-encoded - Do NOT include `node_modules` — dependencies are installed automatically during build - Maximum total upload size: 50MB - For Next.js/Vite/etc: include `package.json` with all dependencies listed ## Response ```json { "id": "deploy_abc123", "url": "https://eph-xyz.vercel.app", "status": "building", "expiresAt": "2026-03-14T18:00:00Z", "framework": "nextjs" } ``` The `url` is publicly accessible once `status` becomes `"ready"` (usually 15-45 seconds for static, 30-90 seconds for Next.js). ## Status Check ``` GET https://ephemeral-deploy.vercel.app/api/status/ ``` Returns the current status: `"building"`, `"ready"`, `"error"`, or `"expired"`. ## Pricing | TTL | SOL | USD (approx) | |-----|-----|-------------| | 1 hour | 0.0005 | $0.07 | | 24 hours | 0.002 | $0.28 | | 3 days | 0.005 | $0.70 | | 7 days | 0.01 | $1.40 | --- ## Complete Examples ### Example 1: Static HTML Site This deploys a single HTML page. ```bash # 1. Base64 encode your HTML HTML='Hello

Hello World

' ENCODED=$(echo -n "$HTML" | base64) # 2. Deploy curl -X POST https://ephemeral-deploy.vercel.app/api/deploy \ -H "Content-Type: application/json" \ -H "X-Payment: " \ -d "{ \"files\": { \"index.html\": \"$ENCODED\" }, \"ttl\": 24 }" ``` ### Example 2: Next.js App with API Routes This deploys a full Next.js 15 application with a page and an API route. Required files: - `package.json` — with next, react, react-dom as dependencies, and @types/react, @types/node, typescript as devDependencies - `next.config.ts` — Next.js config - `tsconfig.json` — TypeScript config - `app/layout.tsx` — Root layout - `app/page.tsx` — Home page - `app/api/*/route.ts` — API routes (optional) ```json { "files": { "package.json": "", "next.config.ts": "", "tsconfig.json": "", "app/layout.tsx": "", "app/page.tsx": "", "app/api/hello/route.ts": "" }, "ttl": 72, "framework": "nextjs" } ``` ### Example 3: Vite React App ```json { "files": { "package.json": "", "vite.config.ts": "", "index.html": ">", "src/main.tsx": "", "src/App.tsx": "" }, "ttl": 24, "framework": "vite" } ``` --- ## Framework Auto-Detection If you don't specify `framework`, the API detects it from your files: | Framework | Detected by | |-----------|-------------| | Next.js | `next.config.js`, `next.config.ts`, or `next.config.mjs` in files, OR `next` in package.json dependencies | | Vite | `vite.config.js` or `vite.config.ts`, OR `vite` in package.json dependencies | | Astro | `astro.config.mjs` or `astro.config.ts`, OR `astro` in package.json dependencies | | Nuxt | `nuxt.config.ts` or `nuxt.config.js`, OR `nuxt` in package.json dependencies | | Remix | `remix.config.js` or `remix.config.ts`, OR `@remix-run/react` in package.json dependencies | | Static | `index.html` at root, or fallback when no framework is detected | ## Error Responses ### 402 Payment Required No payment or insufficient payment. Response includes pricing info and wallet address. ```json { "error": "Payment required", "protocol": "x402", "chain": "solana", "wallet": "2gKLymTMCqNwcQznqXJgi19Naix3xUFwHbivYU2WYTCh", "pricing": [ { "ttl": "1h", "amount": "0.0005 SOL" }, { "ttl": "24h", "amount": "0.002 SOL" }, { "ttl": "72h", "amount": "0.005 SOL" }, { "ttl": "168h", "amount": "0.01 SOL" } ] } ``` ### 413 Payload Too Large Upload exceeds 50MB. ### 415 Unsupported Media Type Content-Type must be `application/json`. ### 429 Too Many Requests More than 10 deploys per wallet per hour. ### 500 Internal Server Error Something went wrong. The error message is included. ## Rate Limits - 10 deploys per Solana wallet per hour - 50MB max upload size per deploy - TTL range: 1 hour to 7 days (168 hours) ## Payment Verification Details The server checks: 1. Transaction exists on Solana and is confirmed 2. Transfer destination matches the service wallet 3. Amount is >= required for the requested TTL 4. Transaction is less than 1 hour old (prevents replay) ## Health Check ``` GET https://ephemeral-deploy.vercel.app/api/health ``` Returns service status and count of active deployments.