Connect NextAPI as a custom tool in Dify to add video generation capabilities to your AI applications. Dify's OpenAPI tool system lets you define external API endpoints that agents can call — no plugin required.
Set the following values in your Dify configuration:
# Dify Custom Tool Schema
openapi: "3.0"
info:
title: NextAPI Video Generation
version: "1.0"
servers:
- url: https://api.nextapi.top
paths:
/v1/videos:
post:
operationId: generateVideo
summary: Generate an AI video
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [model, input]
properties:
model:
type: string
default: seedance-2.0-pro
input:
type: object
required: [prompt]
properties:
prompt:
type: string
duration_seconds:
type: integer
default: 6
resolution:
type: string
default: "1080p"
responses:
"202":
description: Video task created
content:
application/json:
schema:
type: object
properties:
id:
type: string
status:
type: string
estimated_cost_cents:
type: integer
/v1/videos/{id}:
get:
operationId: getVideo
summary: Get an AI video task result
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
"200":
description: Video task status
content:
application/json:
schema:
type: object
properties:
id:
type: string
status:
type: string
enum: [queued, running, succeeded, failed]
output:
type: object
properties:
url:
type: string
video_url:
type: string
error:
type: stringVerify your setup by running this command with your real sk_live_ key:
$NEXTAPI_KEY with your actual key from app.nextapi.top.CREATE_RESPONSE=$(curl -sS -X POST https://api.nextapi.top/v1/videos \
-H "Authorization: Bearer $NEXTAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.0-pro",
"input": {
"prompt": "aerial view of a city at sunset",
"duration_seconds": 6,
"resolution": "1080p"
}
}')
VIDEO_ID=$(printf '%s' "$CREATE_RESPONSE" | jq -r '.id')
curl -sS "https://api.nextapi.top/v1/videos/$VIDEO_ID" \
-H "Authorization: Bearer $NEXTAPI_KEY"Contact our integrations team at support@nextapi.top or check the full API documentation.