Upload files to the self-hosted Lsky image bed (https://lsky.xueguo.us/api/v1), fetch the returned URLs/Markdown snippets, and manage albums or strategies via the REST API. Use this skill whenever you need to programmatically push screenshots/assets to Lsky and return shareable links inside Codex.
This skill wraps the Lsky Pro API used by your self-hosted image bed. It explains how to authenticate with personal tokens, how to call /upload, and provides a ready-to-run Python helper (scripts/upload_image.py) that handles headers, multipart form-data, and prints the resulting URLs/Markdown snippets. See references/api_overview.md for a condensed manual extracted from the official docs.
Bearer prefix).https://lsky.xueguo.us/api/v1. Override via the env var LSKY_BASE_URL or the --base-url flag if your deployment differs.$env:LSKY_TOKEN='1|xxxx', bash: export LSKY_TOKEN=1|xxxx).python scripts/upload_image.py path/to/file.png.--album-id, --strategy-id, --permission 0|1, --name custom-display-name..lsky_upload_cache.json.links.url is the canonical image URL, links.markdown can be pasted into blog Markdown, links.delete_url lets you remove the asset later.Lsky API error: ..., inspect the message/HTTP status and cross-check rate limits or permissions.When custom logic is needed, follow these HTTP patterns (details in references/api_overview.md):
POST /upload: multipart form-data with file plus optional album_id, strategy_id, permission, name.GET /images?page=1&limit=50&order=latest: pagination response contains data.total and data.data[], each item exposing links, id, album_id, etc.GET /albums, POST /albums, DELETE /albums/:id: useful for separating assets per project.DELETE /images/:id: image IDs are available via the list endpoint or the upload response (data.image.id).X-RateLimit-Remaining and pause when it hits zero to avoid HTTP 429.scripts/upload_image.py
requests (install via pip install requests if missing).LSKY_TOKEN (required unless you pass --token)LSKY_BASE_URL (defaults to https://lsky.xueguo.us/api/v1)0 = successFor automation, capture stdout and parse the final JSON block:
python scripts/upload_image.py demo.png --token "$LSKY_TOKEN" \
--base-url https://lsky.xueguo.us/api/v1 > upload.json
Then feed into jq or PowerShell ConvertFrom-Json.
allow_suffixes and max_size configured in Lsky.verify=False (not recommended) or install the CA cert on the machine.scripts/upload_image.py - helper script for uploads.