Configuration
Environment variables, Docker and the optional native PoW solver.
Environment variables
All configuration is environment-driven (.env or exported vars). Provider credentials are documented in
Account setup.
| Variable | Default | Description |
|---|---|---|
| DANYAPI_HOST | 0.0.0.0 | Address the API server binds to |
| DANYAPI_PORT | 8000 | Port the API server listens on |
| DANYAPI_TIMEOUT | 60 | Upstream request timeout in seconds |
| DANYAPI_ACQUIRE_TIMEOUT | (empty) | Seconds to wait for a free account before returning 429; empty = wait forever |
| DANYAPI_SESSION_CACHE_SIZE | 128 | Max server-side chats cached per provider (LRU) for stateless session reuse |
| DANYAPI_SESSION_TTL_SECONDS | 3600 | Seconds an unused session/context stays reusable; 0 = never expire |
| DANYAPI_CACHE_DIR | (empty) | Directory for the on-disk session cache; empty = system temp dir (%TEMP%\danyapi / /tmp/danyapi) |
| DANYAPI_CACHE_DISABLED | (empty) | Set to 1/true/yes/on to disable the on-disk cache entirely |
| DANYAPI_LOG_LEVEL | INFO | Log level: DEBUG, INFO, WARNING, ERROR |
| DANYAPI_LOG_FILE | (empty) | File path for persistent logs; empty = console only |
| DANYAPI_LOG_MAX_BYTES | 10485760 | Max log file size in bytes before rotation |
| DANYAPI_LOG_BACKUP_COUNT | 3 | Number of rotated log files to keep |
| DANYAPI_HUMAN_DELAY_MIN | 0.5 | Minimum delay in seconds before sending a request (uniform random jitter) |
| DANYAPI_HUMAN_DELAY_MAX | 3.0 | Maximum delay in seconds; set both to 0 to disable |
| DANYAPI_AUTO_UPDATE | 1 | Auto-update to the latest GitHub release on each start; 0 disables |
Docker
docker build -t danyapi .
docker run -d -p 8000:8000 \
-e DEEPSEEK_TOKENS="token1,token2" \
-e QWEN_TOKENS="token3" \
danyapi
The .env file is not baked into the image; pass credentials as environment
variables or mount your .env as a volume (-v /path/to/.env:/app/.env).
Prebuilt image (GHCR)
CI builds and pushes the image to the GitHub Container Registry on every push
to main (latest and sha-* tags) and on version tags (v1.2.3):
docker run -d -p 8000:8000 \
-e DEEPSEEK_TOKENS="token1,token2" \
-e QWEN_TOKENS="token3" \
ghcr.io/fanatfanata/danyapi:latest
Native PoW solver (optional)
If you have a C compiler (clang or gcc), build the binary for maximum speed:
clang -O2 -o danyapi/deepseek/pow_solver.exe danyapi/deepseek/pow_solver.c # Windows
clang -O2 -o danyapi/deepseek/pow_solver danyapi/deepseek/pow_solver.c # Linux/macOS
The prebuilt Docker image compiles this binary at build time, so container users get the native solver out of the box.
Solvers are tried in order until one succeeds: native binary → Node solver (the site's wasm module) → pure-Python Keccak fallback (capped at 2M iterations, so it only handles low difficulties). Each solved header is single-use; the next challenge is prefetched in the background so the next request does not wait.