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
累計下載
4148
星標
5
全站排名
#2,425
全站前 48% · 「設計創意」前 46%
平台累計安裝累計下載星標評論
ClawHub ↗12437815-
SkillHub ↗44341485—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

可選擇模型、尺寸、種子和生成引數,使用Python標準庫。需要Krea憑證;文件提供受許可權保護的憑證檔案配置,禁止展示其內容。此實現無webhook支援,模型和介面實際可用性需確認。

資料釋出於 2026-10-27

可以用來做什麼

  • 準備可配置的圖像生成任務

什麼時候用

  • 已有Krea認證並需要呼叫圖像API時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

整理圖像提示詞與模型引數,確認憑證可用但不要顯示秘密,再提交經確認的任務。

月度資料趨勢

累計下載4148
3037363442302026-03 · 累計下載 31192026-05 · 累計下載 34092026-06 · 累計下載 33142026-07 · 累計下載 36812026-08 · 累計下載 37622026-09 · 累計下載 414826-0326-09
星標5
4562026-03 · 星標 52026-05 · 星標 52026-06 · 星標 52026-07 · 星標 52026-08 · 星標 52026-09 · 星標 526-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094148—5
2026-083762+2.2%5
2026-073681+11.1%5
2026-063314-2.8%5
2026-053409—5
2026-033119—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),按月更新。口徑說明見資料方法。