Skip to main content
Endpoints are HTTP interfaces exposed by a plugin for integration with external systems. This guide explains their structure using the Neko Cat project as an example. For the complete plugin code, see the GitHub repository.

Group Definition

An Endpoint group is a collection of multiple Endpoints. When you create a new Endpoint in a Dify plugin, you may need to fill in the following configuration.
Endpoint Group Configuration Form
Besides the Endpoint Name, you can add form items by writing the group’s configuration. After saving, you can see the multiple interfaces the group contains, all sharing the same configuration.
Endpoint Group Interface List

Structure

  • settings (map[string] ProviderConfig): Endpoint configuration definition.
  • endpoints (list[string], required): Points to the specific endpoint interface definitions.

Interface Definition

  • path (string): Follows the Werkzeug interface standard.
  • method (string): Interface method; supports only HEAD, GET, POST, PUT, DELETE, and OPTIONS.
  • extra (object): Configuration information beyond the basic details.
    • python (object)
      • source (string): The source code that implements this interface.

Interface Implementation

Implement a subclass of dify_plugin.Endpoint and its _invoke method.
  • Input parameters
    • r (Request): The Request object from werkzeug.
    • values (Mapping): Path parameters parsed from the path.
    • settings (Mapping): Configuration information for this Endpoint.
  • Return
    • A Response object from werkzeug; streaming responses are supported.
    • Returning a string directly is not supported.
Example code:

Notes

  • Endpoints are only instantiated when the plugin is called; they are not long-running services.
  • Pay attention to security when developing Endpoints, and avoid executing dangerous operations.
  • Endpoints can handle webhook callbacks or provide interfaces for other systems to connect to.
If you’re new to plugin development, start with Getting Started with Plugin Development and the Developer Cheatsheet.
Last modified on June 24, 2026