Skip to content

feat: add OpenAI image endpoints to adapters - #216

Merged
maplezzk merged 2 commits into
maplezzk:mainfrom
kiddtam:codex/adapter-images-api-pr
Aug 19, 2026
Merged

maplezzk merged 2 commits into
maplezzk:mainfrom
kiddtam:codex/adapter-images-api-pr

Conversation

@kiddtam

@kiddtam kiddtam commented Aug 19, 2026

Copy link
Copy Markdown

Summary

  • add adapter endpoints for /{adapter}/v1/images/generations and /{adapter}/v1/images/edits
  • select the provider's OpenAI protocol, remap model IDs, and preserve query parameters
  • support JSON generation requests and binary-safe multipart edit requests
  • stream upstream responses while preserving status codes and request IDs
  • cap buffered image request bodies at 20 MiB and abort upstream work when clients disconnect

Why

Adapters currently advertise configured image models through /{adapter}/v1/models, but OpenAI Images API requests fall through to the generic 404 handler. Sending an image-only model through chat/completions or responses also routes it to the wrong upstream endpoint.

Validation

  • npm run typecheck
  • npm test — 478 tests passed
  • npm run build
  • git diff --check origin/main...HEAD
  • end-to-end generation and edit requests returned valid PNG responses against an OpenAI-compatible upstream

codex added 2 commits August 19, 2026 20:08
Root cause: adapter routing only registered messages, chat completions, and responses, so OpenAI image generation and edit requests fell through to 404 before reaching the configured upstream.
Cap buffered image requests at 20 MiB to match the AxonHub ingress limit and release backpressure waits when clients disconnect.
@maplezzk
maplezzk merged commit d31336e into maplezzk:main Aug 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants