{
  "manifest_version": "1.0.0",
  "template": {
    "id": "6de53b6b-f726-4745-a27a-747a03d5dd26",
    "slug": "9router-self-hosted-ai-gateway-and-route",
    "name": "9Router (Self-Hosted AI Gateway & Router)",
    "description": "Self-hosted AI gateway: one OpenAI-compatible API for 60+ LLM providers",
    "url": "https://railway.com/deploy/9router-self-hosted-ai-gateway-and-route",
    "upstream": {
      "image": "decolua/9router:latest"
    }
  },
  "services": [
    {
      "name": "9Router",
      "source": {
        "image": "decolua/9router:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "9Router",
      "description": "Port the 9Router web app listens on",
      "secret": false,
      "strategy": "default",
      "default": "20128"
    },
    {
      "key": "BASE_URL",
      "service": "9Router",
      "description": "Public URL of this deployment",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DATA_DIR",
      "service": "9Router",
      "description": "Persistent data directory (volume)",
      "secret": false,
      "strategy": "default",
      "default": "/app/data"
    },
    {
      "key": "HOSTNAME",
      "service": "9Router",
      "description": "Bind to all interfaces",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "NODE_ENV",
      "service": "9Router",
      "description": "Run in production mode",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "CLOUD_URL",
      "service": "9Router",
      "description": "9Router cloud URL (model catalog & pricing sync)",
      "secret": false,
      "strategy": "default",
      "default": "https://9router.com"
    },
    {
      "key": "JWT_SECRET",
      "service": "9Router",
      "description": "Secret used to sign dashboard sessions (generated)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "API_KEY_SECRET",
      "service": "9Router",
      "description": "Secret used to derive API credentials (generated)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MACHINE_ID_SALT",
      "service": "9Router",
      "description": "Salt for the machine identifier (generated)",
      "secret": false,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PUBLIC_BASE_URL",
      "service": "9Router",
      "description": "Public URL exposed to the browser",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "NEXT_PUBLIC_CLOUD_URL",
      "service": "9Router",
      "description": "9Router cloud URL for the frontend",
      "secret": false,
      "strategy": "default",
      "default": "https://9router.com"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "9router-self-hosted-ai-gateway-and-route"
      }
    },
    "cli": "railway deploy --template 9router-self-hosted-ai-gateway-and-route",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "6de53b6b-f726-4745-a27a-747a03d5dd26",
            "serializedConfig": {
              "services": {
                "d5ec1a23-64e5-46ee-892e-f469b96de2ca": {
                  "icon": "https://i.imgur.com/yjb5HvR.png",
                  "name": "9Router",
                  "build": {},
                  "deploy": {
                    "startCommand": "sh -c 'while true; do echo \"$(date) - 9Router is active\"; sleep 30; done & exec node server.js'",
                    "healthcheckPath": null
                  },
                  "source": {
                    "image": "decolua/9router:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port the 9Router web app listens on",
                      "defaultValue": "20128"
                    },
                    "BASE_URL": {
                      "isOptional": false,
                      "description": "Public URL of this deployment",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "DATA_DIR": {
                      "isOptional": false,
                      "description": "Persistent data directory (volume)",
                      "defaultValue": "/app/data"
                    },
                    "HOSTNAME": {
                      "isOptional": false,
                      "description": "Bind to all interfaces",
                      "defaultValue": "0.0.0.0"
                    },
                    "NODE_ENV": {
                      "isOptional": false,
                      "description": "Run in production mode",
                      "defaultValue": "production"
                    },
                    "CLOUD_URL": {
                      "isOptional": false,
                      "description": "9Router cloud URL (model catalog & pricing sync)",
                      "defaultValue": "https://9router.com"
                    },
                    "JWT_SECRET": {
                      "isOptional": false,
                      "description": "Secret used to sign dashboard sessions (generated)",
                      "defaultValue": "{{JWT_SECRET}}"
                    },
                    "API_KEY_SECRET": {
                      "isOptional": false,
                      "description": "Secret used to derive API credentials (generated)",
                      "defaultValue": "{{API_KEY_SECRET}}"
                    },
                    "MACHINE_ID_SALT": {
                      "isOptional": false,
                      "description": "Salt for the machine identifier (generated)",
                      "defaultValue": "{{MACHINE_ID_SALT}}"
                    },
                    "INITIAL_PASSWORD": {
                      "isOptional": true,
                      "description": "Optional admin password for first login. Leave empty to set it in the UI.",
                      "defaultValue": ""
                    },
                    "NEXT_PUBLIC_BASE_URL": {
                      "isOptional": false,
                      "description": "Public URL exposed to the browser",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "NEXT_PUBLIC_CLOUD_URL": {
                      "isOptional": false,
                      "description": "9Router cloud URL for the frontend",
                      "defaultValue": "https://9router.com"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {
                      "<hasDomain>:20128": {}
                    }
                  },
                  "volumeMounts": {
                    "c196972e-8dc3-41a1-941b-9a5fd322fcc1": {
                      "mountPath": "/app/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-17T22:14:38.342Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-17T19:57:02.539Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_5088fc3e2226465a9d42",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 97,
    "typical_build_seconds": 0,
    "typical_start_seconds": 0,
    "slowest_service": "9Router"
  }
}
