TopRank Skills

Home / Claw Skills / API 集成 / Krea Api
Official OpenClaw rules 36%

Krea Api

Krea.ai Image Generation Skill

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 Krea Api 技能。 若已安装,则直接安装 Krea Api 技能。

Overview

Skill Key
fossilizedcarlos/krea-api
Author
fossilizedcarlos
Source Repo
openclaw/skills
Version
-
Source Path
skills/fossilizedcarlos/krea-api
Latest Commit SHA
6ca83503d7658a4dfbf20ba82eff6395ca58f4f7

Extracted Content

SKILL.md excerpt

# 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 =...

README excerpt

# Krea.ai API Skill

See [SKILL.md](./SKILL.md) for full documentation.

## Quick Start

```bash
# Generate an image (uses credentials from ~/.openclaw/credentials/krea.json)
python3 krea_api.py --prompt "A cute crab at a desk" --model flux

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

## Configure Credentials

Create the credentials file:
```bash
mkdir -p ~/.openclaw/credentials
echo '{"apiKey": "YOUR_KEY_ID:YOUR_SECRET"}' > ~/.openclaw/credentials/krea.json
chmod 600 ~/.openclaw/credentials/krea.json
```

Or pass directly via CLI:
```bash
python3 krea_api.py --prompt "..." --key-id YOUR_KEY_ID --secret YOUR_SECRET
```

## Publish to ClawHub

```bash
# Login once
clawdhub login

# Publish this skill folder
clawdhub publish . --slug krea-api --name "Krea.ai API"
```

## Requirements

- Python 3.7+
- No external dependencies (uses stdlib)

Related Claw Skills