Skip to content

GH-3905: Add OpenAI Batch API support#5875

Draft
Y-AKBAS wants to merge 1 commit intospring-projects:mainfrom
Y-AKBAS:GH-3905
Draft

GH-3905: Add OpenAI Batch API support#5875
Y-AKBAS wants to merge 1 commit intospring-projects:mainfrom
Y-AKBAS:GH-3905

Conversation

@Y-AKBAS
Copy link
Copy Markdown

@Y-AKBAS Y-AKBAS commented Apr 23, 2026

Adds support for OpenAI's Batch API, enabling asynchronous processing of large volumes of API requests at 50% cost reduction.

The implementation follows the existing spring-ai Model + AutoConfig + Properties + Starter pattern and includes:

  • BatchRequestHandler interface for endpoint-agnostic batch processing
  • OpenAiBatchModel orchestrator with prepare/execute/check lifecycle
  • OpenAiBatchApi low-level SDK wrapper for batch and file operations
  • OpenAiBatchOptions with fully configurable rate limits and policies
  • OpenAiBatchListener callback interface for lifecycle events
  • Auto-configuration with spring.ai.openai.batch.enabled property
  • Hybrid storage approach: domain inputs stored, API envelope generated on demand so config changes apply without data cleanup
  • Antora documentation with usage examples and configuration reference

Closes #3905

@Y-AKBAS Y-AKBAS force-pushed the GH-3905 branch 3 times, most recently from d180232 to b5c2253 Compare April 23, 2026 18:04
Adds support for OpenAI's Batch API, enabling asynchronous processing
of large volumes of API requests at 50% cost reduction.

The implementation follows the existing spring-ai Model + AutoConfig +
Properties + Starter pattern and includes:

- BatchRequestHandler interface for endpoint-agnostic batch processing
- OpenAiBatchModel orchestrator with prepare/execute/check lifecycle
- OpenAiBatchApi low-level SDK wrapper for batch and file operations
- OpenAiBatchOptions with fully configurable rate limits and policies
- OpenAiBatchListener callback interface for lifecycle events
- Auto-configuration with spring.ai.openai.batch.enabled property
- Hybrid storage approach: domain inputs stored, API envelope generated
  on demand so config changes apply without data cleanup
- Antora documentation with usage examples and configuration reference

Closes spring-projects#3905

Signed-off-by: yasin akbas <yakbas@protonmail.com>
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.

Feature Request: Support for OpenAI Batch API

1 participant