Feature Request: Add Support for OpenAI/Azure Responses API

Open
#25 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php
Domain
api

Research direction

Start by locating the current $client->chat()->create integration and the model handling described in the issue. Define how the existing Chat Completions path and the new /responses path should coexist, then verify that GPT-5 Pro uses Responses while existing models remain compatible.

Written by the indexing model from the issue text.

Description

The current implementation only supports the Chat Completions API. This prevents the use of newer reasoning models such as gpt-5-pro, which are only available through the Responses API.

I would like to request support for the OpenAI/Azure Responses API, including automatic routing based on model capabilities.

⸻

Problem

When using Azure OpenAI with a GPT-5 Pro deployment, requests fail with the following error:

Invalid API request
The requested operation is unsupported.

Investigation shows that the library always sends requests to the Chat Completions endpoint:

POST /chat/completions

However, Azure GPT-5 Pro only supports the Responses API and does not support Chat Completions.

As a result, users cannot use GPT-5 Pro even though the deployment and credentials are configured correctly.

⸻

Current Behavior

The implementation assumes all chat-capable models support Chat Completions:

$client->chat()->create([
'model' => $model,
'messages' => $messages,
]);

This works for:

  • GPT-4o
  • GPT-4.1
  • GPT-5 Mini
  • GPT-5

but fails for:

  • GPT-5 Pro

⸻

Expected Behavior

The library should support both APIs:

Chat Completions

POST /chat/completions

Responses API

POST /responses

The framework should be able to route requests to the appropriate API depending on model capabilities.

Example:

if ($modelCapabilities->supportsResponsesOnly()) {
$client->responses()->create(...);
} else {
$client->chat()->create(...);
}

⸻

Proposed Solution

Option 1: Native Responses API Support

Introduce a dedicated Responses API client:

$client->responses()->create([
'model' => 'gpt-5-pro',
'input' => $messages,
]);

This gives users direct access to the newer API surface.

⸻

Option 2: Automatic Capability Routing

Add model capability detection and transparently choose the correct endpoint.

Example:

$client->generate([
'model' => 'gpt-5-pro',
'messages' => $messages,
]);

Internally:

if ($model->supportsResponses()) {
return $responsesClient->create(...);
}
return $chatClient->create(...);

This provides the best developer experience and future-proofs the implementation as more models migrate to Responses API.

⸻

Additional Considerations

The Responses API introduces features that are becoming the primary interface for modern reasoning models:

  • GPT-5 Pro support
  • Future reasoning model compatibility
  • Unified tool calling
  • Structured outputs
  • Multi-modal input/output
  • Reasoning controls

Supporting only Chat Completions will increasingly limit compatibility with newer OpenAI and Azure OpenAI models.

⸻

Environment

Provider

Azure OpenAI

API Version

2024-12-01-preview

Working Model

gpt-5-mini

Failing Model

gpt-5-pro

Error

Invalid API request
The requested operation is unsupported.

⸻

Benefit

Adding Responses API support would enable compatibility with GPT-5 Pro and future reasoning-focused models while maintaining backward compatibility with existing Chat Completions integrations.

Dominant language
PHP
Stars
49
Forks
11
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from hyperf/odin

All issues in hyperf/odin

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.