litellm - 💡(How to fix) Fix Responses API response has wrong object field: "chat.completion" instead of "response"

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The /v1/responses endpoint returns responses with "object": "chat.completion" instead of the OpenAI Responses API spec value "object": "response".

Root Cause

In litellm/responses/litellm_completion_transformation/transformation.py line 1645:

object=chat_completion_response.object,

This directly copies the internal Chat Completions response's object field rather than setting it to "response" for the Responses API response envelope.

Fix Action

Fix

- object=chat_completion_response.object,
+ object="response",

Also need to clear __pycache__ for the change to take effect.

Code Example

object=chat_completion_response.object,

---

- object=chat_completion_response.object,
+ object="response",
RAW_BUFFERClick to expand / collapse

Description

The /v1/responses endpoint returns responses with "object": "chat.completion" instead of the OpenAI Responses API spec value "object": "response".

Root Cause

In litellm/responses/litellm_completion_transformation/transformation.py line 1645:

object=chat_completion_response.object,

This directly copies the internal Chat Completions response's object field rather than setting it to "response" for the Responses API response envelope.

Expected Behavior

OpenAI's Responses API returns "object": "response" in the top-level response. The LiteLLM Responses API endpoint should match this.

Actual Behavior

"object": "chat.completion" is returned, which breaks strict clients (e.g., OpenAI Codex CLI with wire_api = "responses") that validate the response envelope.

Steps to Reproduce

  1. Start LiteLLM proxy with any model
  2. Send a request to /v1/responses
  3. Observe "object": "chat.completion" in the response

Fix

- object=chat_completion_response.object,
+ object="response",

Also need to clear __pycache__ for the change to take effect.

Related

Also noted in issue #11204 but was not fixed by the associated PR.

Environment

  • LiteLLM version: main-latest (ghcr.io/berriai/litellm:main-latest)
  • Python: 3.13

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING