Prerequisites
- Node.js >= 22.12.0
- pnpm (recommended; npm also works)
- API keys for the services you want to support (see Using your API keys)
Setup
Create a .env file
Create a See the environment variable reference below for details on each variable.
.env file at the root of the project. All variables are optional, but at minimum you should set OPENROUTER_API_KEY if your users will not be supplying their own OpenRouter key.Environment variables
Threat intelligence source keys
Threat intelligence source keys
These keys are used as server-side fallbacks. When a user does not supply their own key via request headers or the UI settings modal, CyberThreat AI falls back to these values. If a key is absent from both the user’s request and the environment, that source is skipped or queried without authentication.
| Variable | Service | Required |
|---|---|---|
VIRUSTOTAL_API_KEY | VirusTotal — IP, domain, and hash lookups | No |
ABUSEIPDB_API_KEY | AbuseIPDB — IP reputation | No |
POLYSWARM_API_KEY | PolySwarm — hash analysis | No |
Robtex does not require an API key and has no corresponding environment variable.
OpenRouter key
OpenRouter key
| Variable | Description | Required |
|---|---|---|
OPENROUTER_API_KEY | Server-side fallback key for OpenRouter. Used when a user has not set their own OpenRouter key. | Required if users won’t supply their own |
Rate limiting
Rate limiting
CyberThreat AI enforces a per-IP rate limit on the
With the defaults, each IP address can submit up to 5 analysis requests per 60-second window. Requests beyond this limit receive a
/api/ctai endpoint. These variables control the window size and request allowance.| Variable | Description | Default |
|---|---|---|
RATE_LIMIT_POINTS | Maximum number of requests allowed per IP within the duration window | 5 |
RATE_LIMIT_DURATION | Duration of the rate limit window, in seconds | 60 |
429 Too Many Requests response with a retryAfterSeconds field.Docker and Dokploy
The application builds to a standalone Node.js server (dist/server/entry.mjs), which makes it straightforward to containerize. You can wrap it in a standard Node.js Docker image, expose port 4321, and pass your environment variables at runtime.
If you use Dokploy for deployment, point it at the repository and configure your environment variables in the Dokploy dashboard. The standalone Astro output requires no additional server configuration beyond a Node.js runtime.