Skip to content

feat(openai): Add gen_ai.response.id for Chat Completions and Responses API#1644

Open
jimilp7 wants to merge 1 commit intopydantic:mainfrom
introspection-org:feat/openai-add-gen-ai-response-id
Open

feat(openai): Add gen_ai.response.id for Chat Completions and Responses API#1644
jimilp7 wants to merge 1 commit intopydantic:mainfrom
introspection-org:feat/openai-add-gen-ai-response-id

Conversation

@jimilp7
Copy link
Contributor

@jimilp7 jimilp7 commented Jan 22, 2026

Adds the gen_ai.response.id span attribute for OpenAI Chat Completions and Responses API, capturing the response ID (chatcmpl-xxx or resp-xxx).

Changes

  1. Chat Completions: Set gen_ai.response.id from response.id
  2. Responses API: Set gen_ai.response.id from response.id
  3. Responses API: Use full request_data (consistent with other endpoints)

Why This Matters

For Responses API multi-turn conversations using previous_response_id:

  • Turn 1 now exposes gen_ai.response.id: "resp_xxx"
  • Turn 2 now has request_data.previous_response_id: "resp_xxx"
  • Observability tools can link these spans together

The request_data change also fixes an inconsistency where Responses API only captured model and stream, while all other endpoints capture the full request payload.

…es API

Description:
  Adds the `gen_ai.response.id` span attribute for OpenAI Chat Completions and Responses API, capturing the response ID (`chatcmpl-xxx` or `resp-xxx`).

  ## Changes

  1. **Chat Completions**: Set `gen_ai.response.id` from `response.id`
  2. **Responses API**: Set `gen_ai.response.id` from `response.id`
  3. **Responses API**: Use full `request_data` (consistent with other endpoints)

  ## Why This Matters

  For Responses API multi-turn conversations using `previous_response_id`:
  - Turn 1 now exposes `gen_ai.response.id: "resp_xxx"`
  - Turn 2 now has `request_data.previous_response_id: "resp_xxx"`
  - Observability tools can link these spans together

  The `request_data` change also fixes an inconsistency where Responses API only captured `model` and `stream`, while all other endpoints capture the full request payload.
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.

1 participant