Skip to main content

Image Generation

Image generation lets Anyy create an image from a prompt and return it as a scoped artifact and native attachment.

The model-visible tool is image_generate in the optional media_generation toolset. Provider and model selection are resolved by Anyy configuration, not by tool arguments.

Configuration

Enable image generation with an image-capable auxiliary or main model:

auxiliary_models:
image_generation:
- provider_id: openai-responses-provider
model: image-model

media_generation:
image:
enabled: true
default_aspect_ratio: square
timeout_ms: 120000
max_bytes: 5242880

The setup helper writes the same sections with defaults:

FieldDefault
media_generation.image.default_aspect_ratiosquare
media_generation.image.timeout_ms120000
media_generation.image.max_bytes5242880

The selected provider must have an API mode compatible with OpenAI Responses and the selected model must advertise image_generation capability.

Tool Availability

image_generate is available only when:

RequirementBehavior
media_generation.image.enabledMust be true.
Model selectionUses the first enabled auxiliary_models.image_generation entry, otherwise falls back to the main model if it supports image generation.
ProviderMust exist and be enabled.
CredentialProvider credential_ref or api_key_ref must resolve to a non-empty value.
Toolsetmedia_generation must be selected for the turn.

Provider Routing

Routing order:

  1. First configured auxiliary_models.image_generation entry.
  2. main_model.
  3. Compatibility default_model shorthand if main_model is not set.

If no selected model has image_generation capability, runtime startup returns a configuration error when image generation is enabled.

The tool accepts:

ArgumentValues
promptRequired non-empty image prompt.
aspect_ratiosquare, portrait, or landscape; defaults to configured policy or square.

Metadata

On success, the tool returns JSON containing:

FieldMeaning
artifact_refCanonical artifact ref such as artifact://artifact/<id>.
artifact_idArtifact id when available.
content_typeGenerated image content type.
filenameSuggested filename.
presentation_textShort text used for message delivery.

Provider id, model id, channel binding, content metadata, prompt hash, and digest are stored in the generated attachment/artifact metadata.

Artifacts

Generated images are stored through the artifact store and can be listed or pinned with the Artifacts tools.

The image bytes are delivered as a native attachment on supported messaging surfaces. If a channel cannot render images natively, Anyy still has the artifact record and attachment metadata for the session.

Failure Modes

StatusMeaning
blocked_unavailableImage generation service or provider is not available.
blocked_invalidPrompt, session, turn, or aspect-ratio input is invalid.
errorProvider generation failed after configuration was accepted.