Skip to content

feat(azure): add Responses API support for Azure OpenAI provider#5201

Open
kunalk16 wants to merge 1 commit intocrewAIInc:mainfrom
kunalk16:feat/azure-responses-api
Open

feat(azure): add Responses API support for Azure OpenAI provider#5201
kunalk16 wants to merge 1 commit intocrewAIInc:mainfrom
kunalk16:feat/azure-responses-api

Conversation

@kunalk16
Copy link
Copy Markdown

@kunalk16 kunalk16 commented Apr 1, 2026

Closes: #5202

Summary
Adds support for OpenAI's Responses API to the Azure OpenAI provider. Users can now opt in by setting api="responses" when creating an LLM instance. The existing Chat Completions API path remains the default and is completely untouched.

The Responses API is OpenAI's recommended API for new development, replacing Chat Completions as the primary interface. Azure OpenAI has adopted it with full feature parity.

# Example 1 basic
llm = LLM(model="azure/gpt-5.4-mini", api="responses")

# Example 2 with instructions
llm = LLM(model="azure/gpt-5.4-mini", api="responses", instructions="Be concise.")
Click to view Testing Details

Smoke Testing using the below test script:

from crewai import LLM

API_KEY = "api-key"
ENDPOINT = "https://some-internal-name.openai.azure.com"
MODEL = "azure/gpt-5.4-mini"

llm = LLM(
    model=MODEL,
    api="responses",
    api_key=API_KEY,
    endpoint=ENDPOINT,
)

print("=== Basic call ===")
result = llm.call(messages=[{"role": "user", "content": "Say hello in one sentence."}])
print(result)

print("\n=== Reasoning (medium) ===")
llm_reason = LLM(
    model=MODEL,
    api="responses",
    api_key=API_KEY,
    endpoint=ENDPOINT,
    reasoning_effort="medium",
)
result = llm_reason.call(messages=[{"role": "user", "content": "What is 47 * 83?"}])
print(result)

print("\n=== Multi-turn conversation ===")
llm_chat = LLM(
    model=MODEL,
    api="responses",
    api_key=API_KEY,
    endpoint=ENDPOINT,
    auto_chain=True,
    store=True,
)
r1 = llm_chat.call(messages=[{"role": "user", "content": "My favorite color is blue. Remember this."}])
print(f"Turn 1: {r1}")
r2 = llm_chat.call(messages=[{"role": "user", "content": "What is my favorite color?"}])
print(f"Turn 2: {r2}")
llm_chat.reset_chain()

print("\nDone!")

Test Output:
image

And with a crew setup:
image

@kunalk16 kunalk16 marked this pull request as ready for review April 1, 2026 08:55
@kunalk16 kunalk16 force-pushed the feat/azure-responses-api branch from 2d6a5c2 to 2778f9c Compare April 2, 2026 02:23
@kunalk16
Copy link
Copy Markdown
Author

kunalk16 commented Apr 2, 2026

@joaomdmoura / @iris-clawd Requesting to kindly review this PR. It has been tested and all the repo rules have been followed.

@kunalk16
Copy link
Copy Markdown
Author

kunalk16 commented Apr 3, 2026

@joaomdmoura / @greysonlalonde / @iris-clawd / @lucasgomide / @lorenzejay / @alex-clawd
Hello Reviewers,
Sorry for tagging like this but I'm not sure how to communicate this. I would really appreciate if you could have a look at this PR and review. It is a simple and useful change.

@kunalk16 kunalk16 force-pushed the feat/azure-responses-api branch 2 times, most recently from c5271ae to 6baa0c9 Compare April 4, 2026 02:11
@kunalk16
Copy link
Copy Markdown
Author

kunalk16 commented Apr 4, 2026

@joaomdmoura / @greysonlalonde / @iris-clawd / @lucasgomide / @lorenzejay / @alex-clawd
Hello Reviewers,
Sorry for tagging like this but I'm not sure how to communicate.
I would really appreciate if you could have a look at this PR and review. It is a simple and useful change. Please ack this.

@kunalk16 kunalk16 force-pushed the feat/azure-responses-api branch 2 times, most recently from fd8c38c to ea93ffe Compare April 7, 2026 18:22
@kunalk16
Copy link
Copy Markdown
Author

kunalk16 commented Apr 7, 2026

@joaomdmoura / @greysonlalonde / @iris-clawd / @lucasgomide / @lorenzejay / @alex-clawd
Hello Reviewers,
I would really appreciate if you could have a look at this PR and review. It is a simple and useful change. Please ack this.

@kunalk16 kunalk16 force-pushed the feat/azure-responses-api branch 6 times, most recently from 23d6a6f to 48d2dfc Compare April 10, 2026 17:27
@kunalk16
Copy link
Copy Markdown
Author

@joaomdmoura / @greysonlalonde / @iris-clawd / @lucasgomide / @lorenzejay / @alex-clawd
Hello Reviewers,
I would really appreciate if you could have a look at this PR and review. It is a simple and useful change. Please ack this.

@kunalk16
Copy link
Copy Markdown
Author

I'll be fixing the merge conflicts soon and get this PR ready for review.

@kunalk16 kunalk16 force-pushed the feat/azure-responses-api branch from b747d90 to 945fce8 Compare April 19, 2026 05:24
@kunalk16
Copy link
Copy Markdown
Author

@joaomdmoura / @greysonlalonde / @iris-clawd / @lucasgomide / @lorenzejay / @alex-clawd
Hello Reviewers,
I would really appreciate if you could have a look at this PR and review. It is a simple and useful change. Please ack this. I have fixed the merge conflicts as well and have done through testing. This PR has been pending for a while now.

@kunalk16 kunalk16 force-pushed the feat/azure-responses-api branch from 945fce8 to 2c29701 Compare April 20, 2026 10:33
@kunalk16
Copy link
Copy Markdown
Author

@joaomdmoura / @greysonlalonde / @iris-clawd / @lucasgomide / @lorenzejay / @alex-clawd
Hello Reviewers,
It is a simple and useful change. Please ack this. I have fixed the merge conflicts as well and have done through testing. This PR has been pending for a while now.

@kunalk16 kunalk16 force-pushed the feat/azure-responses-api branch from 2c29701 to 605bba6 Compare April 20, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add Responses API Support for Azure OpenAI Provider

1 participant