You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
I'm trying to use [Groq](https://groq.com) as an OpenAI-compatible provider with Spring AI (spring.ai.openai) in version 1.0.0. I have correctly configured the api-key and base-url. The same API key works as expected using curl, but Spring AI consistently returns a 401 - Invalid API Key when invoking ChatClient.
Environment
Spring AI version: 1.0.0
Spring Boot version: 3.2.5
Java version: 17
Model: llama3-70b-8192
Groq base URL: https://api.groq.com/openai
API key format: gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (valid and confirmed via curl)
Bug description
I'm trying to use [Groq](https://groq.com) as an OpenAI-compatible provider with Spring AI (
spring.ai.openai
) in version1.0.0
. I have correctly configured theapi-key
andbase-url
. The same API key works as expected usingcurl
, but Spring AI consistently returns a401 - Invalid API Key
when invokingChatClient
.Environment
1.0.0
3.2.5
17
llama3-70b-8192
https://api.groq.com/openai
gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
(valid and confirmed viacurl
)Steps to reproduce
Configure
application.yml
as below:Inject and use
ChatClient
:Call the method.
Expected behavior
A valid chat completion response from Groq, the same as received when making the request via
curl
.Minimal Complete Reproducible example
Here’s the curl that works:
This returns a valid response.
But with Spring AI, I receive this:
Please advise if any custom headers or additional configuration is required to support Groq in Spring AI.
Let me know if you'd like to include a GitHub repo or sample project link as well to improve reproducibility.
The text was updated successfully, but these errors were encountered: