spora-ai / spora-plugin-openai-image
OpenAI-compatible image generation for Spora agents.
Package info
github.com/spora-ai/spora-plugin-openai-image
Type:spora-plugin
pkg:composer/spora-ai/spora-plugin-openai-image
Requires
- php: ^8.4.1
- spora-ai/spora-core: >=0.15.0 <2.0.0 || @dev
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.94
- mockery/mockery: ^1.6
- pestphp/pest: ^4.0
- phpstan/phpstan: ^2.1
- phpstan/phpstan-mockery: ^2.0
This package is auto-updated.
Last update: 2026-08-12 10:01:00 UTC
README
This plugin provides the image_openai tool using the OpenAI Image API contract. Configure api_key, base_url, and model per agent so compatible providers can be used without code changes.
Generated base64 images are ingested into Spora's Media Archive when available. If the archive is unavailable or ingestion fails, the tool returns a data URL fallback.
The tool exposes two operations:
-
generate— single image from a text prompt. CallsPOST {base_url}/images/generations. The expected response shape isdata[].b64_json. -
generate_variations— multiple images (default 3, max 8), or semantic variations of an existing image. Approval-gated by default.- Prompt-based (default):
POST {base_url}/images/generationswithnindependent samples from the same prompt. - Image-based (
input_imagesupplied):POST {base_url}/images/variations(multipart upload).input_imageaccepts an http(s) URL, adata:URI, a 36-char Media Archive UUID, or an opaque/api/v1/assets/<uuid>.<ext>URL. The plugin resolves Media Archive references server-side so the bytes never enter the chat context.
- Prompt-based (default):