cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Generative AI
Explore discussions on generative artificial intelligence techniques and applications within the Databricks Community. Share ideas, challenges, and breakthroughs in this cutting-edge field.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

OpenAi gpt-oss support for responses API?

frankc
New Contributor II

I was looking forward to using there openAI responses API when the new gpt-oss models were added to Databricks.

The openAI website states these model are compatible with the responses API.

However, it does not seem to support it on Databricks. See error message below when trying it out with both the gpt-oss end points.

Any idea why the API is not included?   

Error code: 400 - {'error_code': 'BAD_REQUEST', 'message': 'BAD_REQUEST: Invalid endpoint type: responses is not supported by gpt-oss-20b.'}

3 REPLIES 3

WiliamRosa
New Contributor III

Hi @frankc,
Could you please share more details about your implementation? I ran some tests in my environment using the playground and Python code and was successful:

WiliamRosa_0-1755910627615.png

from openai import OpenAI
import os

# How to get your Databricks token: https://docs.databricks.com/en/dev-tools/auth/pat.html
DATABRICKS_TOKEN = os.environ.get('DATABRICKS_TOKEN')
# Alternatively in a Databricks notebook you can use this:
# DATABRICKS_TOKEN = dbutils.notebook.entry_point.getDbutils().notebook().getContext().apiToken().get()

client = OpenAI(
    api_key=DATABRICKS_TOKEN,
    base_url="https://dbc-1a2e360a-8cca.cloud.databricks.com/serving-endpoints"
)

response = client.chat.completions.create(
    model="databricks-gpt-oss-20b",
    messages=[
        {
            "role": "user",
            "content": "Hello!"
        }
    ],
    max_tokens=5000
)

print(response.choices[0].message.content)



Wiliam Rosa
Data Engineer | Machine Learning Engineer
LinkedIn: linkedin.com/in/wiliamrosa

frankc
New Contributor II

Hi William,

I was asking about the OpenAI responses API. Note, you are using there chat completions API.

Here is a link to what I am referring to: https://platform.openai.com/docs/guides/text?api-mode=responses

Per my understanding, the only way to call the openAI responses API is to use an external serving endpoint. Then you have to setup an API key, etc with openAI. I was looking to use the Frontier models hosted by Databricks. The data is not shared externally.

Hope this helps clarify. Let me know of any further questions. It would be great if the responses API is available on Databricks.

Regards,

Frank

powerofzero
New Contributor II

Hi Frank, I too have been waiting for responses API to become available, but with Azure. I'm sorta suprised more people haven't been asking for it. In one of their first blogs about it in early August, Azure said they would be making responses API available to gpt-oss but I am yet to see it.

If it's any consolation, I did find it is supported on Cloudflare. I have tested it with gpt-oss-120b along with their Autorag implementation and it was working well. However, it does have a lot of limitations such as rate limiting, restrictions on file size for RAG etc, but it might suffice for you PoC.