Overview/OpenAPI/Quickstart

Quickstart

Learn the basic flow for auth, creation, polling, and result reads.

Quickstart

This page shows how to use OpenAPI for a basic content-creation flow.

The examples below use slides_video for a basic flow. The actual types, ratios, page counts, qualities, languages, voices, and styles still need to come from /catalog.

Get the API Key Before You Start

OpenAPI uses the user's own API key.

If you do not have one yet, go to the main site's API Key page:

  1. activate the API key
  2. copy the API key
  3. come back here and validate it with GET /me

If you are integrating for end users, this step should be part of your connect flow.

Prepare

export KGP_BASE_URL="https://api.kpainter.ai/openapi/v1"export KGP_API_KEY="<your_api_key>"

Step 1: Validate the Key

Once you have the key, validate it before creating anything:

curl -s "$KGP_BASE_URL/me" \  -H "X-KGP-Api-Key: $KGP_API_KEY"

At minimum, confirm:

  • the key is valid
  • it is a user-level key that can create content

Step 2: Read the Catalog

curl -s "$KGP_BASE_URL/catalog" \  -H "X-KGP-Api-Key: $KGP_API_KEY"

Use it to load:

  • supported content types
  • per-type aspect ratio, quality, duration, and page limits
  • languages, voices, and styles

Step 3: Create Content

curl -s "$KGP_BASE_URL/creations" \  -H "Content-Type: application/json" \  -H "X-KGP-Api-Key: $KGP_API_KEY" \  -d '{    "type": "slides_video",    "prompt": "Explain how transformer attention works in 6 pages",    "language": "en",    "aspect_ratio": "16:9",    "scene_count": 6  }'

A basic request usually contains:

  • type
  • prompt
  • the required type-specific fields

Step 4: Poll the Job

curl -s "$KGP_BASE_URL/creations/jobs/<job_id>" \  -H "X-KGP-Api-Key: $KGP_API_KEY"

When the job succeeds, fetch the detail response.

Step 5: Read the Detail

curl -s "$KGP_BASE_URL/creations/<creation_id>" \  -H "X-KGP-Api-Key: $KGP_API_KEY"

This is where you read:

  • main_url
  • artifacts[]
  • scenes[]

Endpoints Used In This Flow

  1. GET /me
  2. GET /catalog
  3. POST /creations
  4. GET /creations/jobs/{job_id}
  5. GET /creations/{creation_id}
  • API Reference for grouped endpoints
  • Authentication for key validation, errors, and security expectations
  • the API Key page for viewing, activating, or rotating the key
  • the content-type pages for scenario-specific guidance