Skip to content

[OpenAI] Responses API support for Node.js #741

@codefromthecrypt

Description

@codefromthecrypt

Is your feature request related to a problem? Please describe.

The OpenAI platform released an alternative to the completions endpoint called responses last month

https://platform.openai.com/docs/api-reference/responses

They are now using this by default in the playground (which generates content) as well as the new codex api written in typescript https://github.com/openai/codex

I've successfully run this with EDOT SDK Node.js, however I only get HTTP spans for the operations because it, like the OpenAI Agents SDK, uses the responses api instead of the completions one.

diff --git a/codex-cli/package.json b/codex-cli/package.json index 38850e6..67d9707 100644 --- a/codex-cli/package.json +++ b/codex-cli/package.json @@ -10,6 +10,7 @@ "node": ">=22" }, "scripts": { + "codex": "node build.mjs --dev && node --env-file .env -r @elastic/opentelemetry-node ./dist/cli-dev.js", "format": "prettier --check src tests", "format:fix": "prettier --write src tests", "dev": "tsc --watch", @@ -43,7 +44,8 @@ "openai": "^4.89.0", "react": "^18.2.0", "shell-quote": "^1.8.2", - "use-interval": "1.4.0" + "use-interval": "1.4.0", + "@elastic/opentelemetry-node": "^1" }, "devDependencies": { "@eslint/js": "^9.22.0",

Describe the solution you'd like

Logs, metrics and tracing for responses like we do for completions.

TODO feature checkboxes

Describe alternatives you've considered

Try to modify https://github.com/openai/codex to support completions instead

Additional context

announcement: https://community.openai.com/t/introducing-the-responses-api/1140929

local inference support of core features

other javascript/typescript/node SDKs

This is the same issue as EDOT Python SDK elastic/elastic-otel-python-instrumentations#62

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions