API Documentation
API Documentation
Complete API reference for BLAZED.sh - Deploy containers and scripts on our Web3 PaaS platform.
Authentication
Base URL
https://backend.blazed.shAuthentication Header
Authorization: Bearer YOUR_API_KEYContent Type
Content-Type: application/jsonCLI & MCP Server
Everything documented below is also available as a single-file bash CLI, which doubles as an MCP stdio server exposing 15 tools that map 1:1 onto these endpoints. It is open source and depends only on bash ≥ 4, curl and jq.
PATH, then point it at your API key.Install
git clone https://github.com/BLAZED-sh/blazed.sh install -m 755 blazed.sh/blazed.sh ~/.local/bin/blazed.sh
Authenticate
export BLAZED_API_KEY=... # environment variable, or blazed.sh config set-key # stored in ~/.config/blazed/config
Deploy
blazed.sh container create my-app --image nginx:latest -p 8080 blazed.sh container ports <id> blazed.sh script create watcher --file bot.js blazed.sh script logs <id> --follow
--json works on any command and prints the raw API response for piping into jq.
mcp argument to give an AI agent hands on the platform.Register with Claude Code
claude mcp add --scope user blazed -- ~/.local/bin/blazed.sh mcp
Any MCP client
{
"mcpServers": {
"blazed": {
"command": "/home/you/.local/bin/blazed.sh",
"args": ["mcp"],
"env": { "BLAZED_API_KEY": "YOUR_API_KEY" }
}
}
}The 15 tools cover the full surface: create, list, get, stop and delete containers, read their logs and port mappings, plus create, update, list, get, run, stop and delete scripts. See the AI agent infrastructure page for how agents use it end to end.
Containers API
Create Container
/api/containers201 Created with the container record; deployment happens asynchronously (initial status is pending).Request Body
{
"name": "my-app",
"image": "nginx:latest",
"env": "NODE_ENV=production\nPORT=3000",
"ports": ["8080", "443"],
"cmd": "node server.js",
"tty": true,
"volumeId": "VOLUME_ID",
"mountPath": "/data"
}ports is an array of plain container port numbers as strings (1–65535). Do not use host:container/proto syntax — public host ports are auto-assigned by the platform. Read the resulting mapping back from the ports endpoint.
env is a newline-separated string of KEY=VALUE pairs.
cmd is a single string split on spaces server-side — shell quoting inside it is not honored.
volumeId and mountPath are optional and attach an existing volume. If volumeId is set without mountPath, the volume is mounted at /data.
Response (201 Created)
{
"id": "RECORD_ID",
"created": "2025-01-19T10:30:00.000Z",
"updated": "2025-01-19T10:30:00.000Z",
"name": "my-app",
"image": "nginx:latest",
"cmd": "node server.js",
"env": "NODE_ENV=production\nPORT=3000",
"tty": true,
"status": "pending",
"ports": "[\"8080\",\"443\"]",
"ownerId": "USER_ID",
"volumeId": "VOLUME_ID",
"mountPath": "/data"
}List Containers
/api/containersResponse
[
{
"id": "RECORD_ID",
"name": "my-app",
"image": "nginx:latest",
"status": "running",
"ports": "[\"8080\"]",
"ownerId": "USER_ID",
"created": "2025-01-19T10:30:00.000Z",
"updated": "2025-01-19T10:30:00.000Z"
}
]Get Container
/api/containers/{id}Response
{
"id": "RECORD_ID",
"name": "my-app",
"image": "nginx:latest",
"cmd": "node server.js",
"env": "NODE_ENV=production\nPORT=3000",
"tty": true,
"status": "running",
"ports": "[\"8080\"]",
"ownerId": "USER_ID",
"created": "2025-01-19T10:30:00.000Z",
"updated": "2025-01-19T10:30:00.000Z"
}Stop Container
/api/containers/{id}/stopResponse
{
"status": "stopping"
}Delete Container
/api/containers/{id}204 No Content on success (empty body).Container Logs
/api/containers/{id}/logssince query parameter (RFC3339 or Unix timestamp) to only return logs after that time.Response
{
"text": "Container log output here..."
}Container Ports
/api/containers/{id}/portsResponse
{
"8080": 30123,
"443": 30124
}Scripts API
Create Script
/api/scripts201 Created.Request Body
{
"name": "my-script",
"code": "console.log('Hello from BLAZED.sh!');"
}Response (201 Created)
{
"id": "RECORD_ID",
"created": "2025-01-19T10:30:00.000Z",
"updated": "2025-01-19T10:30:00.000Z",
"name": "my-script",
"code": "console.log('Hello from BLAZED.sh!');",
"owner": "USER_ID",
"lastExitCode": 0,
"lastExitTime": null,
"lastExecTime": null
}List Scripts
/api/scriptscode; each entry includes its latest runner container (if any) as currentContainer.Response
[
{
"id": "RECORD_ID",
"created": "2025-01-19T10:30:00.000Z",
"updated": "2025-01-19T10:30:00.000Z",
"name": "my-script",
"owner": "USER_ID",
"lastExitCode": 0,
"lastExitTime": "2025-01-19T11:00:00.000Z",
"lastExecTime": "2025-01-19T10:59:00.000Z",
"currentContainer": { "id": "...", "status": "running" }
}
]Get Script
/api/scripts/{id}code and latest runner container (if any) as currentContainer.Response
{
"id": "RECORD_ID",
"created": "2025-01-19T10:30:00.000Z",
"updated": "2025-01-19T10:30:00.000Z",
"name": "my-script",
"code": "console.log('Hello from BLAZED.sh!');",
"owner": "USER_ID",
"lastExitCode": 0,
"lastExitTime": "2025-01-19T11:00:00.000Z",
"lastExecTime": "2025-01-19T10:59:00.000Z",
"currentContainer": { "id": "...", "status": "running" }
}Update Script
/api/scripts/{id}Request Body
{
"name": "updated-script-name",
"code": "console.log('Updated script code!');"
}Response
{
"id": "RECORD_ID",
"created": "2025-01-19T10:30:00.000Z",
"updated": "2025-01-19T10:35:00.000Z",
"name": "updated-script-name",
"code": "console.log('Updated script code!');",
"owner": "USER_ID",
"lastExitCode": 0,
"lastExitTime": null,
"lastExecTime": null
}Run Script
/api/scripts/{id}/runResponse
{
"status": "running"
}Stop Script
/api/scripts/{id}/stopResponse
{
"status": "stopped"
}Delete Script
/api/scripts/{id}204 No Content on success (empty body).Script Logs
/api/scripts/{id}/logssince query parameter (RFC3339 or Unix timestamp) to only return logs after that time.Response
{
"text": "Script execution logs here..."
}Guides & Tutorials
Hands-on walkthroughs for building on co-located Ethereum nodes with BLAZED.sh.