All Integrations

Dify Integration

Connect NextAPI as a custom tool in Dify to add video generation capabilities to your AI applications. Dify's tool system lets you define external API endpoints that agents can call.

Configuration

Set the following values in your Dify configuration:

yaml
# Dify Custom Tool Schema
openapi: "3.0"
info:
  title: NextAPI Video Generation
  version: "1.0"
servers:
  - url: https://api.nextapi.top
paths:
  /v1/video/generations:
    post:
      operationId: generateVideo
      summary: Generate an AI video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [model, prompt]
              properties:
                model:
                  type: string
                  default: seedance-2.0-pro
                prompt:
                  type: string
                duration_seconds:
                  type: integer
                  default: 6
                resolution:
                  type: string
                  default: "1080p"

Setup Steps

  1. 1In Dify Studio, navigate to Tools → Custom and click "Create Custom Tool".
  2. 2Paste the OpenAPI schema above into the schema editor.
  3. 3Configure the authentication: select "API Key" and set the header to "Authorization" with prefix "Bearer".
  4. 4Enter your NextAPI API key and save the tool.
  5. 5In your Dify app, add the "Generate Video" tool to your agent's toolset.
  6. 6Test by asking the agent to generate a video — it will call NextAPI automatically.

Test with cURL

Verify your setup by running this command:

bash
curl -X POST https://api.nextapi.top/v1/video/generations \
  -H "Authorization: Bearer $NEXTAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2.0-pro",
    "prompt": "aerial view of a city at sunset",
    "duration_seconds": 6,
    "resolution": "1080p"
  }'

Need help?

Contact our integrations team at support@nextapi.dev or check the full API documentation.