API Documentation

Complete API reference for BLAZED.sh - Deploy containers and scripts on our Web3 PaaS platform.

Authentication

API Key Authentication
All API requests require authentication using your API key.

Base URL

https://api.blazed.sh

Authentication Header

Authorization: Bearer YOUR_API_KEY

Content Type

Content-Type: application/json

Containers API

Create Container

POST
/containers
Deploy a new Docker container on the BLAZED.sh platform.

Request Body

{
  "name": "my-app",
  "image": "nginx:latest",
  "env": {
    "NODE_ENV": "production",
    "PORT": "3000"
  },
  "ports": [
    {
      "containerPort": 3000,
      "hostPort": 8080,
      "protocol": "tcp"
    }
  ],
  "tty": true
}

Response

{
  "id": "cont_abc123",
  "name": "my-app",
  "status": "running",
  "image": "nginx:latest",
  "created_at": "2025-01-19T10:30:00Z",
  "url": "https://my-app-abc123.blazed.sh"
}

List Containers

GET
/containers
Retrieve a list of all your containers.

Response

{
  "containers": [
    {
      "id": "cont_abc123",
      "name": "my-app",
      "status": "running",
      "image": "nginx:latest",
      "created_at": "2025-01-19T10:30:00Z",
      "url": "https://my-app-abc123.blazed.sh"
    }
  ],
  "total": 1
}

Get Container

GET
/containers/{id}
Get detailed information about a specific container.

Response

{
  "id": "cont_abc123",
  "name": "my-app",
  "status": "running",
  "image": "nginx:latest",
  "env": {
    "NODE_ENV": "production",
    "PORT": "3000"
  },
  "ports": [
    {
      "containerPort": 3000,
      "hostPort": 8080,
      "protocol": "tcp"
    }
  ],
  "tty": true,
  "created_at": "2025-01-19T10:30:00Z",
  "updated_at": "2025-01-19T10:30:00Z",
  "url": "https://my-app-abc123.blazed.sh"
}

Delete Container

DELETE
/containers/{id}
Permanently delete a container and all its data.

Response

{
  "message": "Container deleted successfully",
  "id": "cont_abc123"
}

Scripts API

Create Script

POST
/scripts
Create a new JavaScript script to run on Ethereum nodes.

Request Body

{
  "name": "eth-balance-checker",
  "code": "const Web3 = require('web3');\nconst web3 = new Web3();\n\nasync function checkBalance(address) {\n  const balance = await web3.eth.getBalance(address);\n  return web3.utils.fromWei(balance, 'ether');\n}\n\nmodule.exports = { checkBalance };"
}

Response

{
  "id": "script_xyz789",
  "name": "eth-balance-checker",
  "status": "active",
  "created_at": "2025-01-19T10:30:00Z",
  "url": "https://scripts.blazed.sh/script_xyz789"
}

List Scripts

GET
/scripts
Retrieve a list of all your scripts.

Response

{
  "scripts": [
    {
      "id": "script_xyz789",
      "name": "eth-balance-checker",
      "status": "active",
      "created_at": "2025-01-19T10:30:00Z",
      "url": "https://scripts.blazed.sh/script_xyz789"
    }
  ],
  "total": 1
}

Get Script

GET
/scripts/{id}
Get detailed information about a specific script.

Response

{
  "id": "script_xyz789",
  "name": "eth-balance-checker",
  "code": "const Web3 = require('web3');\nconst web3 = new Web3();\n\nasync function checkBalance(address) {\n  const balance = await web3.eth.getBalance(address);\n  return web3.utils.fromWei(balance, 'ether');\n}\n\nmodule.exports = { checkBalance };",
  "status": "active",
  "created_at": "2025-01-19T10:30:00Z",
  "updated_at": "2025-01-19T10:30:00Z",
  "url": "https://scripts.blazed.sh/script_xyz789"
}

Execute Script

POST
/scripts/{id}/execute
Execute a script on the Ethereum node.

Request Body

{
  "function": "checkBalance",
  "args": ["0x742C3cF9Af45f91B109a81EfAaf11535ECDe24C5"]
}

Response

{
  "execution_id": "exec_def456",
  "result": "12.45",
  "status": "completed",
  "executed_at": "2025-01-19T10:35:00Z",
  "execution_time_ms": 150
}

Delete Script

DELETE
/scripts/{id}
Permanently delete a script.

Response

{
  "message": "Script deleted successfully",
  "id": "script_xyz789"
}