Flow2API-Compatible Providers
This skill must use the bundled CLI instead of calling the HTTP API directly.
CLI path:
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:
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
.envlookup 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:
env_filein the command input JSON- Current working directory
.env .env
Preferred .env keys:
FLOW2API_BASE_URLFLOW2API_API_KEYFLOW2API_DEFAULT_IMAGE_MODELFLOW2API_DEFAULT_VIDEO_MODELFLOW2API_DEFAULT_FIRST_LAST_FRAME_MODELFLOW2API_DEFAULT_MULTI_IMAGE_VIDEO_MODELFLOW2API_DEFAULT_VIDEO_UPSAMPLE_MODELWEB2API_BASE_URLWEB2API_API_KEYWEB2API_DEFAULT_IMAGE_MODELWEB2API_DEFAULT_UNDERSTANDING_MODEL
Rules:
- Prefer
.env - Keep
base_urlas origin only, without/v1,/models, or/api - Default provider is
geminiweb2api - When the user wants Flow2API behavior or video capabilities, set
providertoflow2api - 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:
flow2api/src/api/routes.pyflow2api/README.mdflow2api/tests/test_api_routes.pyflow2api/tests/test_gemini_generate_content.py- Other relevant files under
flow2api/src/when needed
Preferred source order for geminiweb2api:
geminiweb2api/src/geminiweb2api/main.pygeminiweb2api/src/geminiweb2api/model_registry.pygeminiweb2api/README.mdgeminiweb2api/tests/test_api.py- 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_pathis 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
--requestonly 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 --helpis the source of truth for CLI usage- Upstream
flow2apicode, 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