Quick Start

Spicy API

Connect AI image and video generation to your app in a few steps, check progress anytime, and pay with credits.

Easy integration

Create images and videos

Pay with credits

Simple workflow

curl -X POST "https://spicyai.site/api/ai-studio/execute" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "modelId": "video:sora2-text-to-video-standard",
    "isPublic": true,
    "payload": {
      "model": "video:sora2-text-to-video-standard",
      "input": {
        "prompt": "A cinematic video of a cat walking in the rain"
      }
    }
  }'
Quick Start

How it works

From account setup to getting your final image or video result.

1

Log in or create an account

2

Create an API Key in the dashboard

3

Call the generation endpoint with your API Key

4

Poll the generation result when a task is queued

5

Read recent generation records

6

Check user profile, credits, and membership status

Authentication

Use your API key

Create an API key after login, then include it in the Authorization header for every request.

Required request header

Create an API Key after login, then include it in every API request.

Authorization: Bearer YOUR_API_KEY

The example domain is automatically resolved from NEXT_PUBLIC_SITE_URL. Replace only YOUR_API_KEY with the key generated in your account.

Request
curl -X GET "https://spicyai.site/api/auth/user" \
  -H "Authorization: Bearer YOUR_API_KEY"
Endpoints

Available API calls

These are the live endpoints currently used by Spicy AI Studio.

POST/api/ai-studio/execute

Start a new generation task. The request uses modelId, isPublic, and payload.

Request Headers

Authorization: Bearer YOUR_API_KEYContent-Type: application/json

Request Parameters

NameTypeRequiredDefaultOptionsDescription
modelIdstringYes-video:wan-text-to-video, video:grok-imagine-text-to-video, video:grok-imagine-image-to-video, video:wan-image-to-video, video:kling-2-6-text-to-video, video:kling-2-6-image-to-video, video:wan-2-7-text-to-video, video:wan-2-7-image-to-video, video:kling-3-0, video:kling-2-6-motion-control, video:wan-2-7-reference-to-video, video:wan-2-7-video-edit, video:kling-3-0-motion-control, image:z-image, image:grok-imagine-image-to-image, image:wan-2-7-image, image:grok-imagine-text-to-image, image:seedream5-0-lite-text-to-image, image:seedream5-0-lite-image-to-image, image:qwen2-text-to-image, image:qwen2-image-edit, image:seedream4-5-text-to-image, image:seedream4-5-edit, image:wan-2-7-image-proModel ID for the video style/version you choose.
isPublicbooleanNotrue-Whether this result can be shown publicly. Default is true.
payloadobjectYes--Main input data for generation. Nested fields change with the selected model.See Dynamic payload fields by model
Request
curl -X POST "https://spicyai.site/api/ai-studio/execute" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "modelId": "video:sora2-text-to-video-standard",
    "isPublic": true,
    "payload": {
      "model": "video:sora2-text-to-video-standard",
      "input": {
        "prompt": "A cinematic video of a cat walking in the rain"
      }
    }
  }'
Response Example
{
  "success": true,
  "data": {
    "modelId": "video:sora2-text-to-video-standard",
    "generationId": "b6a7f5c4-8a7c-4e2b-8cf6-6b8d9b3d8d21",
    "reservedCredits": 20,
    "taskId": "provider-task-id",
    "state": "queued",
    "raw": {},
    "selectedPricing": {}
  }
}
Error Example
{
  "success": false,
  "error": "User not authenticated"
}
GET/api/ai-studio/tasks/{taskId}

Check task progress after create returns taskId and statusSupported=true.

Request Headers

Authorization: Bearer YOUR_API_KEY

Request Parameters

NameTypeRequiredDefaultOptionsDescription
taskIdstringYes--Task ID returned after starting generation.
Request
curl -X GET "https://spicyai.site/api/ai-studio/tasks/provider-task-id" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response Example
{
  "success": true,
  "data": {
    "generationId": "b6a7f5c4-8a7c-4e2b-8cf6-6b8d9b3d8d21",
    "taskId": "provider-task-id",
    "modelId": "video:sora2-text-to-video-standard",
    "state": "running",
    "mediaUrls": [],
    "raw": {},
    "reservedCredits": 20,
    "refundedCredits": 0
  }
}
Error Example
{
  "success": false,
  "error": "Generation record not found"
}
GET/api/ai-studio/video-history?page={page}&limit={limit}&status={status}&q={q}

Get paginated generation history with status and keyword filters.

Request Headers

Authorization: Bearer YOUR_API_KEY

Request Parameters

