DanyAPI

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.

VariableDefaultDescription
DANYAPI_HOST0.0.0.0Address the API server binds to
DANYAPI_PORT8000Port the API server listens on
DANYAPI_TIMEOUT60Upstream request timeout in seconds
DANYAPI_ACQUIRE_TIMEOUT(empty)Seconds to wait for a free account before returning 429; empty = wait forever
DANYAPI_SESSION_CACHE_SIZE128Max server-side chats cached per provider (LRU) for stateless session reuse
DANYAPI_SESSION_TTL_SECONDS3600Seconds 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_LEVELINFOLog level: DEBUG, INFO, WARNING, ERROR
DANYAPI_LOG_FILE(empty)File path for persistent logs; empty = console only
DANYAPI_LOG_MAX_BYTES10485760Max log file size in bytes before rotation
DANYAPI_LOG_BACKUP_COUNT3Number of rotated log files to keep
DANYAPI_HUMAN_DELAY_MIN0.5Minimum delay in seconds before sending a request (uniform random jitter)
DANYAPI_HUMAN_DELAY_MAX3.0Maximum delay in seconds; set both to 0 to disable
DANYAPI_AUTO_UPDATE1Auto-update to the latest GitHub release on each start; 0 disables

Docker

bash
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):

bash
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:

bash
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.