New: Nano Banana 2.1Try the model
API Stock

API Stock vs CometAPI

CometAPI alternative

Compare CometAPI with API Stock for model pricing and integration. Start with a shared Seedream image workload, then use the same account balance for chat, video and music.

How API Stock compares with CometAPI

When to choose API Stock

Choose API Stock when you want chat and asynchronous media tasks in one account. Compare each CometAPI route on price before deciding which traffic to move.

When to keep CometAPI

CometAPI can be cheaper for an individual model: the Seedream comparison below shows both rates. Keep routes or model features that the current API Stock catalog does not offer.

CometAPI API documentation

Scroll horizontally to read all table columns.

API changes: CometAPI to API Stock
Integration detailCometAPIAPI Stock
RequestPOST /v1/images/generationsPOST /api/v1/generation/create
AuthenticationAuthorization: BearerAuthorization: Bearer
Model identifierdoubao-seedream-4-5-251128seedream-4-5

This compares the example model below, not every endpoint the provider offers. Shared model names do not guarantee identical parameters, moderation or output.

Price comparison: CometAPI and API Stock

Selected shared models with matching billing units. Our prices come from the current catalog; competitor prices are dated observations linked to their sources.

Price comparison: CometAPI and API Stock
Seedream 4.52K · per image · text to imageAPI Stock$0.036CometAPI$0.03212.5% higher
Seedream 5.0 Lite2K · per image · text to imageAPI Stock$0.03325CometAPI$0.02818.8% higher

One image from a text prompt, without reference images. These are public base rates; plans, volume discounts, other resolutions and editing can change the final price.

What a workload costs

Seedream 4.5 · 2K

1,000 images, the configuration above

API Stock
$36
CometAPI
$32

Seedream 5.0 Lite · 2K

1,000 images, the configuration above

API Stock
$33.25
CometAPI
$28

Illustrative totals from the rows above, without volume discounts, subscriptions or additional paid options. These examples do not predict latency or identical outputs.

Pricing

Migrating from CometAPI

Chat integrations can keep the OpenAI SDK after changing the base URL, key and model id. Image calls to /v1/images/generations must move to our asynchronous /api/v1/generation/create endpoint, with task polling or a webhook.

  1. 1

    Create an account, top up your prepaid balance and issue an API key.

  2. 2

    POST to /api/v1/generation/create with the public model id and its documented parameters. Each task generates one output.

  3. 3

    Read taskId from the response. Poll GET /api/v1/task/status/TASK_ID, or set webhook in the creation request.

CometAPI

bash
curl --fail-with-body 'https://api.cometapi.com/v1/images/generations' \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "doubao-seedream-4-5-251128",
"prompt": "A ceramic mug on a wooden table, soft morning light",
"size": "2K",
"n": 1
}'

API Stock

bash
curl --fail-with-body 'https://api.api-stock.com/api/v1/generation/create' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "seedream-4-5",
"prompt": "A ceramic mug on a wooden table, soft morning light",
"resolution": "2K",
"size": "1:1"
}'
Complete example: create a task and download its result

Run on your server with Node 22+ or Bun and API_KEY set. This example creates one paid task, then polls without creating it again. Finished URLs are temporary: save the file to your own storage.

javascript
import { writeFile } from "node:fs/promises";
const baseURL = "https://api.api-stock.com/api/v1";
const apiKey = process.env.API_KEY;
if (!apiKey) throw new Error("Set API_KEY on the server");
async function request(path, options = {}) {
const response = await fetch(baseURL + path, {
...options,
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) throw new Error(await response.text());
return response.json();
}
const { taskId } = await request("/generation/create", {
method: "POST",
body: JSON.stringify({
"model": "seedream-4-5",
"prompt": "A ceramic mug on a wooden table, soft morning light",
"resolution": "2K",
"size": "1:1"
}),
});
if (!taskId) throw new Error("Missing taskId");
const deadline = Date.now() + 10 * 60_000;
let fileUrl;
while (Date.now() < deadline) {
const { data } = await request(`/task/status/${encodeURIComponent(taskId)}`);
if (data.status === "finished") {
fileUrl = data.files?.[0]?.fileUrl;
if (!fileUrl) throw new Error("Task finished without a file");
break;
}
if (data.status === "failed" || data.status === "expired") {
throw new Error(data.errorMessage || data.status);
}
await new Promise((resolve) => setTimeout(resolve, 2000));
}
if (!fileUrl) throw new Error(`Still processing: save taskId ${taskId} and resume polling`);
const file = await fetch(fileUrl, { signal: AbortSignal.timeout(60_000) });
if (!file.ok) throw new Error(`Download failed: ${file.status}`);
const mime = file.headers.get("content-type")?.split(";")[0];
const extension = { "image/png": "png", "image/jpeg": "jpg", "image/webp": "webp" }[mime] || "bin";
await writeFile(`generated-image.${extension}`, new Uint8Array(await file.arrayBuffer()));

Keep API keys on your server. When migrating, test one request and compare its parameters, status handling and output before moving production traffic.

Frequently asked questions

How do I migrate from CometAPI?

Chat integrations can keep the OpenAI SDK after changing the base URL, key and model id. Image calls to /v1/images/generations must move to our asynchronous /api/v1/generation/create endpoint, with task polling or a webhook.

Is API Stock always cheaper than CometAPI?

No. Compare the exact model, configuration and billing unit in the table. Prices can move in either direction; check both catalogs before sending production traffic.

Can I move every CometAPI workflow?

CometAPI can be cheaper for an individual model: the Seedream comparison below shows both rates. Keep routes or model features that the current API Stock catalog does not offer.

What happens to failed or unfinished requests?

Media tasks retry according to the configured routes; a reserve is used when one is available. A terminal generation failure is refunded. Keep polling a processing task instead of creating a duplicate. An expired file URL is not a failed generation.

How do I top up the balance?

Available payment methods, currencies and minimum top-up amounts are shown in your account before payment. There is no subscription: model usage is charged to your prepaid balance.

Try your first request on API Stock

Choose a model, check its parameters and price, then create an API key in your account. Start with one request before moving your traffic.