Agnes AI Generation
Call Agnes text, image, and video APIs through scripts/agnes_api.py. Read references/api.md for mode rules, raw HTTP payloads, and official sources. The bundled model snapshot records documentation rather than account access.
Setup and model selection
- Require
AGNES_API_KEY,AGNES_API_TOKEN, orAPIHUB_AGNES_API_KEYfor live requests. Never print credentials. - Use
modelswithout a key for the documented catalog.models --liveis experimental OpenAI-compatible discovery; a 2026-12-02 live response listed 13 IDs, including retired/deprecated IDs. Discovery does not prove invocation access or override lifecycle notes. - If a local IPv6 route causes TLS timeouts,
AGNES_FORCE_IPV4=1opts this script's requests into IPv4. TLS certificate/hostname checks remain enabled; system network settings are unchanged. - Defaults: text
agnes-3.0-flash, imageagnes-image-2.5-flash, videoagnes-video-2.5. Each generation command accepts--model. agnes-2.5-flashhas an official retirement date of 2026-11-30; the official Quickstart still uses it. Use the current model pages.agnes-2.0-flashis deprecated.agnes-sys1-1.0is a decision model with a separate/v1/systemoneschema; this CLI does not implement it.
Commands
python scripts/agnes_api.py models
python scripts/agnes_api.py text --prompt "Write a concise tagline."
python scripts/agnes_api.py text --model agnes-3.0-pro --prompt "Explain this tradeoff." --stream
python scripts/agnes_api.py image --prompt "A futuristic city at sunrise" --size 2K --ratio 16:9
python scripts/agnes_api.py image --prompt "Change the lighting while preserving composition" --image https://example.com/input.png
python scripts/agnes_api.py video --prompt "A cat walks along the beach, gentle tracking shot" --seconds 5 --size 720P --poll
python scripts/agnes_api.py video --prompt "Animate subtle natural motion" --image https://example.com/input.png --poll
python scripts/agnes_api.py video --mode keyframe --prompt "Smooth transition" --first-frame https://example.com/first.png --last-frame https://example.com/last.png --poll
python scripts/agnes_api.py video --mode reference --prompt "Use <Picture 1> as a character reference" --image https://example.com/input.png --poll
python scripts/agnes_api.py video-get video_123 --id-kind video_id --model-name agnes-video-2.5
Generation decisions
- Preserve the original prompt by default.
--translate-promptexplicitly opts into an additional text-model call; preserve requested text, composition, movement, and constraints. The former--no-translate-promptflag remains accepted. - Image 2.1/2.5 accept
1K,2K,3K,4Kplus--ratio. Exact dimensions remain compatible but may be normalized. Image 2.0 defaults to legacy1024x768. Repeat--imagefor composition. - Video 2.5 uses
seconds(4–12) and resolution-tiersize. Text/reference modes default toaspect_ratio=16:9; keyframe mode omits it because the live service rejects it. Explicit keyframe--aspect-ratiois rejected locally. Never send old frame counts, frame rates, pixel dimensions, inference steps, or negative prompts to 2.5. - A single video
--imagedefaults to first-frame control; multiple images default to reference mode. Selectkeyframewhen an image must be the actual first/last frame, orreferencefor content/style guidance. Reference mode also accepts repeated--audioand--reference-video; use--videos-jsonfor reference-video options. - Video 2.5 Flash accepts only
720P, up to 5 reference images and 3 audios, with no reference videos. Standard 2.5 accepts up to 8 images, 3 audios, and 1 video, at most 12 reference files total. - Preserve both returned ID type and selected model when retrieving. Prefer the emitted
next_stepsor--poll. Use--id-kind video_idwhen a returned video ID lacks thevideo_prefix.--id-kind task_idexplicitly selects legacy task lookup. - Only explicit
--model agnes-video-v2.0enables old frame-based parameters. Legacy service availability has not been verified.keyframesandti2vidremain migration aliases for existing commands.
Results and verification
- Return
contentor generatedurlsand retain useful provider errors. Deliver video media whenstatus=completed;failedis an unsuccessful result even without anerrorobject. Do not treat internal status/progress as completion. - Return media URLs by default. Download or inspect files when the user requests it.
--rawexposes the original provider result. - Tool definitions can be sent with
text --tools-jsonand--tool-choice-json. The CLI uses Chat Completions and does not execute tools or continue automatic tool loops. Old Responses failures do not establish current 3.0 behavior. - Run
python -m unittest discover -s tests -vfor offline regression checks.smoke-testsends paid-capable text/image requests; explicit--video-caseadds video creation. Use live tests only within the user's authorized scope. - The 2026-12-02 live validation record covers passed Flash text/SSE/tool-call structure, Pro text, Image 2.5 generation/editing, and completed playable Flash text-to-video. These simple samples do not establish complex media quality. Standard video hit a quota error; corrected Flash keyframe and image-reference requests hit a full queue and have no confirmed final media. Report those limits without inheriting v0.1.0 claims.
