openai / openai/openai-java

OpenAI Java SDK issues with Azure OpenAI

Open
#715 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug sdk upstream
Dominant language
Kotlin
Stars
1.5k
Forks
264
Avg merge
9h 46m
Merged PRs (30d)
96

Description

We're using openai-java library version 4.17.0 through Spring AI.

The SDK is adding a lot of "x-stainless-*" headers - and recently Azure OpenAI has set a limit of max 10 headers for a request.

https://learn.microsoft.com/en-us/azure/foundry-classic/foundry-models/faq#do-foundry-models-support-custom-api-headers--we-append-custom-headers-to-our-api-requests-and-are-seeing-http-431-failure-errors-

Error:
Azure OpenAI responds with a 431 http error.

Solution:
Make telemetry headers opt-in?

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

Start by locating the openai-java request construction that adds x-stainless-* headers and reproduce the 431 response against Azure OpenAI with version 4.17.0 through Spring AI. Trace how telemetry headers are configured, then verify the resulting behavior against Azure's header limit and existing requests when telemetry remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, java
Domain
api, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.