{
  "manifest_version": "1.0.0",
  "template": {
    "id": "a860b342-a44d-4aa3-a090-1f36c25fbddb",
    "slug": "metapi",
    "name": "MetApi",
    "description": "Meta-gateway for AI APIs with smart routing & auto check-ins",
    "url": "https://railway.com/deploy/metapi",
    "upstream": {
      "image": "1467078763/metapi:latest"
    }
  },
  "services": [
    {
      "name": "MetApi",
      "source": {
        "image": "1467078763/metapi:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "TZ",
      "service": "MetApi",
      "description": "Timezone setting for cron jobs, check-ins, and log timestamps.",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "PORT",
      "service": "MetApi",
      "description": "Internal application listening port.",
      "secret": false,
      "strategy": "default",
      "default": "4000"
    },
    {
      "key": "DATA_DIR",
      "service": "MetApi",
      "description": "Absolute directory path for persistent SQLite database and runtime data storage.",
      "secret": false,
      "strategy": "default",
      "default": "/app/data"
    },
    {
      "key": "AUTH_TOKEN",
      "service": "MetApi",
      "description": "Secret admin login token for the dashboard.",
      "secret": true,
      "strategy": "default",
      "default": "change-me-admin-token"
    },
    {
      "key": "PROXY_TOKEN",
      "service": "MetApi",
      "description": "Bearer token used by downstream /v1/* proxy requests.",
      "secret": true,
      "strategy": "default",
      "default": "change-me-proxy-sk-token"
    },
    {
      "key": "CHECKIN_CRON",
      "service": "MetApi",
      "description": "Cron schedule for automated daily upstream check-in tasks.",
      "secret": false,
      "strategy": "default",
      "default": "0 8 * * *"
    },
    {
      "key": "BALANCE_REFRESH_CRON",
      "service": "MetApi",
      "description": "Cron schedule for automated hourly upstream balance updates.",
      "secret": false,
      "strategy": "default",
      "default": "0 * * * *"
    },
    {
      "key": "ACCOUNT_CREDENTIAL_SECRET",
      "service": "MetApi",
      "description": "Secret used to encrypt credentials; defaults to AUTH_TOKEN if omitted.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "metapi"
      }
    },
    "cli": "railway deploy --template metapi",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "a860b342-a44d-4aa3-a090-1f36c25fbddb",
            "serializedConfig": {
              "services": {
                "da5297c1-7d8c-40d9-b419-bcf9ef61eb44": {
                  "name": "MetApi",
                  "source": {
                    "image": "1467078763/metapi:latest"
                  },
                  "variables": {
                    "TZ": {
                      "description": "Timezone setting for cron jobs, check-ins, and log timestamps.",
                      "defaultValue": "UTC"
                    },
                    "PORT": {
                      "description": "Internal application listening port.",
                      "defaultValue": "4000"
                    },
                    "DATA_DIR": {
                      "description": "Absolute directory path for persistent SQLite database and runtime data storage.",
                      "defaultValue": "/app/data"
                    },
                    "AUTH_TOKEN": {
                      "description": "Secret admin login token for the dashboard.",
                      "defaultValue": "change-me-admin-token"
                    },
                    "PROXY_TOKEN": {
                      "description": "Bearer token used by downstream /v1/* proxy requests.",
                      "defaultValue": "change-me-proxy-sk-token"
                    },
                    "CHECKIN_CRON": {
                      "description": "Cron schedule for automated daily upstream check-in tasks.",
                      "defaultValue": "0 8 * * *"
                    },
                    "BALANCE_REFRESH_CRON": {
                      "description": "Cron schedule for automated hourly upstream balance updates.",
                      "defaultValue": "0 * * * *"
                    },
                    "ACCOUNT_CREDENTIAL_SECRET": {
                      "description": "Secret used to encrypt credentials; defaults to AUTH_TOKEN if omitted.",
                      "defaultValue": "${{AUTH_TOKEN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:4000": {
                        "port": 4000
                      }
                    }
                  },
                  "volumeMounts": {
                    "da5297c1-7d8c-40d9-b419-bcf9ef61eb44": {
                      "mountPath": "/app/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-11T04:14:34.944Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-11T00:26:04.014Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_886242814be54a34827e",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 57,
    "typical_build_seconds": 0,
    "typical_start_seconds": 0,
    "slowest_service": "MetApi"
  }
}
