TL;DR: Kenerate AI is a creative workspace that combines image, video, editing, audio, 3D and agent capabilities.
Kenerate AI brings creative tools into one workspace. Developers should first distinguish its native access options, including MCP/CLI and enterprise API access from a separate CometAPI integration. This guide covers access and cost planning, environment setup, image generation, response handling, image editing and asynchronous video creation. Follow the examples to save an original image, an edited variant and a completed clip using Python 3.10+, a CometAPI key and sufficient balance.
Key Takeaways
- Kenerate AI is a multi-model creative service rather than one foundation model.
- Kenerate offers MCP/CLI access as well as enterprise API onboarding; choose the route that matches your application and account.
- Use concrete model IDs and route-specific parameters when building a separate CometAPI integration.
- Save image bytes after generation; keep a video task ID so polling can resume without submitting another job.
- CometAPI offers a separate developer integration for supported image/video models, with separate credentials and billing.
What Is Kenerate AI?
Use Kenerate's studios for interactive creation. Developers can also use its official MCP/CLI tools or contact support about enterprise API access. The access section below explains these options; the Python examples later in this guide call CometAPI separately.
Kenerate AI and CometAPI are separate services.
The code below calls CometAPI directly. It does not sign in to Kenerate, automate a Kenerate studio or spend Kenerate credits. It recreates a narrowly defined creative task using a supported model, rather than claiming identical studio presets or outputs.
Official product-image example from the Kenerate gallery. This illustrates a creative use case; it is not the output of the API code below.
How Does Kenerate AI Pricing Affect API Cost Planning?
Kenerate advertises 25 starter credits and one-time credit packs from $15. Its billing FAQ says purchased credits do not expire and video generation needs a purchased credit pack. These are studio billing terms, not a quote for enterprise API access.
CometAPI uses separate credentials and billing. Before a test or batch, check the selected model and request settings against its cost estimate, set a job limit and inspect recorded usage. Kenerate credits do not determine the cost of CometAPI requests.
How Do You Access Kenerate AI?
Connect through MCP or CLI
Kenerate's official MCP/CLI setup page provides a native developer route. Its remote MCP server is https://mcp.kenerateai.com/mcp. Add the server in a compatible client and complete Kenerate sign-in where supported; follow the setup page for CLI installation and authentication. These tools use your Kenerate account, rather than a CometAPI key.
Request enterprise API access when needed
The official FAQ also describes API access for Enterprise partners through support. For that route, request endpoint documentation, authentication, supported operations, quotas and billing terms. Enterprise onboarding should not be presented as the only native integration option.
How Do You Set Up a Separate CometAPI Workflow?
Account and credentials
Create a CometAPI account and generate a key using the API key setup instructions. Keep the key on your server or development machine. The following Bash commands install the HTTP client and read the key without echoing it. Windows users can run them in WSL or Git Bash.
python -m pip install requests
read -rsp "CometAPI API key: " COMETAPI_KEY
export COMETAPI_KEY
printf '\n'
A small, specific first request
Use one prompt and one output before adding optional controls. For the image workflow, developers can access GPT Image 2 API in CometAPI. The video workflow uses Kling Video API in CometAPI with the route-specific model_name value from its developer quickstart. A studio label is not a substitute for an API identifier.
Compare the CometAPI Examples
| Integration detail | CometAPI image generation | CometAPI Kling video |
|---|---|---|
| Authentication | Bearer COMETAPI_KEY | Bearer COMETAPI_KEY |
| Create path | /v1/images/generations | /kling/v1/videos/text2video |
| Model selector | model | model_name |
| Completion | Synchronous response | Asynchronous task; poll the matching route |
| Output | Decode data[0].b64_json | Download task_result.videos[0].url after success |
CometAPI documents the image request and output fields and the video submission and polling routes separately. Treat credentials, route, body and result parsing as one complete integration.
Can You Use the OpenAI SDK with CometAPI?
Yes, for supported OpenAI-compatible routes. CometAPI's SDK guide uses a CometAPI key and the base URL https://api.cometapi.com/v1. The OpenAI Python SDK supports a custom base_url. Install the SDK separately if you choose it; the runnable image and video scripts below use requests.
python -m pip install openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["COMETAPI_KEY"],
base_url="https://api.cometapi.com/v1",
)
Client configuration only: no generation request is submitted here.
Compatibility applies to the documented endpoint, fields and response shape. It does not make every provider route interchangeable. The image quickstart supports client.images.generate; the Kling example below uses its provider-specific /kling/v1/videos/text2video route and task contract. Follow the matching [image](https://apidoc.cometapi.com/quickstarts/image/gpt-image-api) or [Kling](https://apidoc.cometapi.com/quickstarts/video/kling-api) quickstart rather than substituting a generic SDK video call.
## How to Generate and Save an Image with CometAPI?
### Choose Image Settings
For the first image test, use gpt-image-2, size\="1024x1024", quality\="low" and output\_format\="jpeg". Save the result with a matching file extension. Describe the product, background and lighting clearly. This image route uses the model field and returns image bytes in data\[0].b64\_json.
### Generate and Save the Image
CometAPI documents image generation with [gpt-image-2](https://apidoc.cometapi.com/quickstarts/image/gpt-image-api) and base64 output. This example sends a synchronous request and saves the returned bytes as a JPEG. Save it as generate\_image.py and run python generate\_image.py after setting the environment variable.
import base64
import os
from pathlib import Path
import requests
response = requests.post(
"https://api.cometapi.com/v1/images/generations",
headers={"Authorization": f"Bearer {os.environ['COMETAPI_KEY']}"},
json={
"model": "gpt-image-2",
"prompt": "A ceramic cup on marble, realistic product lighting",
"quality": "low",
"size": "1024x1024",
"output_format": "jpeg",
},
timeout=(10, 180),
)
response.raise_for_status()
payload = response.json()
items = payload.get("data", [])
if not items or not items[0].get("b64_json"):
raise RuntimeError("No image bytes returned; inspect the response schema.")
image_bytes = base64.b64decode(items[0]["b64_json"], validate=True)
if not image_bytes:
raise RuntimeError("The returned image is empty.")
output = Path("product-image.jpeg")
output.write_bytes(image_bytes)
print(f"Saved {output} ({len(image_bytes)} bytes)")
### Check the Saved Image
First confirm that `product-image.jpeg` exists and opens in an image viewer. Then check whether its subject, composition and product details match the prompt. Inspect the subject and composition before changing the prompt. An HTTP 200 response confirms that the request succeeded, but you still need to validate the returned data and inspect the image. If a response contains an error or a different schema, inspect it before changing the decoder; do not save the JSON text with an image extension.
Keep the original image unchanged for later edits. Match the filename extension to the requested output\_format, and inspect important text or product details visually. If you change models, check its response contract before reusing this base64 decoder.
### Edit a Generated or Local Image
Upload the source file as multipart data. State the requested change and the details to preserve; keep the original file and save each approved result under a new name.
For the separate CometAPI workflow, the [image-edit endpoint accepts multipart uploads](https://apidoc.cometapi.com/api/image/openai/image-editing). Save this standalone script as edit\_image.py next to product-image.jpeg from the generation step, then run python edit\_image.py. The prompt requests a single change to the cup’s color, and the script saves the result as `product-image-edited.jpeg`.
import base64
import os
from pathlib import Path
import requests
source = Path("product-image.jpeg")
with source.open("rb") as image_file:
response = requests.post(
"https://api.cometapi.com/v1/images/edits",
headers={"Authorization": f"Bearer {os.environ['COMETAPI_KEY']}"},
files={"image": (source.name, image_file, "image/jpeg")},
data={
"model": "gpt-image-2",
"prompt": "Change only the cup color to matte black. Preserve its shape, background and lighting.",
"quality": "low",
"output_format": "jpeg",
},
timeout=(10, 240),
)
response.raise_for_status()
items = response.json().get("data", [])
if not items or not items[0].get("b64_json"):
raise RuntimeError("No edited image returned; inspect the response.")
edited_bytes = base64.b64decode(items[0]["b64_json"], validate=True)
if not edited_bytes:
raise RuntimeError("The edited image is empty.")
Path("product-image-edited.jpeg").write_bytes(edited_bytes)
print("Saved product-image-edited.jpeg")
#### Using a local reference image
To edit an existing product photo instead, set source to that file. Set the upload MIME type to match its actual format, such as image/png for a PNG. The requested output\_format can remain jpeg regardless of the source format. Let requests generate the multipart Content-Type header; manually forcing application/json would break the file upload.
Reference images help with consistency but do not guarantee exact preservation of logos or product geometry. Keep a human approval step for commercial product claims.
#### Continuing an edit
For another edit, upload the approved output as the next source and write the next instruction. Keep each version under a different filename. Inspect both the requested change and the elements that should remain unchanged before continuing.
## How Do You Submit and Retrieve a Kling Video with CometAPI
### Submit a Video Task
The [Kling](https://apidoc.cometapi.com/quickstarts/video/kling-api) text-to-video quickstart uses an asynchronous task: submit once, retain the ID and query the matching route. The example below uses `model_name="kling-v3"`, `mode="std"`, `duration="5"` and `sound="off"`. These values apply to this CometAPI Kling route. Describe one clear subject action and the intended camera movement.
Use model\_name for this provider-specific route, and keep mode\="std", duration\="5" and sound\="off" for the first test. Save the returned task\_id immediately. This is a text-to-video request; image references require the documented image-to-video route.
Save the code as generate\_video.py. Run python generate\_video.py to create a task. After a polling interruption, run python generate\_video.py TASK\_ID using the saved ID to resume. The [task retrieval contract](https://apidoc.cometapi.com/api/video/kling/individual-queries) documents the result URL and supports both a data envelope and a direct task object.
### Poll the Task and Download the Result
A video creation response supplies a task ID, not a finished media file. Save the ID with the job, inspect task\_status on retrieval and download the result only after success. The complete video script below handles submission, polling, failure and downloading; its resume mode reuses the same job.
Retrieve the existing task with GET /kling/v1/videos/text2video/{task\_id}. Wait for task\_status\="succeed" before reading task\_result.videos\[0].url; handle "failed" as an error. A local polling timeout should preserve the task ID so retrieval can resume without submitting another generation.
import json
import os
import sys
import time
from pathlib import Path
import requests
route = "https://api.cometapi.com/kling/v1/videos/text2video"
headers = {"Authorization": f"Bearer {os.environ['COMETAPI_KEY']}"}
def read_task(response):
response.raise_for_status()
body = response.json()
if body.get("code") not in (None, 0):
raise RuntimeError(f"API error: {body.get('message', body.get('code'))}")
return body.get("data", body)
if len(sys.argv) > 1:
task_id = sys.argv[1]
else:
created = read_task(requests.post(
route, headers=headers,
json={
"model_name": "kling-v3",
"prompt": "A wristwatch on dark marble. Slow lateral camera motion, soft light, no cuts.",
"mode": "std", "duration": "5", "sound": "off",
}, timeout=(10, 60),
))
task_id = created["task_id"]
Path("video-task-id.txt").write_text(task_id, encoding="utf-8")
print(f"Task ID: {task_id}", flush=True)
deadline = time.monotonic() + 600
while time.monotonic() < deadline:
task = read_task(requests.get(
f"{route}/{task_id}", headers=headers, timeout=(10, 30),
))
state = task["task_status"]
if state == "failed":
raise RuntimeError(task.get("task_status_msg") or "Video task failed")
if state == "succeed":
Path("video-result.json").write_text(json.dumps(task), encoding="utf-8")
asset_url = task["task_result"]["videos"][0]["url"]
with requests.get(asset_url, stream=True, timeout=(10, 120)) as asset:
asset.raise_for_status()
with Path("product-video.mp4").open("wb") as output:
for chunk in asset.iter_content(chunk_size=1024 * 1024):
if chunk:
output.write(chunk)
print("Saved product-video.mp4")
break
time.sleep(5)
else:
raise TimeoutError(f"Polling stopped. Resume with task ID {task_id}.")
### Completion and recovery
Open product-video.mp4 and confirm it plays through. The script saves the task result before downloading, so a download failure does not require generating another clip. Its local polling deadline stops waiting; it does not cancel the remote task. Keep the ID and resume retrieval. The asset download deliberately uses a separate unauthenticated request so the CometAPI key is not sent to the media host.
The video example uses text input. An approved image cannot be attached by inventing a reference\_image field on this route; image-to-video requires the selected provider’s documented image workflow.
## How Do You Extend a CometAPI Workflow for Production?
### Job records and reusable assets
Store each prompt, configuration, source asset, task ID and output path under one application job. Keep image revisions separately so users can return to an approved version. For video, persist the task ID before leaving the request handler and let a worker manage retrieval.
### Callbacks and reconciliation
For asynchronous video delivery, follow CometAPI’s [polling and webhook guidance](https://apidoc.cometapi.com/guides/webhook-and-polling-for-video-generation). Add callbacks only after basic polling works, and make duplicate notifications safe to process. Retain a retrieval path for jobs whose callback is delayed or missed.
## How Should You Handle Errors in a CometAPI Workflow?
Apply the [documented API error and retry guidance](https://apidoc.cometapi.com/guides/error-codes-and-retry-strategy) when building this CometAPI workflow. First separate an invalid request from a temporary transport failure. Keep response status, request identifiers and task IDs in server-side logs, while excluding secret keys.
* Authentication failure: verify the key, account access and destination host before retrying.
* Unsupported parameter: return to the smallest documented request, then add one optional field at a time.
* Rate limit or transient polling failure: wait with bounded backoff and resume the existing task query.
* Creation timeout: determine whether the first request created a job before submitting again. Repeating a generation request may produce an additional charge.
* Failed output download: use the retained task result or retrieve the existing task again instead of starting a new generation.
## Conclusion
Choose the service and access route first. For Kenerate, start with the official MCP/CLI setup or discuss enterprise API requirements with support. For a separate CometAPI implementation, configure its key, follow the image or Kling route, inspect saved outputs and retain video task IDs for recovery. A useful first milestone is one valid local image, one edited variant and one playable video.
## FAQ
### Can This CometAPI Workflow Run Entirely in a Browser?
A browser can present prompts and progress, but a public frontend should not contain a secret API key. Put generation requests and task tracking behind your own backend, authenticate the user there and return only the result or progress needed by the interface. A separate CometAPI implementation should follow that same separation.
### What should a team request before Kenerate AI enterprise onboarding?
Ask for the native API documentation and a written description of the models and operations available to your account. Also resolve authentication, quotas, billing, task retention and support ownership. A studio demonstration establishes a creative capability, but does not establish the request schema or service terms your application will receive.
### Will the same Kenerate AI prompt produce identical API output?
Do not rely on it. First align the exact model version, input assets and exposed generation settings. A studio may add defaults or processing that your API request does not reproduce. Preserve the brief and approved reference assets, then review the new output against the actual delivery requirements instead of expecting pixel-identical media.