NameTypeRequiredDefaultOptionsDescription
pagenumberNo1-History page number.
limitnumberNo12-Page size for history list (1-50).
statusstringNoallall, pending, success, failedStatus filter for history list.
qstringNo""-Optional keyword for searching your history.
Request
curl -X GET "https://spicyai.site/api/ai-studio/video-history?page=1&limit=12&status=all" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response Example
{
  "success": true,
  "data": {
    "records": [],
    "total": 0,
    "totalPages": 1,
    "page": 1
  }
}
Error Example
{
  "success": false,
  "error": "Failed to load AI Studio generation history"
}
GET/api/auth/user

Get your account profile, remaining credits, and membership summary.

Request Headers

Authorization: Bearer YOUR_API_KEY

Request Parameters

No request parameters.

Request
curl -X GET "https://spicyai.site/api/auth/user" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response Example
{
  "success": true,
  "data": {
    "user": {
      "id": "user-id",
      "email": "[email protected]",
      "role": "user",
      "name": "Developer",
      "image": null,
      "authType": "apikey"
    },
    "credits": 120,
    "membership": {
      "isVip": false,
      "level": "none",
      "planTitle": null
    }
  }
}
Error Example
{
  "success": false,
  "error": "User not authenticated"
}
Models

Available model IDs

Choose a model ID that matches your desired output.

FamilyVersionmodelId
Spicy Video AI LiteFast Text to Videovideo:wan-text-to-video
Spicy Video AI LiteText to Videovideo:grok-imagine-text-to-video
Spicy Video AI LiteImage to Videovideo:grok-imagine-image-to-video
Spicy Video AIFast Image to Videovideo:wan-image-to-video
Spicy Video AIHD Text to Videovideo:kling-2-6-text-to-video
Spicy Video AIHD Image to Videovideo:kling-2-6-image-to-video
Spicy Video AI ProPro Text to Videovideo:wan-2-7-text-to-video
Spicy Video AI ProPro Image to Videovideo:wan-2-7-image-to-video
Spicy Video AI ProPro Videovideo:kling-3-0
Spicy Video AI ProPro Motion Controlvideo:kling-2-6-motion-control
Spicy Video AI UltraUltra Reference Videovideo:wan-2-7-reference-to-video
Spicy Video AI UltraUltra Video Editvideo:wan-2-7-video-edit
Spicy Video AI UltraUltra Motion Controlvideo:kling-3-0-motion-control
Spicy Image AI LiteLite Imageimage:z-image
Spicy Image AI LiteImage to Imageimage:grok-imagine-image-to-image
Spicy Image AI LiteFast Imageimage:wan-2-7-image
Spicy Image AIText to Imageimage:grok-imagine-text-to-image
Spicy Image AIBalanced Text to Imageimage:seedream5-0-lite-text-to-image
Spicy Image AIImage to Imageimage:seedream5-0-lite-image-to-image
Spicy Image AI ProAdvanced Text to Imageimage:qwen2-text-to-image
Spicy Image AI ProPro Image Editimage:qwen2-image-edit
Spicy Image AI ProPro Text to Imageimage:seedream4-5-text-to-image
Spicy Image AI UltraUltra Image Editimage:seedream4-5-edit
Spicy Image AI UltraUltra Imageimage:wan-2-7-image-pro
Task States

Task progress states

These states tell you whether your generation is waiting, running, done, or failed.

queued
running
succeeded
failed
Model Schema

Dynamic payload fields by model

Pick a model to view the exact input fields supported by /api/ai-studio/models/{modelId}.

Select model
Input field docs
No input field docs were found for this model.
Pricing

Credits-based API billing

Generation requests reserve and settle credits through the existing AI Studio generation flow.

API usage is billed with credits.

Each generation can consume credits based on the selected model, duration, quality, resolution, and pricing row.

Users can check remaining credits from the account or /api/auth/user.

Generation is blocked when the account has insufficient credits.

FAQ

AI Studio API FAQ

Quick answers for setup, billing, and generation progress.

How do I get an API key?

Log in, open the API Keys dashboard, and create an active key. Use it as Authorization: Bearer YOUR_API_KEY.

How do I authenticate API requests?

Send the API key in the Authorization header using the Bearer format on every request.

How is API usage billed?

Generation calls use account credits. The consumed amount depends on the model and selected pricing options.

How do I check video generation status?

After the execute endpoint returns taskId and statusSupported is true, poll /api/ai-studio/tasks/{taskId}?modelId={modelId}.

Where can I view my generation history?

Use /api/ai-studio/video-history for your paginated generation history.

What happens if I run out of credits?

New generation requests cannot continue when the account does not have enough credits.

Can I use the API for commercial projects?

The API can be integrated into production workflows, subject to your account plan and the service terms.

Does the API support different video models?

Yes. Available model IDs are the models configured in config/ai-video-studio.ts.

Start using AI Studio API

Create your API key, run your first request, and track progress in real time.