Generate

Create AI-generated images and videos

Create AI-generated content using a unified endpoint.

POST /api/v1/generate

Request

Headers

HeaderRequiredDescription
AuthorizationYesBearer token with your API key
Content-TypeYesMust be application/json

Body Parameters

ParameterTypeRequiredDescription
modelstringYesThe model to use
promptstringYesText description of what to generate
optionsobjectNoModel-specific options

Options

OptionTypeDescription
aspectRatiostringOutput aspect ratio
resolutionstringFor nano-banana-pro: 1K, 2K, or 4K
durationnumberFor video models: 10 or 15 seconds
imagestringBase64 or URL for image-to-video

Example Request

curl -X POST https://vicsee.com/api/v1/generate \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2",
    "prompt": "A timelapse of a flower blooming",
    "options": {
      "duration": 10,
      "aspectRatio": "16:9"
    }
  }'

Response

{
  "success": true,
  "data": {
    "id": "task_abc123",
    "model": "sora-2",
    "status": "processing",
    "creditsUsed": 20,
    "creditsRemaining": 480,
    "createdAt": "2024-12-27T10:30:00.000Z"
  }
}

Response Fields

FieldTypeDescription
idstringUnique task ID for polling status
modelstringThe model used
statusstringpending, processing, success, or failed
creditsUsednumberCredits consumed
creditsRemainingnumberYour remaining balance

Next Steps

  1. Save the id from the response
  2. Poll GET /api/v1/tasks/id for status updates
  3. When status is success, download your content

Errors

CodeDescription
MISSING_MODELNo model specified
MISSING_PROMPTNo prompt provided
INVALID_MODELModel does not exist
INSUFFICIENT_CREDITSNot enough credits
RATE_LIMITEDToo many requests