spring-projects / spring-projects/spring-ai

Feature Request: Support for OpenAI Batch API

Open
#3,905 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement openai
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

I am requesting the addition of support for the OpenAI Batch API within the Spring AI framework.

The OpenAI Batch API is designed for efficient, asynchronous processing of large volumes of AI requests. Integrating this functionality into Spring AI would provide significant advantages for developers, enabling them to:

  • Process high volumes of requests cost-effectively: The Batch API offers a 50% cost discount compared to synchronous API calls.

  • Overcome rate limit constraints: It utilizes separate, significantly higher rate limits, allowing for much greater throughput without impacting real-time application performance.

  • Manage large-scale AI tasks efficiently: Batches are guaranteed to complete within 24 hours, making it suitable for operations where immediate responses are not critical.

This feature would be particularly beneficial for use cases such as:

  • Running evaluations: Automating the assessment of models or data.

  • Classifying large datasets: Efficiently categorizing extensive collections of text or other content.

  • Embedding content repositories: Generating embeddings for vast amounts of data for retrieval-augmented generation (RAG) or other applications.

By supporting the OpenAI Batch API, Spring AI would greatly enhance its capabilities for building robust and scalable AI applications that handle large-scale, asynchronous AI workloads.

I gathered this information from the official OpenAI documentation on their Batch API guide.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository files, entry points, or tests; start with the linked official OpenAI Batch API guide and inspect how Spring AI currently integrates OpenAI services. Define the framework API and lifecycle needed for asynchronous batch processing, then add coverage showing that the requested Batch API support works end to end.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
ai, api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.