Skip to content

Use OpenAI Responses API instead of the Chat Completions API #96

@raftaar1191

Description

@raftaar1191

OpenAI has introduced the Responses API (POST /v1/responses) as the new, unified endpoint that consolidates functionality from both Chat Completions and Assistants/Threads APIs.

Advantages of using the Responses API

  • Unified design: One endpoint for chat, tools, and multimodal interactions.
  • Built-in memory: Supports store:true and conversation.id, which means conversations can persist without resending the full message history. This can significantly reduce token usage and costs for long-running chats.
  • Native tool handling: Cleaner definition of tools and structured tool_call outputs, easier to validate and safer than current function-calling prompts.
  • Multimodal ready: Accepts text, images, and audio in the same request.
  • Consistent output: Always returns a response object with output[], usage, status, etc., which simplifies logging and debugging.
  • Future direction: OpenAI is evolving the Responses API, while Chat Completions is effectively a legacy path for new projects.

Disadvantages / Migration Considerations

  • Newer API: Responses API is less mature; not all SDKs or plugins in the ecosystem support it fully yet.
  • Learning curve: Output parsing is slightly more complex (output[] vs. choices[0].message.content).
  • Migration cost: Projects already using Chat Completions will need refactoring to adapt request/response handling.
  • Community ecosystem: Most tutorials and sample code still target Chat Completions.

Proposal

Evaluate adding support for the Responses API in this client library, either:

  1. As a replacement for Chat Completions, or
  2. As an additional option, allowing developers to choose between chat.completions and responses.

This would ensure the library stays aligned with OpenAI’s current API direction and provides WordPress developers with a future-proof integration option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature]New feature to highlight in changelogs.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions