app icon
OpenAI
1.0.0

Current OpenAI language, embedding, moderation, and audio models.

langgenius/openai695160 installs

OpenAI

[!IMPORTANT]
Version 1.0 is a major rewrite of the plugin runtime, model catalog, and test suite.
It replaces the underlying request and streaming logic, removes deprecated model configurations, and adds focused coverage for reasoning, tool calls, multimodal inputs, and interleaved streams.

This plugin connects Dify to OpenAI language, embedding, moderation, speech-to-text, and text-to-speech models.

What changed in 1.0

  • The LLM integration was rewritten around the official OpenAI Python SDK.
  • The Responses API is now the default for supported language models.
  • Chat Completions remains available for compatible endpoints and audio-capable chat models.
  • Stateless reasoning replay preserves every OpenAI output item, including encrypted reasoning items and assistant phase metadata.
  • Reasoning summaries, refusals, parallel function calls, terminal states, usage, and stream cancellation now have explicit handling.
  • The model catalog was checked against OpenAI's model and deprecation documentation.
  • Deprecated and unavailable model entries were removed, while missing current entries were added.
  • The deprecated , , and aliases were removed while their still-current dated snapshots remain available.
  • The tests were reorganized into parameterized pytest suites with request, response, streaming, and non-LLM boundary coverage.

Capabilities

  • Text and vision generation.
  • Structured outputs and function calling.
  • Reasoning effort, summaries, modes, and context controls where supported by the selected model.
  • URL and base64 image or document inputs through the Responses API.
  • Audio input through supported Chat Completions models.
  • Text embeddings.
  • Text moderation through .
  • Speech transcription and text-to-speech streaming.

Configure

Install the plugin and open the OpenAI provider in Dify's Model Provider settings.

Add an OpenAI API key and, when needed, an Organization ID or custom API base URL.

The API base may be entered with or without the trailing .

Responses is the recommended protocol and the default for official models that support it.

Choose Chat Completions only for a compatible endpoint or a model whose documented API surface requires it.

Reasoning state

The plugin sends by default and requests encrypted reasoning content when it uses the Responses API.

Complete response output items are stored in the assistant message's opaque payload and replayed in original order on the next turn.

Reasoning summaries are user-visible only when is enabled for a supported model.

OpenAI may require organization verification before returning reasoning summaries.

Development

Install the locked environment and run the checks from this directory.

Live OpenAI API tests

The tests in send billable requests to the real OpenAI API whenever a nonempty is available.

They skip dynamically only when the key is missing, empty, or whitespace-only in both and the process environment.

Create a local in this plugin directory for test credentials.

The test harness reads only those OpenAI variables from , and explicit process environment variables take precedence.

The repository ignores ; never commit it or include its values in test output.

Run the complete matrix.

The complete matrix sends one logical request for every configured model plus focused boundary requests, and the tool replay scenario sends a second request.

The OpenAI SDK may retry transient failures, so actual HTTP attempts can exceed the logical request count.

It should be run serially because parallel execution increases both spend and rate-limit pressure.

Use standard pytest node IDs or expressions to focus the matrix while developing.

The following smoke command sends one short request.

The presentation matrix gives every LLM in one minimal request, using streaming whenever the model contract supports it.

Embedding, moderation, speech-to-text, and text-to-speech tests are derived from every YAML configuration in their respective model directories.

Representative models separately cover Responses and Chat Completions, streaming and non-streaming, structured output, reasoning summaries, streamed function calls, encrypted reasoning replay, stop and incomplete states, and image, document, and audio inputs.

Exact event interleavings, fragmented tool arguments, empty reasoning blocks, failures, cancellation, and malformed responses remain in deterministic unit tests because a live service cannot reliably reproduce those event orders.

Cases blocked only by OpenAI organization verification are reported as skips; all other API errors fail the run.

Reasoning summary coverage may also be skipped when OpenAI accepts the request but withholds the summary from an unverified organization.

Official references

CATEGORY
Model
VERSION
1.0.0
langgenius·07/10/2026 10:04 AM
REQUIREMENTS
LLM invocation
Tool invocation
Maximum memory
1MB