bruxel.ai

Examples

The integration flow in curl, Python and JavaScript. Replace bxk_your_key with the one you created in the console.

Authenticate and verify

Every call carries your API key as a Bearer token. Start by confirming it works with GET /v1/me.

const BASE = "https://bruxel.ai/api/public/v1";
const h = { Authorization: "Bearer bxk_tu_llave" };

const res = await fetch(BASE + "/me", { headers: h });
console.log(await res.json()); // { tenant, key: { scopes, ... } }

Push your catalog

Create or update products by SKU (bulk upsert, up to 500 per request).

const res = await fetch(BASE + "/products", {
  method: "POST",
  headers: { ...h, "Content-Type": "application/json" },
  body: JSON.stringify({
    products: [{ sku: "CAMISA-001", name: "Camisa de lino", brand: "Acme" }],
  }),
});
console.log(await res.json()); // { total, created, updated, skipped }

Generate a description

Synchronous generation: charges on success. The Idempotency-Key is recommended for safe retries.

const res = await fetch(BASE + "/generations", {
  method: "POST",
  headers: {
    ...h,
    "Content-Type": "application/json",
    "Idempotency-Key": "gen-camisa-001-v1",
  },
  body: JSON.stringify({ product_id: "prod_8f2", languages: ["es", "en"] }),
});
const data = await res.json(); // { results, total_credits_charged, balance }

Generate in a batch

For volume: reserve credits with a required Idempotency-Key and poll until the batch ends — the poll charges the successes and refunds the rest.

const submit = await fetch(BASE + "/batches", {
  method: "POST",
  headers: {
    ...h,
    "Content-Type": "application/json",
    "Idempotency-Key": "batch-2026-07-23-a",
  },
  body: JSON.stringify({ product_ids: ["prod_8f2", "prod_9a1"] }),
});
const { id } = await submit.json();

// Poll hasta status "ended" (el GET cobra éxitos y reembolsa el resto)
let batch;
do {
  await new Promise((r) => setTimeout(r, 10000));
  batch = await (await fetch(BASE + "/batches/" + id, { headers: h })).json();
} while (batch.status !== "ended");

Read and export

Read a product's current description or export the whole generated catalog to CSV.

// Descripción actual
const desc = await (
  await fetch(BASE + "/products/prod_8f2/descriptions", { headers: h })
).json();

// Export a CSV
const csv = await (
  await fetch(BASE + "/export/catalog.csv?language=es", { headers: h })
).text();
Examples — Bruxel