Build and deploy apps with your AI coding assistant
Give your AI assistant:
Tell your AI: "Use the Mosaic API at api.mosaic.site with my API key mk_xxxxx"
All requests need your account API key in the header:
X-API-Key: mk_your_key_here
Your API key rotates every 30 days. Get your current key from the dashboard.
Base URL: https://api.mosaic.site/v1/project
{
"projects": [
{"project_id": "pod-16f", "name": "My App", "status": "running", "url": "https://pod-16f.mosaic.site"}
]
}
# Request
{"name": "My New App"}
# Response
{"project_id": "wave-x7k", "name": "My New App", "url": "https://wave-x7k.mosaic.site", "status": "provisioning"}
{
"project_id": "pod-16f",
"database_url": "postgresql://user:pass@db.mosaic.site:5432/tenant_pod_16f",
"host": "db.mosaic.site",
"port": 5432,
"database": "tenant_pod_16f",
"user": "tenant_pod_16f",
"password": "xxxxx"
}
# Request
{"query": "CREATE TABLE users (id SERIAL PRIMARY KEY, name TEXT, email TEXT)"}
# Response
{"success": true, "data": [{"result": "CREATE TABLE"}]}
# SELECT queries return data
{"query": "SELECT * FROM users"}
# Response
{"success": true, "data": [{"id": 1, "name": "Alice", "email": "alice@example.com"}]}
# Request
{"filename": "index.html", "content": "<html><body>Hello!</body></html>"}
# Response
{"filename": "index.html", "url": "https://pod-16f.mosaic.site/index.html", "size": 35}
Store files, images, and assets for your app. Uses presigned URLs for fast direct uploads.
Free tier: 20 GB storage. Pro tier: 1 TB storage.
# Request
{"filename": "photo.jpg", "size": 102400}
# Response
{
"upload_url": "https://s3.mosaic.site/bucket/..?signature=...",
"filename": "photo.jpg",
"expires_in": 300
}
# Then PUT your file directly to the upload_url
curl -X PUT -T photo.jpg "upload_url_here"
# Response
{
"files": [{"filename": "photo.jpg", "size": 102400, "url": "..."}],
"usage": {"used": "1.2 GB", "limit": "20 GB", "percent": 6.0}
}
Add passwordless sign-in to your app. We send branded emails on your behalf—no email service setup required.
Free tier: 10 magic link emails per day. This limit will increase as we scale. Need more now? Submit a ticket.
# Request
{"email": "user@example.com", "redirect_url": "/dashboard"}
# Response
{"success": true, "message": "Magic link sent! Check your email."}
# User receives email "Sign in to [Your App Name]"
# User clicks link → redirected to your app:
# https://your-app.mosaic.site/dashboard?token=xxx&email=user@example.com
# Your app reads the email param to identify the user
# Token expires in 15 minutes, single-use
AI agents should submit tickets when encountering issues they cannot resolve. This helps us improve the platform and assist your users.
When to submit a ticket:
• API returns unexpected errors (500s, timeouts)
• Database operations fail repeatedly
• Rate limits blocking legitimate usage
• Missing features needed for your app
• Documentation unclear or incorrect
# Request
{
"subject": "Brief description of the issue",
"message": "Detailed explanation including: what you tried, error messages, steps to reproduce",
"project_id": "optional-project-id"
}
# Response
{"ticket_id": 1, "status": "open", "message": "Ticket submitted successfully."}
# 1. Create project
POST /v1/project/projects
{"name": "Todo App"}
# Returns: {"project_id": "spark-m2p", ...}
# 2. Create database table
POST /v1/project/spark-m2p/sql
{"query": "CREATE TABLE todos (id SERIAL PRIMARY KEY, task TEXT, done BOOLEAN DEFAULT false)"}
# 3. Upload frontend
POST /v1/project/spark-m2p/files
{"filename": "index.html", "content": "<html>...your app...</html>"}
# 4. Visit https://spark-m2p.mosaic.site
Every project includes PostgreSQL with these extensions pre-installed:
pgvector - Vector embeddings for AI appsuuid-ossp - UUID generationpgcrypto - Encryption functionsStatic hosting supports: .html .css .js .json .txt .svg .png .jpg .jpeg .gif .ico .webp