Skip to content

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

Open
kunalk16 wants to merge 2 commits intocrewAIInc:mainfrom
kunalk16:feat/azure-responses-api
Open

feat(azure): add Responses API support for Azure OpenAI provider#5201
kunalk16 wants to merge 2 commits 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

@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 from 9e322f6 to c5271ae Compare April 3, 2026 07:21
@kunalk16 kunalk16 force-pushed the feat/azure-responses-api branch 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.

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