agnes-image
Setup and API reference for the Agnes image models — agnes-image-2.5-flash (the Token Plan image model) and agnes-image-2.1-flash — synchronous text-to-image and image-to-image generation endpoints on
Files28
View on GitHub- references/3 files
- scripts/8 files
- tests/2 files
- agnes-image-full.md15 KB
- agnes-image.skill54 KB
- CHANGELOG.md12 KB
- CORE_UPDATES.md2.7 KB
- EXAMPLES.md8.8 KB
- INSTALL.md9.1 KB
- INSTRUCTIONS.md7.0 KB
- models.json6.6 KB
- PREREQS.json1.2 KB
- prove_agnes_image_prompt_floor.py14 KB
- qc-agnes-image.sh5.3 KB
- QC.md6.3 KB
- skill-version.txt7 B
- SKILL.md12 KB
- wire.sh8.7 KB
SKILL.md63-agnes-image/SKILL.md
GitHubAgnes Image 2.5 Flash & 2.1 Flash — Setup and API Reference
The Agnes image models are image-generation models on the Agnes AI platform (Sapiens AI). You send ONE POST request with a prompt and a size, and the response comes back in the same call with a finished image — as a URL or as Base64. There is no "create a task, then poll" step: the image endpoint is SYNCHRONOUS.
Model names: agnes-image-2.5-flash and agnes-image-2.1-flash. Endpoint:
POST https://apihub.agnes-ai.com/v1/images/generations.
Which Model
| Model | Role | Token Plan quota | Rate limit (Token Plan, allowed/effective) | Source read |
|---|---|---|---|---|
agnes-image-2.5-flash |
The Token Plan image model — the only image id tokenplan.md names today | 4,000 images/day, identical on Starter/Plus/Pro, reset 00:00 UTC | RPM 1K 120/100, 2K 120/80, 3K 2/1, 4K 2/1 — treat 2K as ~80 requests/minute and HTTP 429 as the live authority | agnes-image-25-flash.md, 2026-10-15 |
agnes-image-2.1-flash |
Retained — still documented and still callable | 4,000 images/day | same tiers; 3K/4K effective 1/minute | agnes-image-21-flash.md, 2026-08-26 |
Both models share the endpoint, the 1K/2K/3K/4K × ratio dimension table,
the house prompt bands below and the reference-image field (extra_body.image[]).
models.json carries one registry entry per model. Request agnes-image-2.5-flash
unless an upstream skill or the caller pins agnes-image-2.1-flash explicitly.
When to Use This Skill
- The user (or an upstream skill) says "use the Agnes image skill" or "generate this with Agnes."
- You need to generate an image from a text prompt (text-to-image).
- You need to transform, restyle, or edit an existing image while preserving its composition (image-to-image).
- You need predictable output dimensions from a size tier (
1K/2K/3K/4K) crossed with an aspect ratio (16:9,9:16,1:1, and others). - You need the image back as a hosted URL, or inline as Base64.
This skill is for the Agnes IMAGE endpoint specifically. It is NOT a general image-model default: department pipelines and other skills pin their own image model (for example the KIE Image registry in Skill 66, or specific department pins). Only reach for Agnes Image when the request names Agnes, or an upstream skill routes to it.
Prompt Policy & House Operating Bands
Agnes vendor documentation does NOT publish a hard character or token limit
(cap_status: "NOT_PUBLISHED" in models.json). Do not invent a vendor cap.
Per BlackCEO prompt policy (Spec §5 & §10.5):
- House Target Floor: 5,000 characters (stripped) — prompts below 5,000 chars are thin stubs. Short user prompts are NOT an error (§5.3); the system expands them into rich production prompts rather than rejecting them.
- House Normal Target: ~9,000 characters (stripped) — high-information-density production target.
- House Preferred Maximum: 19,000 characters (stripped) — preferred headroom. Prompts above 19,000 characters trigger a non-fatal advisory but are NOT hard-rejected at the API boundary if intentional.
- Status:
PENDING_ACCEPTANCE_TEST— house bands serve as targets, not invented vendor laws.
Enforcement & Validation:
scripts/validate_prompt.py: model-aware prompt validator reporting band status (thin stub, target zone, upper band, above preferred max) and enforcing logo-I2I and style-reference rules.prove_agnes_image_prompt_floor.py: deterministic quality gate verifying prompt status, logo I2I intent, and style-reference directives.
python3 63-agnes-image/scripts/validate_prompt.py --file working/prompts/<id>.txt
Signature Launch Prompt Policy
Signature Launch requests carry the named policy signature_launch_completeness
(scripts/launch_prompt_policy.py): completeness of the required information
elements governs, length is telemetry, and only a verified vendor ceiling is
enforced (the Agnes vendor cap is NOT_PUBLISHED; never truncate a prompt to fit
an imagined limit and never pad to reach a cosmetic count). The house bands
above remain the legacy profile for legacy consumers.
Image-to-Image for Logos (MANDATORY)
When an image prompt involves the client's LOGO, wordmark, brand mark, monogram,
or any existing brand image, you MUST use IMAGE-TO-IMAGE generation -- provide the
logo as a reference image via extra_body.image[]. Text-to-image generation of a
logo is PROHIBITED: a text-to-image model cannot render a specific client's logo
accurately and will invent a lookalike instead. The validation scripts check for
this:
python3 63-agnes-image/scripts/validate_prompt.py --file prompt.txt --logo
Reference purpose governs the instruction (per-reference, never global): a
logo/identity reference PRESERVES the approved mark (see the identity rule in
references/prompt-policy.md); the style-reference-only directive belongs on
STYLE references only and must never be applied to a logo/identity reference.
Pass --identity-ref for a logo reference and --style-ref only when the
reference is style-only.
Reference Purposes and Their Directives
Classify every reference image by purpose before writing the prompt:
style, logo, identity, composition, or an explicitly approved mix.
Only a STYLE reference carries the style-reference-only directive verbatim:
Use the attached images only as style reference for color grading, lighting, and composition -- do not copy their subjects, faces, or text.
A logo/identity reference instead carries the preserve-the-mark rule: reproduce
the approved mark exactly, never a do-not-copy directive. A style-only reference
must never transfer another person's identity; preserve real-person likeness
only from authorized supplied assets.
Prerequisites
- Teach Yourself Protocol (TYP) must be learned first (Skill 01).
- Backup Protocol must be learned first (Skill 02).
AGNES_AI_API_KEYpresent in the box's secrets. This is an EXISTING fleet credential — the same key the registeredagnes/agnes-3.0-flashmodel on the boxes already uses againstapihub.agnes-ai.com/v1. This skill REFERENCES that key; it does not mint a new one. Verify it is SET, never print its value.curlavailable for the verification calls.
What This Skill Covers
- The synchronous request pattern — one
POST /v1/images/generations, one JSON response. No task id, no polling loop. This is the opposite of the asynchronous "create task then poll" pattern in KIE.ai skills and the Agnes VIDEO endpoint. - Required fields —
model,prompt,size. - Size tiers and aspect ratios —
sizeis a TIER (1K,2K,3K,4K), combined withratio(1:1default, plus3:4,4:3,16:9,9:16,2:3,3:2,21:9). Legacy exact sizes such as1024x768are accepted but may be normalized to the nearest tier. - The output-dimension table — every ratio × tier maps to exact pixels
(for example
16:9at2K=2624x1472). Full table inmodels.jsonandagnes-image-full.md. - Image-to-image — pass input image URL(s) or Data-URI Base64 in
extra_body.image[]. Image-to-image does NOT requiretags: ["img2img"]. - URL vs Base64 output — the response-format control lives in
extra_body.response_format("url"or"b64_json"), NOT at the top level. For text-to-image Base64, the top-levelreturn_base64: trueshortcut also works. - Rate-limit / tier awareness — Agnes meters requests-per-minute by ACCOUNT
TIER and (on paid Token Plans) daily quotas. Treat HTTP 429 as the live
source of truth and back off; never hardcode a ceiling. See the rate-limit
section in
agnes-image-full.mdandreferences/api-patterns.md. - Pricing — image generation is currently promotional
$0 / image(standard reference rate$0.003 / image). Reference images: first 3 free, 4th+$0.003 / imageat list price. - Machine-Readable Registry & Validators —
models.json,scripts/validate_prompt.py,scripts/validate_payload.py, andscripts/normalize_alias.py.
Files in This Folder (Reading Order)
- SKILL.md — you are here. Start with this file.
- models.json — machine-readable capability registry for
agnes-image-2.5-flashandagnes-image-2.1-flash. - references/prompt-policy.md — prompt policy, house bands, and expansion guide.
- references/api-patterns.md — request patterns, payload gotchas, and error handling.
- references/qc.md — visual quality control checklist and retry ladder.
- agnes-image-full.md — complete narrative reference and dimension tables.
- INSTRUCTIONS.md — how to call the endpoint day to day.
- INSTALL.md — how to confirm credentials and verify connectivity.
- EXAMPLES.md — copy-paste curl examples for common tasks.
- CORE_UPDATES.md — what to add to AGENTS.md, TOOLS.md, and MEMORY.md.
- scripts/validate_prompt.py — model-aware prompt validation script.
- scripts/validate_payload.py — JSON payload validation script.
- scripts/normalize_alias.py — alias normalization script.
- prove_agnes_image_prompt_floor.py — prompt band quality gate.
Critical Things to Know
- The image endpoint is SYNCHRONOUS. A 200 response already contains the
finished image at
data[0].url(ordata[0].b64_json). Do NOT write a polling loop for it. (The Agnes VIDEO endpoint is a separate, asynchronous create-then-poll service — do not confuse the two.) response_formatgoes insideextra_body, not at the top level. A top-levelresponse_formatis an error. Useextra_body.response_format: "url"(or"b64_json").- Image-to-image needs NO tags. Provide the input image array in
extra_body.imageand that is enough. Do not sendtags: ["img2img"]. sizeis a tier,ratiois the shape. For predictable pixels, pair a tier (2K) with a ratio (16:9) and read the exact output size from the dimension table. Requesting an exact non-native size such as1920x1080may be normalized (for example to the16:91Ksize1312x736).- The credential is the existing
AGNES_AI_API_KEY. It rides theAuthorization: Bearer <key>header on every call. Confirm it is SET; never echo, cat, or log the value. - Rate limits are per account tier — read them live. Do not bake a numeric
request/day cap into any logic. If the account is on a paid Token Plan the
daily quotas apply (4,000 images/day, see the table above); on the
free/default tier only requests-per-minute apply.
Treat a 429 as the authority and back off. Full details in
references/api-patterns.md. - Vendor prompt cap is NOT_PUBLISHED. Do not invent a vendor cap.
House operating policy targets 5,000–19,000 characters (~9,000 target). Short user
prompts are expanded, not rejected. Run
scripts/validate_prompt.pybefore calls. - Logo requests MUST use image-to-image. When a prompt involves the client's
logo, wordmark, or existing brand image, use I2I (pass the logo as a reference
image via
extra_body.image[]), never text-to-image. Reference instructions are per-purpose: preserve-the-mark for logo/identity references, style-reference-only directive for style references only.