Skip to content

Potential misleading documentation on OpenAiClientAsync #644

Closed

Description

@StefanZanderInacta

OpenAIClientAsync's documentation states:

This client performs best when you create a single instance and reuse it for all interactions
with the REST API. This is because each client holds its own connection pool and thread pools.
Reusing connections and threads reduces latency and saves memory. The client also handles rate
limiting per client. This means that creating and using multiple instances at the same time will
not respect rate limits.
(emphasis mine)

Source: https://github.com/openai/openai-java/blob/main/openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientAsync.kt#L30-L41

However I find no evidence on rate limits actually being used proactively as the text suggests. I can only find evidence of reactive retry, when encountering 429 errors it automatically retries with an exponential backoff. However, that is request specific, not global to the client.

Is my understanding incorrect here or is this a documentation error? Thanks in advance.

Activity

  1. dpiet-oai commented on Sep 30, 2026

    @dpiet-oai
    Contributor

    Fixed in #1118, now merged into main. Both synchronous and asynchronous client documentation now clarify client reuse, per-request retries, and application-managed request rates. Thank you for reporting the misleading wording.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requestedsdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions