Monoize
Transforms

Image: enable OpenAI generation tool

Ensure the OpenAI Responses image_generation tool exists on the request.

What it does

This transform adds the OpenAI Responses image_generation tool descriptor to the request when it is missing. It can also force streaming and force the tool choice.

Reference

PropertyValue
Type IDimage_enable_openai_generation_tool
Phaserequest
ScopesProvider, API key

When to use

  • Clients send plain text prompts but the route should produce images through the Responses image tool.
  • A client cannot configure tools itself.

Configuration

OptionTypeRequiredDefaultDescription
output_formatstringNo"png"png, webp, or jpeg. Format requested from the image tool.
actionstringNoOptional action value written into the tool descriptor.
force_streambooleanNofalseForce the upstream request to stream with partial images.
force_tool_choicebooleanNofalseForce tool choice to the image generation tool.
extraobjectNo{}Extra fields merged into the tool descriptor.

Example rule

{
  "transform": "image_enable_openai_generation_tool",
  "enabled": true,
  "phase": "request",
  "models": [
    "gpt-image*"
  ],
  "config": {
    "output_format": "webp",
    "force_tool_choice": true
  }
}

On this page