Skip to main content

Quickstart

Use the Deep Art API to generate images and videos from text prompts. The API is available at https://api.deepart.ai in local development and authenticates every request with the X-API-Key header.

What you need

  • A running Deep Art API service on https://api.deepart.ai
  • An API key with available tokens
  • curl or another HTTP client

Set the base URL and API key once:

export DEEP_ART_API_URL="https://api.deepart.ai"
export DEEP_ART_API_KEY="replace-with-your-api-key"

Check your token balance

Before starting a generation, confirm that the API key has tokens available.

curl "$DEEP_ART_API_URL/api/credits/balance" \
-H "X-API-Key: $DEEP_ART_API_KEY"

Example response:

{
"tokensBalance": 100
}

Generate an image

Send a text prompt and model identifier to POST /v1/images/generate.

curl "$DEEP_ART_API_URL/api/images/generate" \
-H "X-API-Key: $DEEP_ART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cinematic portrait of a glass city at sunrise"
}'

The response contains the generated image URL:

{
"url": "https://example.com/generated-image.png"
}

Generate a video

Video generation is asynchronous. First submit a job to POST /v1/videos/generate.

curl "$DEEP_ART_API_URL/v1/videos/generate" \
-H "X-API-Key: $DEEP_ART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A drone flying over a mountain range at sunset",
"duration": 4,
"resolution": "720p",
"aspectRatio": "16:9",
"generateAudio": false
}'

The API returns a job ID and the current status:

{
"id": "job_123",
"status": "queued"
}

Poll the video status

Use the returned job ID with GET /v1/videos/{jobId} until the status is completed.

curl "$DEEP_ART_API_URL/v1/videos/job_123" \
-H "X-API-Key: $DEEP_ART_API_KEY"

When the job completes, videoUrls contains the generated files.

{
"id": "job_123",
"status": "completed",
"videoUrls": [
"https://example.com/generated-video.mp4"
]
}

Common errors

  • 401 Unauthorized: the X-API-Key header is missing or invalid.
  • Empty or failed generation result: check that the model identifier, prompt, and token balance are valid.
  • Video has no videoUrls yet: continue polling until the job reaches completed.