add http api server

This commit is contained in:
2026-05-09 17:13:53 +08:00
parent f31409bdba
commit 2563ab8f70
5 changed files with 482 additions and 7 deletions

View File

@@ -10,3 +10,19 @@ GEMINI_API_KEY="MY_GEMINI_API_KEY"
# AI Studio automatically injects this at runtime with the Cloud Run service URL.
# Used for self-referential links, OAuth callbacks, and API endpoints.
APP_URL="MY_APP_URL"
# API_PORT: HTTP API server port. Frontend still runs on 3000 by default.
API_PORT="3002"
# API_AUTH_TOKEN: Optional token for API calls. Leave empty to disable auth.
# When set, send Authorization: Bearer <token> or x-api-key: <token>.
API_AUTH_TOKEN=""
# Gemini model defaults used by the API service.
GEMINI_IMAGE_MODEL="gemini-3.1-flash-image-preview"
GEMINI_TEXT_MODEL="gemini-2.5-flash"
# Upload limits.
API_MAX_FILE_MB="25"
API_MAX_FILES="20"
API_JSON_LIMIT="50mb"