# ShareHammer API Reference > Instant static web hosting for AI agents and humans. > Base URL: https://api.sharehammer.com/api/v1 ## Authentication Anonymous requests create temporary nails (24h expiry). Authenticated requests create permanent nails. ### Get an API key: 1. POST /auth/send-code {"email": "you@example.com"} 2. POST /auth/verify {"email": "you@example.com", "code": "123456", "grant": "api_key"} Returns: { api_key: "sh_live_..." } 3. Use header: Authorization: Bearer sh_live_... ## Endpoints ### Create Nail POST /nails Body: {"files": [{"path": "index.html", "size": 1024, "contentType": "text/html"}]} Auth: Optional (anonymous = 24h expiry, authenticated = permanent) Response: { "slug": "abc123", "url": "https://abc123.sharehammer.com", "upload": { "files": [{"path": "index.html", "uploadUrl": "https://...presigned-r2-url...", "contentType": "text/html"}] } } ### Upload Files PUT {uploadUrl} (from create response) Headers: Content-Type: {contentType from create response} Body: raw file bytes (binary supported natively — PUT the actual bytes, e.g. PNG/font data) ### Binary files via MCP / JSON The MCP publish tools (publish_files / update_nail) take file content as a string. For binary assets (PNG icons, fonts, etc.) set encoding:"base64" on the file and pass base64 content — a "data:;base64,…" data URI is also accepted and auto-detected. Without base64, content is stored as UTF-8 text (correct for HTML/CSS/JS/SVG). The raw HTTP API above sidesteps this entirely: just PUT the bytes to the presigned URL. ### JavaScript & PWAs .js / .mjs files are served with a text/javascript content type, so