# Xiaobao Flow2api

> Skill for multimodal generation. Supports switching between `flow2api` and `geminiweb2api` providers through the bundled `flow2api-cli`. Always use the CLI instead of calling HTTP APIs directly.

- Skill: `xue-xiaobao/xiaobao-flow2api` (Agent Skill, multi-file: 6 files)
- Install (CLI): `npx skillmds@latest add xue-xiaobao/xiaobao-flow2api`
- Raw SKILL.md: https://api.skillmd.com/api/skills/xue-xiaobao/xiaobao-flow2api/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: xue-xiaobao (https://skillmd.com/u/xue-xiaobao)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/xue-xiaobao/xiaobao-flow2api

---


# Flow2API-Compatible Providers

This skill must use the bundled CLI instead of calling the HTTP API directly.

CLI path:

```bash
scripts/flow2api-cli
```

## Update Mode

Only enter update mode when the user explicitly asks to "update", "更新", "同步", or "refresh" this skill.

In that case:

- Read `UPDATE.md`
- Inspect the upstream `flow2api/` source and documentation
- Update the CLI first when API behavior or calling conventions change
- Update the skill text only when the entry workflow or routing rules change

If the user does not explicitly ask for an update, do not run the update workflow.

## Step 0: Read the CLI Help First

Before invoking the skill, read the CLI help:

```bash
scripts/flow2api-cli --help
```

The help output is the canonical place for:

- Single JSON input mode
- JSON parameter format
- Supported subcommands
- Supported model groups
- Default config keys
- `.env` lookup order

Do not duplicate CLI usage instructions anywhere else in this skill.

## Step 1: Load Default Config from `.env`

This skill uses `.env`-based configuration through `flow2api-cli`.

Default lookup order:

1. `env_file` in the command input JSON
2. Current working directory `.env`
3. `.env`

Preferred `.env` keys:

- `FLOW2API_BASE_URL`
- `FLOW2API_API_KEY`
- `FLOW2API_DEFAULT_IMAGE_MODEL`
- `FLOW2API_DEFAULT_VIDEO_MODEL`
- `FLOW2API_DEFAULT_FIRST_LAST_FRAME_MODEL`
- `FLOW2API_DEFAULT_MULTI_IMAGE_VIDEO_MODEL`
- `FLOW2API_DEFAULT_VIDEO_UPSAMPLE_MODEL`
- `WEB2API_BASE_URL`
- `WEB2API_API_KEY`
- `WEB2API_DEFAULT_IMAGE_MODEL`
- `WEB2API_DEFAULT_UNDERSTANDING_MODEL`

Rules:

- Prefer `.env`
- Keep `base_url` as origin only, without `/v1`, `/models`, or `/api`
- Default provider is `geminiweb2api`
- When the user wants Flow2API behavior or video capabilities, set `provider` to `flow2api`
- If the user provides another base URL or API key for the current task, pass it through the command input JSON
- All request values should be passed through one JSON input source
- The JSON input source may come from `--input`, a JSON file path passed to `--input`, or stdin

## Step 2: Choose the Correct CLI Command

Use these CLI commands:

- Health check: `health`
- OpenAI model list: `list-openai-models`
- Alias list: `list-aliases`
- Gemini model list: `list-gemini-models`
- Gemini model lookup: `get-model`
- OpenAI-compatible image generation: `openai-image`
- Gemini-native image generation: `gemini-image`
- Text-to-video: `text-to-video`
- First-last-frame video: `first-last-frame-video`
- Multi-image video: `multi-image-video`
- Video upsample: `video-upsample`

## Step 3: Check API Semantics from Upstream Sources

If you need to verify request semantics, supported models, streaming behavior, or protocol differences, inspect the upstream provider materials directly instead of reading local reference notes.

Preferred source order for `flow2api`:

1. `flow2api/src/api/routes.py`
2. `flow2api/README.md`
3. `flow2api/tests/test_api_routes.py`
4. `flow2api/tests/test_gemini_generate_content.py`
5. Other relevant files under `flow2api/src/` when needed

Preferred source order for `geminiweb2api`:

1. `geminiweb2api/src/geminiweb2api/main.py`
2. `geminiweb2api/src/geminiweb2api/model_registry.py`
3. `geminiweb2api/README.md`
4. `geminiweb2api/tests/test_api.py`
5. Other relevant files under `geminiweb2api/src/` when needed

Rules:

- Treat upstream code and tests as the source of truth
- Prefer code and tests over README when they disagree
- Do not call the HTTP endpoint directly when the CLI can do it
- If a capability is missing in the CLI, extend the CLI first, then use it
- For `geminiweb2api`, note that video commands are currently unsupported

## Step 4: Result Handling

The CLI is responsible for output normalization.

Rules:

- If the interface produces URL links, the CLI should print the URL links
- If `output_path` is provided, the CLI should download URL resources to that path
- If the response contains inline binary data instead of a URL, the CLI may save it to `output_path`
- Prefer the CLI output over raw API JSON when reporting generation results

## Step 5: Command Construction Rules

- Pass all request values through CLI arguments
- Use one JSON input source per command
- Prefer the category-specific command over manually composing raw request bodies
- Use `--request` only when a full custom payload is necessary
- Use default models from config when the user does not specify a model
- For Gemini-native image generation, use `gemini-image`
- For OpenAI-compatible generation and all video generation flows, use the corresponding OpenAI-style command

## Notes

- `flow2api-cli --help` is the source of truth for CLI usage
- Upstream `flow2api` code, README, and tests are the source of truth for API semantics
- Keep this skill focused on routing through the CLI, not on re-documenting every API shape locally

