Add typed Images client to codex-api (#23989)

## Why

Standalone image generation needs a typed `codex-api` client surface for
the Codex image proxy routes before the harness and model-facing tool
layers are wired in.

## What changed

- Added `ImagesClient` support for JSON `images/generations` and
`images/edits` requests.
- Added typed request and response shapes for generation, JSON edit
image URLs, image metadata, and base64 image outputs.
- Kept generation model slugs open-ended while requiring the generation
model field that the downstream endpoint expects.
- Exported the new client and image types from `codex-api`.
- Added coverage for generation and edit wire shapes, extra response
metadata that the client ignores, and malformed image responses missing
`data`.

## Validation

- `cargo test -p codex-api`
- `just fix -p codex-api`
- `just fmt`
- `git diff --check main`
This commit is contained in:
Won Park
2026-05-22 14:10:55 -07:00
committed by GitHub
parent 6963145cb6
commit 423488480f
4 changed files with 383 additions and 0 deletions
+2
View File
@@ -1,4 +1,5 @@
pub(crate) mod compact;
pub(crate) mod images;
pub(crate) mod memories;
pub(crate) mod models;
pub(crate) mod realtime_call;
@@ -9,6 +10,7 @@ pub(crate) mod search;
mod session;
pub use compact::CompactClient;
pub use images::ImagesClient;
pub use memories::MemoriesClient;
pub use models::ModelsClient;
pub use realtime_call::RealtimeCallClient;