Choose a unified image generation API only after defining which catalog facts may reach its text-to-image models. For a property-management product catalog, the simplest defensible one-key design puts a typed enrichment contract ahead of model selection: messy descriptions become reviewed attributes, and those attributes constrain the illustration request.

Short answer: one key can simplify access to multiple AI models, but it should not confer authority to invent catalog attributes. Make structured output correctness the admission criterion; preserve the source description, reject unsupported claims, and treat generated images as illustrations requiring their own release decision. This is a proposed design, with examples intended as test fixtures rather than reported production results.

Consider the illustrative description, “Bath mixer; brushed finish; fits unit B12; maybe brass; photo pending.” A catalog entry can preserve the asserted finish and the uncertainty about material. A generated image that looks convincingly brass cannot resolve that uncertainty. If the enrichment pipeline promotes its appearance into a verified material field, the application has manufactured evidence. That is the failure this decision record addresses.

Keep uncertainty visible.

What should a unified image generation API validate before rendering catalog items?

The reader asking for the simplest unified text-to-image API usually wants fewer credentials and less integration code. Those are reasonable objectives, but the catalog workflow has two distinct outputs: a structured description of a product and an illustrative asset derived from that description. A common request envelope can connect the stages without establishing that either result is correct, and a model accepting text is insufficient evidence that it supports image generation. Require an explicit image-generation capability before admitting a route into the candidate set.

The decision here is to centralize credential use while keeping catalog acceptance and image acceptance as separate application decisions. An enrichment result can pass structural validation yet fail evidentiary review; an image can be technically retrievable yet depict unsupported features. Neither success should release the other automatically.

This makes the unit of correctness a committed catalog revision, with a traceable illustration request attached to it. The backend concern resembles reconciliation: every released artifact needs a corresponding authorized input and a recorded disposition. Credential count is an integration convenience. It is a poor acceptance test.

Invariants and the boundary of exactly-once behavior

For this design, an accepted enrichment record must carry a catalog item identifier, its source revision, a schema version, and evidence for every asserted attribute. Distinguish an unknown value from an absent field. Treat “maybe brass” as uncertain source text, and require review before asserting brass as the material. An exact evidence quotation helps a reviewer locate a claim, although quotation alone cannot establish that an extraction interpreted the claim correctly.

The invariant is deliberately strict: an illustration must refer to the same accepted revision that supplied its prompt. If a description changes while generation is pending, retain the result against its original revision and reconsider release. Quietly attaching it to the newest revision destroys the audit trail, even when the two descriptions appear similar. Store the prompt, validation disposition, model identifier as returned by the execution layer, and artifact identifier alongside that association.

Duplicates still matter.

Use a stable operation identifier for each authorized generation intent, with the catalog revision, prompt, selected model, and generation settings fixed for that intent. A retry reuses that identifier; an intentional new variation receives another one. The local transaction should atomically persist the accepted revision and an outbox job, while a uniqueness constraint prevents a repeated operation identifier from creating another local intent. These are application requirements, not promises about a remote service. Exactly-once thinking ends at the boundary where evidence ends. If a generation request times out after the remote side may have accepted it, a local uniqueness constraint cannot prove that no image was generated. Reconcile against a documented status or idempotency mechanism when one exists. Otherwise record an unresolved outcome and require an explicit retry decision, because an unqualified retry can produce another remote execution. The audit record should preserve that uncertainty rather than replace it with an invented success or failure.

A timeout is an unresolved accounting event until evidence establishes its disposition.

Decision: compare the catalog write paths

The options below concern where authority sits in the proposed workflow. They do not rank products, and their operational consequences should be checked against the actual execution contract before deployment.

Write path Acceptance rule Principal trade-off Appropriate scope
Generate directly from raw descriptions Review the resulting illustration Least preparation, but unsupported source details can enter the prompt without an attribute-level review Disposable concept exploration
Validate an enrichment record before generation Check schema, source evidence, and revision before creating a job Adds validation and a review queue; makes the authorized inputs inspectable Catalog publication with accountable metadata
Require human approval of every enriched record Reviewer approves attributes before a job exists Adds review work and waiting time; offers a place to resolve ambiguous descriptions Items whose claims require interpretation

Select the second path as the default architecture, with escalation to the third when the source is ambiguous. Structural validation should check types and allowed fields; semantic validation should check whether the proposed values are supported. JSON Schema provides a vocabulary for expressing structural constraints, while application policy must supply the catalog-specific acceptance rules. Neither layer should silently convert missing evidence into a plausible default.

The trade-off is additional validation work in exchange for an inspectable authorization boundary. The benefit is most concrete during correction: when a supplier amends a description, the team can identify the affected catalog revision and its derived illustration jobs instead of searching for visually similar assets. The additional queue, schema maintenance, and review interface are real engineering work; include them in the decision, alongside request volume and generation latency, without making unit price the organizing argument.

Critical path: validate before recording generation intent

The following Go example implements a deliberately narrow admission check for the illustrative finish attribute under schema version 1. It accepts 2 finish values: brushed and polished. A source with an explicit finish statement can pass; uncertain wording such as “possibly brushed” does not match its acceptance rule. This conservative example is useful precisely because it exposes the rule instead of hiding interpretation inside a successful decode. A real catalog needs separate policies for material, dimensions, compatibility, and other claims.

package catalog import ( "encoding/json" "errors" "io" "strings" ) type Source struct { ItemID string Revision string Text string } type Enrichment struct { ItemID string `json:"item_id"` Revision string `json:"source_revision"` SchemaVersion int `json:"schema_version"` Finish string `json:"finish"` Evidence string `json:"finish_evidence"` } func Admit(raw []byte, source Source) (Enrichment, error) { var e Enrichment d := json.NewDecoder(strings.NewReader(string(raw))) d.DisallowUnknownFields() if err := d.Decode(&e); err != nil { return e, err } var extra any if err := d.Decode(&extra); err != io.EOF { return e, errors.New("expected exactly one JSON value") } if source.ItemID == "" || source.Revision == "" || e.ItemID != source.ItemID || e.Revision != source.Revision || e.SchemaVersion != 1 { return e, errors.New("catalog identity or schema mismatch") } switch e.Finish { case "brushed", "polished": default: return e, errors.New("finish requires review") } expected := e.Finish + " finish" found := false for _, part := range strings.Split(source.Text, ";") { if strings.TrimSpace(part) == expected { found = true break } } if e.Evidence != expected || !found { return e, errors.New("finish evidence requires review") } return e, nil } 

For the opening fixture, the accepted evidence would be “brushed finish”; “maybe brass” remains outside this example's accepted attribute set. The decoder rejects unknown fields and additional JSON values, while the application checks identity and evidence. This is an admission function, not a complete JSON Schema validator or transaction implementation. In particular, the standard decoder's treatment of duplicate object keys requires a separate rejection check if the contract forbids duplicates; a successful call to this function alone must not authorize publication.

After all admission checks pass, commit the enrichment and outbox job in one transaction. Keep the network request outside that database transaction. The worker can then record dispatch attempts and reconcile results without holding a catalog transaction open during generation; release still depends on the artifact's association with the authorized revision and its review disposition.

Rejected option, valid use case, and release evidence

Reject direct generation from raw descriptions for the publishing path. It remains a valid option for disposable visual exploration where an image cannot update catalog facts and a reviewer understands that the output is speculative. That narrower use case does not need the same write authority, which is the meaningful distinction between the two paths.

Before deployment, exercise the whole workflow with a small, explicit fixture set: the opening uncertain-material description, a missing finish, an unknown output field, a duplicate object key, a stale revision, and an interrupted generation request. These are proposed tests, not measured outcomes. Verify that each rejection has an actionable reason and that retries preserve the original operation identifier. Include a description correction after dispatch to check that a late result cannot silently attach to a newer catalog revision.

Observe acceptance, review, rejection, unresolved dispatch, and release as separate states. Record enough identifiers to reconcile them, but keep raw descriptions out of general-purpose logs when they contain tenant or resident information. An audit trail does not establish regulatory compliance by itself: retention periods, access rights, deletion obligations, and permission to send source text require a policy decision for the applicable jurisdiction and contracts. No jurisdiction is specified here, so this design makes no compliance certification claim.

The release criterion is an accountable chain from source description to accepted attributes to authorized illustration. A unified image generation interface can simplify execution across models once that chain exists. Structured correctness determines whether the catalog is ready to use it.

References