← 返回 Skills 市场
stanestane

Civitai API

作者 Stanislav Stankovic · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
86
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install civitai-api
功能描述
Query the Civitai public REST API to search models, inspect creators, fetch model or version details, reverse-lookup models by hash, list images or tags, and...
使用说明 (SKILL.md)

Civitai API

Use this skill to work with Civitai from the local workspace without re-deriving endpoints and auth each time.

Quick start

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

Workflow

1. Find the thing

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.

2. Expand the record

Once you have a model id, inspect the full model payload:

python .\skills\civitai-api\scripts\civitai.py model \x3CmodelId>

Use this to pull:

  • version ids
  • files and hashes
  • tags
  • creator info
  • images
  • download URLs already present in the payload

3. Inspect a specific version

When the user already knows the version id, or you need file-level details:

python .\skills\civitai-api\scripts\civitai.py version \x3CmodelVersionId>

4. Reverse-lookup by hash

When the user has a local file hash and wants to identify it:

python .\skills\civitai-api\scripts\civitai.py by-hash \x3Chash>

5. Build a direct download URL

When the user wants an authenticated download URL, build it with:

python .\skills\civitai-api\scripts\civitai.py download-url \x3CmodelVersionId>

Optional download selectors:

  • --type
  • --format
  • --size
  • --fp

Use the generated URL directly in a browser or another download tool. Treat the resulting URL as sensitive because it may include ?token=....

Pagination note

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.

Auth rules

  • Prefer Authorization: Bearer \x3Ctoken> for JSON API calls.
  • Use ?token=\x3Ctoken> only for direct download URLs.
  • Keep tokens in .env, not in the skill files.

References

Read references/api-notes.md when you need a compact reminder of endpoints, auth, filters, and workflow hints.

安全使用建议
This skill appears to do what it says, but before installing: (1) avoid committing your .env to source control — store CIVITAI_API_KEY in a secure place; (2) be aware that the script will read a .env in the skill folder or parent and will set any keys it finds as environment variables — keep only the needed CIVITAI_API_KEY there; (3) treat any printed download URL (which may include ?token=...) as sensitive and do not paste it into public chat; (4) if you prefer, pass the token via the --token flag or set CIVITAI_API_KEY in your environment rather than leaving it in workspace files; (5) optionally review the script (scripts/civitai.py) locally before use to confirm network calls go to civitai.com as expected.
功能分析
Type: OpenClaw Skill Name: civitai-api Version: 1.0.0 The civitai-api skill is a legitimate tool for interacting with the Civitai REST API. The Python script (scripts/civitai.py) uses the standard library to perform searches, lookups, and generate download URLs. It follows security best practices by instructing users to store API keys in a .env file and warns about the sensitivity of authenticated download URLs. No malicious patterns, such as data exfiltration or unauthorized execution, were found.
能力评估
Purpose & Capability
The skill name/description, SKILL.md, reference notes, and the Python script all consistently implement a client for the Civitai public REST API. No unrelated services, binaries, or credentials are requested.
Instruction Scope
SKILL.md limits workflow to searching models, versions, images, tags, reverse-hashing, and building authenticated download URLs. The bundled script follows those instructions and only accesses the workspace .env (script dir or parent) plus the environment. One operational note: the script will print download URLs and will include a ?token=... query param if a token is provided, so those outputs are sensitive and can leak the token if shared.
Install Mechanism
No install spec is provided (instruction-only with one helper script). Nothing is downloaded or written to arbitrary system locations by the skill itself.
Credentials
The skill does not declare required env vars but reasonably relies on CIVITAI_API_KEY (SKILL.md recommends storing it in .env). This is proportional to the purpose. Caution: the script loads any key=value pairs from a .env located in the skill directory or its parent and sets them into the process environment (os.environ.setdefault), so if other secrets are present in that .env they would become environment variables for the script. Also, printed download URLs may embed the token.
Persistence & Privilege
The skill does not request permanent/system-wide presence (always:false), does not modify other skills or global agent config, and only runs as invoked. Autonomous invocation is allowed by default but is normal and not a special privilege here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install civitai-api
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /civitai-api 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Civitai public REST API search, detail, hash lookup, image/tag/creator search, download URL builder, and cursor pagination support.
元数据
Slug civitai-api
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Civitai API 是什么?

Query the Civitai public REST API to search models, inspect creators, fetch model or version details, reverse-lookup models by hash, list images or tags, and... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 86 次。

如何安装 Civitai API?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install civitai-api」即可一键安装,无需额外配置。

Civitai API 是免费的吗?

是的,Civitai API 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Civitai API 支持哪些平台?

Civitai API 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Civitai API?

由 Stanislav Stankovic(@stanestane)开发并维护,当前版本 v1.0.0。

💬 留言讨论