{
  "manifest_version": "1.0.0",
  "template": {
    "id": "387e609e-acc2-4bb4-87c3-6e4d7ac71a59",
    "slug": "new-api-gateway",
    "name": "New API | AI Gateway for OpenAI, Claude and Gemini (One API Fork)",
    "description": "New API LLM gateway: one key for OpenAI, Claude, Gemini; usage and quotas",
    "url": "https://railway.com/deploy/new-api-gateway",
    "upstream": {
      "repo_url": "https://github.com/two-workspaces/new-api"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "New API",
      "source": {
        "repo": "https://github.com/two-workspaces/new-api"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Data subdirectory - keeps Postgres happy on Railway volumes",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database name",
      "secret": false,
      "strategy": "default",
      "default": "newapi"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Database user",
      "secret": false,
      "strategy": "default",
      "default": "newapi"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Auto-generated database password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Time for Postgres to shut down cleanly on redeploy",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "TZ",
      "service": "New API",
      "description": "Time zone for logs and usage charts, e.g. Europe/Berlin",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "PORT",
      "service": "New API",
      "description": "Port New API listens on - leave as is",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "SQL_DSN",
      "service": "New API",
      "description": "Postgres connection - leave as is",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "CRYPTO_SECRET",
      "service": "New API",
      "description": "Encrypts stored data - auto-generated; keep it with your backups and never change it",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "SESSION_SECRET",
      "service": "New API",
      "description": "Signs login sessions - auto-generated",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "ERROR_LOG_ENABLED",
      "service": "New API",
      "description": "Keep failed upstream requests in the logs page",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "BATCH_UPDATE_ENABLED",
      "service": "New API",
      "description": "Batch usage writes to the database to cut load",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "MEMORY_CACHE_ENABLED",
      "service": "New API",
      "description": "Cache users, tokens and channels in memory (no Redis needed for one instance)",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "NEW_API_ADMIN_PASSWORD",
      "service": "New API",
      "description": "Admin password, set on first boot only - copy it from here to log in, then change it in New API",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "NEW_API_ADMIN_USERNAME",
      "service": "New API",
      "description": "Admin username (12 characters max), created on first boot so the setup page is never open to strangers",
      "secret": false,
      "strategy": "default",
      "default": "root"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "new-api-gateway"
      }
    },
    "cli": "railway deploy --template new-api-gateway",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "387e609e-acc2-4bb4-87c3-6e4d7ac71a59",
            "serializedConfig": {
              "services": {
                "7850802f-681f-405f-8c60-7bf5150d4754": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "build": {},
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data subdirectory - keeps Postgres happy on Railway volumes",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "newapi"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database user",
                      "defaultValue": "newapi"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated database password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Time for Postgres to shut down cleanly on redeploy",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "7850802f-681f-405f-8c60-7bf5150d4754": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "fd3354af-c2c8-40b9-8a7c-08a71e43c60a": {
                  "icon": "https://raw.githubusercontent.com/two-workspaces/new-api/main/icon.png",
                  "name": "New API",
                  "build": {},
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/status",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/two-workspaces/new-api",
                    "rootDirectory": null
                  },
                  "variables": {
                    "TZ": {
                      "isOptional": false,
                      "description": "Time zone for logs and usage charts, e.g. Europe/Berlin",
                      "defaultValue": "UTC"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "Port New API listens on - leave as is",
                      "defaultValue": "3000"
                    },
                    "SQL_DSN": {
                      "isOptional": false,
                      "description": "Postgres connection - leave as is",
                      "defaultValue": "postgresql://${{Postgres.POSTGRES_USER}}:${{Postgres.POSTGRES_PASSWORD}}@${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{Postgres.POSTGRES_DB}}"
                    },
                    "CRYPTO_SECRET": {
                      "isOptional": false,
                      "description": "Encrypts stored data - auto-generated; keep it with your backups and never change it",
                      "defaultValue": "{{CRYPTO_SECRET}}"
                    },
                    "SESSION_SECRET": {
                      "isOptional": false,
                      "description": "Signs login sessions - auto-generated",
                      "defaultValue": "{{SESSION_SECRET}}"
                    },
                    "ERROR_LOG_ENABLED": {
                      "isOptional": false,
                      "description": "Keep failed upstream requests in the logs page",
                      "defaultValue": "true"
                    },
                    "BATCH_UPDATE_ENABLED": {
                      "isOptional": false,
                      "description": "Batch usage writes to the database to cut load",
                      "defaultValue": "true"
                    },
                    "MEMORY_CACHE_ENABLED": {
                      "isOptional": false,
                      "description": "Cache users, tokens and channels in memory (no Redis needed for one instance)",
                      "defaultValue": "true"
                    },
                    "NEW_API_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Admin password, set on first boot only - copy it from here to log in, then change it in New API",
                      "defaultValue": "{{NEW_API_ADMIN_PASSWORD}}"
                    },
                    "NEW_API_ADMIN_USERNAME": {
                      "isOptional": false,
                      "description": "Admin username (12 characters max), created on first boot so the setup page is never open to strangers",
                      "defaultValue": "root"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {}
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "New API",
      "method": "GET",
      "path": "/api/status",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-11-07T16:15:10.050Z",
  "generator_version": "0.1.0"
}
