Carlos E. Barboza

Krea.ai API

设计创意v0.2.4
作者:Carlos E. Barboza更新于 2026-05-11共 8 个版本 · 最新版本发布于 2026-02-20krea-api@clawhub_fossilizedcarlos/krea-api
图片生成#Image Generation

据 AlphaMoat 统计,截至 2026-09,Krea.ai API 累计下载 4,148 次、获 5 个星标,在全部 5,078 个 AI 技能中排名第 2,425 位,在「设计创意」分类(512 个)中排名第 233 位。

累计安装
443
累计下载
4,148
星标
5
全站排名
#2,425
全站前 48% · 「设计创意」前 46%
平台累计安装累计下载星标评论
ClawHub ↗1243,7815-
SkillHub ↗4434,1485—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

可选择模型、尺寸、种子和生成参数,使用Python标准库。需要Krea凭证;文档提供受权限保护的凭证文件配置,禁止展示其内容。此实现无webhook支持,模型和接口实际可用性需确认。

资料发布于 2026-10-27

可以用来做什么

  • 准备可配置的图像生成任务

什么时候用

  • 已有Krea认证并需要调用图像API时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

整理图像提示词与模型参数,确认凭证可用但不要显示秘密,再提交经确认的任务。

月度数据趋势

累计下载4,148
3,0373,6344,2302026-03 · 累计下载 3,1192026-05 · 累计下载 3,4092026-06 · 累计下载 3,3142026-07 · 累计下载 3,6812026-08 · 累计下载 3,7622026-09 · 累计下载 4,14826-0326-09
星标5
4562026-03 · 星标 52026-05 · 星标 52026-06 · 星标 52026-07 · 星标 52026-08 · 星标 52026-09 · 星标 526-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,148—5
2026-083,762+2.2%5
2026-073,681+11.1%5
2026-063,314-2.8%5
2026-053,409—5
2026-033,119—5

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

4.1 KB · ClawHub v0.2.4
---
name: krea-api
description: Generate images via Krea.ai API (Flux, Imagen, Ideogram, Seedream, etc.)
version: 0.2.4
metadata:
  credentials:
    - id: krea
      description: Krea.ai API key (format: KEY_ID:SECRET)
      envVar: null
      file: ~/.openclaw/credentials/krea.json
展开全部(共 168 行)
      required: true
---

# Krea.ai Image Generation Skill

Generate images using Krea.ai's API with support for multiple models including Flux, Imagen 4, Ideogram 3.0, and more.

## Features

- ✅ Async job-based generation (POST → poll → result)
- ✅ Support for multiple image models
- ✅ Configurable parameters (width, height, steps, guidance, seed)
- ✅ Stdlib-only dependencies (no `requests` required)
- ✅ Secure credential handling with file permissions

## Security

This skill prioritizes security:

- **No webhook support** - Removed to prevent SSRF risks
- **Stdlib dependencies** - Minimal attack surface (uses `urllib` only)
- **File-based credentials** - Primary credential source with secure permissions
- **Input validation** - All parameters validated before API calls

### Credential Sources (in order of precedence)

1. **CLI arguments**: `--key-id` and `--secret` (for one-off use)
2. **File**: `~/.openclaw/credentials/krea.json`

### Note on Subprocess

The `--usage` flag uses `webbrowser.open()` (stdlib) to open the usage dashboard in a browser. No subprocess calls.

## Setup

1. Get your Krea.ai API credentials from https://docs.krea.ai/developers/api-keys-and-billing
2. Create the credentials file:
```bash
mkdir -p ~/.openclaw/credentials
```

3. Add your credentials:
```bash
echo '{"apiKey": "YOUR_KEY_ID:YOUR_SECRET"}' > ~/.openclaw/credentials/krea.json
```

4. Set secure permissions:
```bash
chmod 600 ~/.openclaw/credentials/krea.json
```

## Usage

### Command Line

```bash
# Generate an image
python3 krea_api.py --prompt "A sunset over the ocean"

# With specific model
python3 krea_api.py --prompt "Cyberpunk city" --model imagen-4

# Custom size
python3 krea_api.py --prompt "Portrait" --width 1024 --height 1280

# List available models
python3 krea_api.py --list-models

# Check recent jobs
python3 krea_api.py --jobs 10
```

### Python Script

```python
from krea_api import KreaAPI

api = KreaAPI()  # Reads from ~/.openclaw/credentials/krea.json

# Generate and wait
urls = api.generate_and_wait(
    prompt="A serene Japanese garden",
    model="flux",
    width=1024,
    height=1024
)
print(urls)
```

### Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| prompt | str | required | Image description (max 1800 chars) |
| model | str | "flux" | Model name from table below |
| width | int | 1024 | Image width (512-2368) |
| height | int | 1024 | Image height (512-2368) |
| steps | int | 25 | Generation steps (1-100) |
| guidance_scale | float | 3.0 | Guidance scale (0-24) |
| seed | str | None | Random seed for reproducibility |

### Available Models

| Model | Best For |
|-------|----------|
| flux | General purpose, high quality |
| imagen-4 | Latest Google model |
| ideogram-3.0 | Text in images |
| seedream-4 | Fast generations |
| nano-banana | Quick previews |

Run `python3 krea_api.py --list-models` for full list.

## Check Usage

Krea.ai doesn't provide a public usage API. Check your usage at:

https://www.krea.ai/settings/usage-statistics

Or list recent jobs:

```bash
python3 krea_api.py --jobs 10
```

## File Locations

| Purpose | Path |
|---------|------|
| Credentials | `~/.openclaw/credentials/krea.json` |
| Script | `{skill}/krea_api.py` |
| Skill docs | `{skill}/SKILL.md` |

## Troubleshooting

### "API credentials required"

1. Check credentials file exists:
```bash
ls -la ~/.openclaw/credentials/krea.json
# Should show: -rw-------
```

2. Verify format (must have colon):
```json
{"apiKey": "KEY_ID:SECRET"}
```

⚠️ **Security**: Do NOT use `cat` to view the credentials file — it contains secrets.

### Model not found

Run `python3 krea_api.py --list-models` to see available models.

## Credits

Thanks to Claude Opus 4.5 for researching the correct API structure. The docs incorrectly suggest `/v1/images/flux` but the working endpoint is `/generate/image/bfl/flux-1-dev`.

「设计创意」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。