v0.10.5

Image Types

Last updated


Image options, results, per-provider endpoints, and image helpers.

Options and result


  1. type ImageOptions struct {
  2. AspectRatio string // "1:1" "16:9" "4:3"
  3. Size string // "1k" "2k" "4k"
  4. Quality string // "low" "medium" "high"
  5. RefImageB64 string
  6. RefMime string
  7. }
  8. type ImageResult struct {
  9. B64 string
  10. MimeType string
  11. Revised string
  12. }

Endpoints per provider


ProviderEndpointResult
openai/v1/images/generations, /v1/images/edits with a referencePNG (output_format), Revised set
codeximage_generation tool on ChatGPT Codex Responsesoutput_format of the result event, PNG when absent; Revised set
gemini:generateContentinlineData.mimeType from the response
grok / grok-oauth/v1/images/generations, /v1/images/edits with a referencemime_type from the response, JPEG when absent
openrouter/api/v1/imagesmedia_type from the response, PNG when absent

Helpers


FunctionSignature
ImagePixelSizefunc(opts ImageOptions) string; Size applies to the short edge
DataURIfunc(mime, b64 string) string


中文