{
  "manifest_version": "1.0.0",
  "template": {
    "id": "9deb86af-9f05-4654-ad30-3e236a0e905a",
    "slug": "cliproxyapi-self-hosted",
    "name": "CLIProxyAPI (Self-Hosted)",
    "description": "Self-host CLIProxyAPI with persistent accounts and sticky sessions.",
    "url": "https://railway.com/deploy/cliproxyapi-self-hosted",
    "upstream": {
      "image": "ghcr.io/hosmelq/railway-cliproxyapi-template:latest"
    }
  },
  "services": [
    {
      "name": "CLIProxyAPI",
      "source": {
        "image": "ghcr.io/hosmelq/railway-cliproxyapi-template:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "TZ",
      "service": "CLIProxyAPI",
      "description": "IANA time zone for the service, such as UTC or America/Managua.",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "PORT",
      "service": "CLIProxyAPI",
      "description": "Listening port for CLIProxyAPI and Railway health checks. Keep this at 8317 unless you also update the saved server configuration and domain target port.",
      "secret": false,
      "strategy": "default",
      "default": "8317"
    },
    {
      "key": "INITIAL_API_KEY",
      "service": "CLIProxyAPI",
      "description": "Generated client key, applied only when /data/config.yaml is first created. Copy it into your client. After first boot, save key changes in Management Center and restart the service; this variable does not overwrite saved keys.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MANAGEMENT_PASSWORD",
      "service": "CLIProxyAPI",
      "description": "Generated administrator key for /management.html and /v8/management. Keep it separate from client keys. To rotate it, change this variable and redeploy. It must contain at least 32 characters.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "cliproxyapi-self-hosted"
      }
    },
    "cli": "railway deploy --template cliproxyapi-self-hosted",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "9deb86af-9f05-4654-ad30-3e236a0e905a",
            "serializedConfig": {
              "services": {
                "41656305-d60c-40da-bcd8-e00b52294abe": {
                  "icon": "https://raw.githubusercontent.com/router-for-me/Cli-Proxy-API-Management-Center/main/logo.jpg",
                  "name": "CLIProxyAPI",
                  "deploy": {
                    "startCommand": "",
                    "healthcheckPath": "/healthz"
                  },
                  "source": {
                    "image": "ghcr.io/hosmelq/railway-cliproxyapi-template:latest"
                  },
                  "variables": {
                    "TZ": {
                      "isOptional": false,
                      "description": "IANA time zone for the service, such as UTC or America/Managua.",
                      "defaultValue": "UTC"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "Listening port for CLIProxyAPI and Railway health checks. Keep this at 8317 unless you also update the saved server configuration and domain target port.",
                      "defaultValue": "8317"
                    },
                    "INITIAL_API_KEY": {
                      "isOptional": false,
                      "description": "Generated client key, applied only when /data/config.yaml is first created. Copy it into your client. After first boot, save key changes in Management Center and restart the service; this variable does not overwrite saved keys.",
                      "defaultValue": "{{INITIAL_API_KEY}}"
                    },
                    "MANAGEMENT_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated administrator key for /management.html and /v8/management. Keep it separate from client keys. To rotate it, change this variable and redeploy. It must contain at least 32 characters.",
                      "defaultValue": "{{MANAGEMENT_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8317": {
                        "port": 8317
                      }
                    }
                  },
                  "volumeMounts": {
                    "41656305-d60c-40da-bcd8-e00b52294abe": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "CLIProxyAPI",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-10-18T16:14:44.681Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-10-18T14:49:16.692Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_4af6e34c31b44ddbb405",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 17,
    "typical_build_seconds": 0,
    "typical_start_seconds": 0,
    "slowest_service": "CLIProxyAPI"
  }
}
