Skip to main content
POST
/
api
/
v1
/
builders
Create a builder from your own code
curl --request POST \
  --url https://{subdomain}.mihu.ai/api/v1/builders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "my-api",
  "entrypoint": "python3 main.py",
  "files": {
    "main.py": "...source...",
    "requirements.txt": "flask"
  },
  "port": 8000,
  "env": {
    "MY_FLAG": "1"
  },
  "resources": {
    "cpu": 1,
    "memory": 1,
    "disk": 3
  },
  "job_type": "always_on",
  "backup_interval_hours": 0
}
'
{
  "success": true,
  "message": "Builder created successfully",
  "data": {
    "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "lead-watcher",
    "preview_url": "<string>",
    "service_token": "<string>",
    "entrypoint": "python3 main.py",
    "port": 8000,
    "auto_stop_interval": 0,
    "backup_interval_hours": 0,
    "review_passed": true,
    "qa_passed": true,
    "cost": {
      "currency": "EUR",
      "hourly_rate": 0.1965,
      "runtime_hours": 1.5,
      "cost": 0.29
    },
    "created_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"

Body

application/json
name
string
required

Builder name (lowercase letters, digits, dashes).

Example:

"my-api"

entrypoint
string
required

Command that starts your app. It must listen on 0.0.0.0 at port.

Example:

"python3 main.py"

files
object
required

Map of relative path → file contents. Include requirements.txt to pip-install before start.

Example:
{
"main.py": "...source...",
"requirements.txt": "flask"
}
port
integer

Port your app listens on. Default 8000.

Example:

8000

env
object

Non-secret environment variables.

Example:
{ "MY_FLAG": "1" }
resources
object

VM size. Defaults to 1 vCPU / 1 GB / 3 GB.

job_type
enum<string>
Available options:
always_on,
one_time
Example:

"always_on"

backup_interval_hours
integer

0 disables backups.

Example:

0

Response

Builder created and running.

success
boolean
Example:

true

message
string
Example:

"Builder created successfully"

data
object

A deployed builder (your code or an AI-generated app) running on a cloud sandbox.