Use this skill to work with Civitai from the local workspace without re-deriving endpoints and auth each time.
Store the token in the workspace .env file as:
CIVITAI_API_KEY=...
Use the bundled script:
python .\skills\civitai-api\scripts\civitai.py models --query "flux lora" --limit 5
python .\skills\civitai-api\scripts\civitai.py model 12345
python .\skills\civitai-api\scripts\civitai.py version 67890
python .\skills\civitai-api\scripts\civitai.py by-hash SHA256_OR_AUTOV2_HASH
python .\skills\civitai-api\scripts\civitai.py creators --query "someuser"
python .\skills\civitai-api\scripts\civitai.py tags --query anime
python .\skills\civitai-api\scripts\civitai.py images --model-id 12345 --limit 10
python .\skills\civitai-api\scripts\civitai.py download-url 67890
When the user has a vague name or concept, start with:
python .\skills\civitai-api\scripts\civitai.py models --query "search text" --limit 10
Useful optional filters include --types, --tag, --username, --sort, --period, --cursor, and --nsfw true|false.
Once you have a model id, inspect the full model payload:
python .\skills\civitai-api\scripts\civitai.py model <modelId>
Use this to pull:
When the user already knows the version id, or you need file-level details:
python .\skills\civitai-api\scripts\civitai.py version <modelVersionId>
When the user has a local file hash and wants to identify it:
python .\skills\civitai-api\scripts\civitai.py by-hash <hash>
When the user wants an authenticated download URL, build it with:
python .\skills\civitai-api\scripts\civitai.py download-url <modelVersionId>
Optional download selectors:
--type--format--size--fpUse the generated URL directly in a browser or another download tool. Treat the resulting URL as sensitive because it may include ?token=....
Civitai search endpoints may use cursor-based pagination. When the response includes metadata.nextCursor, pass that value back with --cursor instead of forcing --page on search queries.
Authorization: Bearer for JSON API calls.?token= only for direct download URLs..env, not in the skill files.Read references/api-notes.md when you need a compact reminder of endpoints, auth, filters, and workflow hints.
共 1 个版本