@meterapp/car-image-sdk 1.40.0 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mcp/index.js CHANGED
@@ -12,13 +12,13 @@ import { checkoutLinkToolSchema, checkoutStatusResultSchema, checkoutStatusSchem
12
12
  */
13
13
  import * as z from "zod";
14
14
  import { isColor } from "../params.js";
15
- import { CATALOG, CHECK_STATUSES, COLORS, CREDITS_PER_3D_MODEL, CREDITS_PER_DOLLAR, CREDITS_PER_IMAGE, DEFAULT_BASE_URL, FITS, FORMATS, FRAMINGS, FREE_CREDITS, FREE_VEHICLE_IMAGES, PLAN_ALLOWANCES, IDEMPOTENCY_KEY_PATTERN, MAX_CHECK_VEHICLES, MAX_CHECK_VIEWS_VEHICLES, ASPECT_RATIOS, RESOLUTIONS, MAX_PADDING_PERCENT, MIN_YEAR, MODEL_3D_FILE_KINDS, REFERRAL_SOURCES, REQUEST_FORMATS, REQUEST_KINDS, REQUEST_SORTS, REQUEST_STATUSES, SIZES, VEHICLE_ID_PATTERN, VIEWS, } from "../types.js";
15
+ import { CATALOG, CHECK_STATUSES, COLORS, CREDITS_PER_3D_MODEL, CREDITS_PER_DOLLAR, CREDITS_PER_IMAGE, DEFAULT_BASE_URL, FITS, FORMATS, FRAMINGS, FREE_CREDITS, FREE_COURTESY_VEHICLE_IMAGES, FREE_VEHICLE_IMAGES, PLAN_ALLOWANCES, IDEMPOTENCY_KEY_PATTERN, MAX_CHECK_VEHICLES, MAX_CHECK_VIEWS_VEHICLES, ASPECT_RATIOS, RESOLUTIONS, MAX_PADDING_PERCENT, MIN_YEAR, MODEL_3D_FILE_KINDS, REFERRAL_SOURCES, REQUEST_FORMATS, REQUEST_KINDS, REQUEST_SORTS, REQUEST_STATUSES, SIZES, MARKET_PATTERN, VEHICLE_ID_PATTERN, VIEWS, } from "../types.js";
16
16
  import { SDK_VERSION } from "../version.js";
17
17
  /** The 3D price as agents read it: "100 credits ($1.00)". */
18
18
  const RESOLUTION_NAMES = Object.keys(RESOLUTIONS);
19
19
  /** What an image's own size is, wherever the tools state a size limit. */
20
20
  const STORED_SIZE_NOTE = "1024 px square for older renders, up to 2560 px for new ones";
21
- const MODEL_3D_PRICE = `${CREDITS_PER_3D_MODEL.toLocaleString("en-US")} credits ($${(CREDITS_PER_3D_MODEL / CREDITS_PER_DOLLAR).toFixed(2)})`;
21
+ const MODEL_3D_PRICE = `${CREDITS_PER_3D_MODEL.toLocaleString("en-US")} credits`;
22
22
  /**
23
23
  * Catalog size as agents read it in the instructions and tool descriptions.
24
24
  * Derived from CATALOG so the figures cannot drift from the database; agents
@@ -47,7 +47,7 @@ export const MCP_SERVER_INFO = {
47
47
  */
48
48
  export const MCP_SERVER_CAPABILITIES = { tools: { listChanged: false } };
49
49
  /**
50
- * Which tools a server exposes. `core`, the default, is what an agent needs to
50
+ * Which tools a server exposes. `core`, the stdio default, is what an agent needs to
51
51
  * look a vehicle up, render it and watch the balance (the 2026-09-29 audit of
52
52
  * the public surface found those carrying all of the MCP traffic), plus the
53
53
  * four feedback tools every fleet product puts in its default list
@@ -55,8 +55,7 @@ export const MCP_SERVER_CAPABILITIES = { tools: { listChanged: false } };
55
55
  * review. `all`
56
56
  * adds make logos, 3D models, image options, the API reference, pricing, help
57
57
  * and billing links, plus the tools that are served but kept out of the public
58
- * reference ({@link MCP_UNLISTED_TOOLS}), for hosts that opt in (`?toolset=all`
59
- * on the remote URL, `car-image mcp --toolset all` locally). Fewer, sharper
58
+ * reference ({@link MCP_UNLISTED_TOOLS}), on the hosted endpoint by default and with `car-image mcp --toolset all` locally. Fewer, sharper
60
59
  * tools cost less context and make the right one easier to pick. `all` lists
61
60
  * the core tools first: tools/list order is what a host shows.
62
61
  */
@@ -157,8 +156,8 @@ export function isMcpToolset(value) {
157
156
  * the rest, which used to be everything from the third workflow step on: the
158
157
  * rule about signed URLs, the one about a 402, the missing-vehicle rule. What
159
158
  * an agent must know to use the tools well and safely is therefore written
160
- * first and kept under this length ({@link mcpInstructionsHead}); the text
161
- * after it is reference for hosts that pass everything.
159
+ * in the shared instructions and kept under this length ({@link mcpInstructionsHead}).
160
+ * Tool-specific guidance belongs in the tool descriptions.
162
161
  */
163
162
  export const MCP_INSTRUCTIONS_HEAD_LIMIT = 2048;
164
163
  /**
@@ -167,8 +166,6 @@ export const MCP_INSTRUCTIONS_HEAD_LIMIT = 2048;
167
166
  * instructions no longer steer an agent to them.
168
167
  */
169
168
  const HEAD_MISSING = "tell the human the catalog does not carry it and stop";
170
- /** When to use the feedback tools, which every toolset has. */
171
- const HEAD_FEEDBACK = "Feedback (free): when a call fails in a way that looks like our bug, offer report_issue with its request_id; when the human wishes the API did something, request_feature. Both return similar items first: upvote_feedback a match instead. After real use, offer submit_review.";
172
169
  /** The 3D rule, shown only where create_3d_model is a tool the host has. */
173
170
  const HEAD_3D = "Confirm with the human before calling create_3d_model. ";
174
171
  function toolsetHas(toolset, tool) {
@@ -183,32 +180,19 @@ function toolsetHas(toolset, tool) {
183
180
  * the rest.
184
181
  */
185
182
  export function mcpInstructionsHead(toolset = DEFAULT_MCP_TOOLSET) {
186
- return `Car Image API by Meter: studio vehicle renders from the open @meterapp/vehicle-db catalog, nine views, any paint color.
183
+ return `Car Image API by Meter provides vehicle images from the @meterapp/vehicle-db catalog in nine views and any paint color.
187
184
 
188
- First look the vehicle up: resolve_vehicle reads a year/make/model phrase and returns params.vehicle_id, view and color; search_vehicles browses; decode_vin reads a VIN; check_vehicles checks a list of up to ${MAX_MCP_CHECK_VEHICLES} at once. All are free. Do this even for a car you picked yourself: catalog names differ from familiar names. Include a year; if the human named none, choose one and say which. Reuse an id already in this conversation.
185
+ First look the vehicle up with resolve_vehicle, search_vehicles or decode_vin. Use check_vehicles for up to ${MAX_MCP_CHECK_VEHICLES} vehicles at once. Include the requested year. If the user gave no year, state which year you selected. Use the returned vehicle id as vehicle for subsequent calls. If confidence is low or the year differs, ask the user before proceeding. If there is no match, ${HEAD_MISSING}. Never substitute another vehicle.
189
186
 
190
- In ChatGPT, call create_car_image_urls with images: [{ vehicle: "veh_…", view, color }], ttl_seconds: 604800 and max_uses: 0: its image card shows the pictures inline. Do not call get_car_image first or repeat a render to fix display. In other chat hosts, get_car_image returns the picture inline; name the vehicle, view and color. In a terminal, or where tool images reach only you, call create_car_image_urls once instead and link its URL. Reuse existing URLs. Pages, apps, emails and documents use signed URLs; never put keys in client code.
187
+ Use get_image_availability to check prepared views and quality without rendering. In ChatGPT, create_car_image_urls shows the image card. For an image in chat, request ttl_seconds: 604800, max_uses: 0 and renew: false. Other chat hosts can display get_car_image. Use signed URLs for pages, apps, emails and documents, or when the host cannot display image bytes. Reuse a valid URL and link to it if the card is unavailable. Use one image call per requested image. Never place the API key in URLs, logs or client code.
191
188
 
192
- If lookup confidence is low or the year differs from the request, ask before making an image. If no match, ${HEAD_MISSING}; never silently substitute a car.
189
+ Catalog lookups are free. A new account includes ${FREE_VEHICLE_IMAGES} free vehicle images in total and ${FREE_COURTESY_VEHICLE_IMAGES} more as a one-time courtesy after those run out. A vehicle image is one vehicle in one color from one view. Confirm the count before expanding a batch the user did not size. ${toolsetHas(toolset, "create_3d_model") ? HEAD_3D : ""}On HTTP 402, stop and share any link in the response. On HTTP 429, honor retry_after or reset_at when present.
193
190
 
194
- Free: every new account includes ${FREE_VEHICLE_IMAGES} free vehicle images a month (a vehicle in one color from one angle, shown as often as needed at any size), and lookups are always free. Confirm the count before a batch the human did not size. ${toolsetHas(toolset, "create_3d_model") ? HEAD_3D : ""}If a call is refused with HTTP 402, stop and hand the human the link it returns; do not retry it.
195
-
196
- ${HEAD_FEEDBACK}`;
191
+ Use feedback tools when requested. Confirm the text before posting or replacing a public review.`;
197
192
  }
198
- const REFERENCE_BLOCKS = [
199
- { needs: [], text: `Reference.\n\nImages: nine camera views (front, rear, both side profiles, all four three-quarter corners and top, straight down from above), any paint color (fifteen named presets or any hex such as #1a2b3c), PNG/WebP/JPG up to 1024 px, any width and height (fit contain|cover|inside), transparent or a solid background color. Every catalog vehicle has a stable id (veh_ followed by 13 characters) that search_vehicles, resolve_vehicle, decode_vin and check_vehicles return and every tool that names a vehicle accepts as \`vehicle\` in place of make, model and year.` },
200
- { needs: ["create_3d_model", "get_3d_model", "publish_3d_model"], text: `3D models: for a textured 3D model (GLB, USDZ, FBX), call create_3d_model once the human has agreed to the cost, then poll get_3d_model every few seconds until status is ready and hand over files.<kind>.url; the first model of a vehicle takes 10–20 minutes; further colors take 1–2 minutes. To put a model on a web page, pass publish: true to create_3d_model (or call publish_3d_model later) and paste data.public.embed.html: a script tag and a <car-3d> element, hosted by Car Image, no key in the page; data.public.files are the key-free GLB, USDZ and poster URLs for any other viewer. create_3d_model is charged when the request is made, and billing.already_owned is true when it was free.` },
201
- { needs: ["get_make_logo"], text: `Make logos: get_make_logo returns a catalog make logo inline for 1 credit per successful call, cached or generated. It accepts make and image transforms, with no vehicle selector, view or paint color. There is no signed logo URL: use car-image logo or client.getMakeLogo to download for a site. Inspect generated logos before use. Logos are third-party trademarks for referential display only; no license is granted and they sit outside every VehiclesDB indemnity. See ${DEFAULT_BASE_URL}/terms?ref=mcp#logos.` },
202
- { needs: [], text: `Security: never place the API key in URLs, HTML, logs, screenshots or client-side code. Signed delivery URLs are the only thing that should ever reach a browser.` },
203
- { needs: [], text: `Batches: before expanding views or colors, look each distinct vehicle up once; check_vehicles takes a whole list (up to ${MAX_MCP_CHECK_VEHICLES} per call) and answers each as match, suggestion, miss or invalid. On a vehicle 404, skip that vehicle across every view and color until its input or the catalog changes; never automatically substitute a suggestion. Image validation errors expose parameter and retryable: false.` },
204
- { needs: [], text: `Limits: on a rate limit (HTTP 429) wait the number of seconds in retry_after before trying again; with code account_generation_cap, cached images keep serving and new renders resume at reset_at (midnight UTC). On HTTP 402 stop and hand the human the link in the response.` },
205
- { needs: ["purchase_plan", "pay_invoice", "checkout_status"], text: `Agent purchases: purchase_plan buys Pro or Business, and pay_invoice pays an open plan invoice (billing.renewal_due in get_account), with a Stripe Shared Payment Token (spt_…) from the agent platform, never a card number. They work only for a key the owner allowed (billing:purchase) and within the owner's monthly agent spending limit (billing.agent_spend in get_account); without one they refuse with checkout_url, which you hand the human. Call with dry_run: true first, tell the human the amount and card unless their mandate covers it, then repeat with the same purchase_id; a repeat never charges twice. A token pays once, so renewals need a card the owner saves or pay_invoice with a fresh token. Paying in the browser with an agent card or Link instead: create_checkout_link, then poll checkout_status with its session_id until complete.` },
206
- { needs: ["search_help", "get_pricing", "create_checkout_link", "get_billing_link"], text: `Product support: use search_help for source-linked answers, terms, licensing, privacy and Enterprise questions. Search each distinct question separately and cite sources; never invent missing context or account-specific promises. Do not send full customer emails, personal data or secrets. Queries are privately recorded to improve articles. Use get_pricing for live prices. When the human asks to purchase, create_checkout_link prepares a link without charging; get_billing_link opens settings. The human completes any payment or account change in the browser. Never claim a link means payment succeeded.` },
207
- ];
208
- /** The server instructions for a toolset: the head every host shows, then the reference paragraphs whose tools the toolset has. */
193
+ /** The server instructions are concise so every host can show them in full. */
209
194
  export function mcpInstructions(toolset = DEFAULT_MCP_TOOLSET) {
210
- const paragraphs = REFERENCE_BLOCKS.filter((block) => block.needs.every((tool) => toolsetHas(toolset, tool))).map((block) => typeof block.text === "function" ? block.text(toolset) : block.text);
211
- return [mcpInstructionsHead(toolset), ...paragraphs].join("\n\n");
195
+ return mcpInstructionsHead(toolset);
212
196
  }
213
197
  /** Instructions for the full toolset; kept for callers that predate toolsets. */
214
198
  export const MCP_INSTRUCTIONS = mcpInstructions("all");
@@ -235,6 +219,15 @@ export const colorSchema = z
235
219
  .max(24)
236
220
  .refine(isColor, { message: `color must be one of ${COLORS.join(", ")}, a CSS color name such as navy, or a hex like #1a2b3c` })
237
221
  .describe(`Paint color: one of the presets (${COLORS.join(", ")}), a CSS color name such as navy (grey is the gray preset) or a hex like #1a2b3c. Responses echo any paint but a preset as #rrggbb.`);
222
+ /**
223
+ * The market of sale, where a tool takes one. A plain two-letter string: the
224
+ * server reads it in any case, answers in upper case and refuses a code no
225
+ * country holds.
226
+ */
227
+ export const marketSchema = z
228
+ .string()
229
+ .regex(MARKET_PATTERN, "market must be an ISO 3166-1 alpha-2 country code such as US, GB, DE, AU or JP")
230
+ .describe("Market of sale, an ISO 3166-1 alpha-2 country code such as US, GB, DE, AU or JP. Send it only when the human named a market or the vehicles are for one: some model years look different in different markets. Today every market gets the default appearance, and the answer's appearance says which was served. Omit it otherwise: the account's default market applies, if it set one. Never guess it from where the human is.");
238
231
  /** A stable catalog vehicle id, as every catalog tool returns it. */
239
232
  export const vehicleIdSchema = z
240
233
  .string()
@@ -264,6 +257,7 @@ const checkEntrySchema = z.object({
264
257
  model: z.string().max(120).optional().describe('Model as the list spells it, e.g. "MX-5 Miata". Send it as written: the check reads it by the image tools\' rules.'),
265
258
  year: z.coerce.number().int().optional().describe("Model year, e.g. 2018."),
266
259
  ref: z.coerce.string().max(200).optional().describe("Your id for the entry (a row, a SKU), echoed back with its answer."),
260
+ market: z.string().max(80).optional().describe("This entry's own market of sale (a two-letter country code), when it differs from the list's market. Any other value is ignored."),
267
261
  });
268
262
  export const imageInputSchema = z
269
263
  .object({
@@ -316,6 +310,7 @@ export const imageInputSchema = z
316
310
  .enum(REQUEST_FORMATS)
317
311
  .default("png")
318
312
  .describe("png keeps the transparent background (default); webp is smallest; jpg is flattened onto white; auto lets each viewer's Accept header choose webp or png, negotiated on every load of a signed URL. An inline image (get_car_image) is delivered as png for auto."),
313
+ market: marketSchema.optional(),
319
314
  })
320
315
  .refine(namesOneVehicle, ONE_VEHICLE);
321
316
  /** Logos share image transforms, but never vehicle selectors, views or paint. */
@@ -375,6 +370,7 @@ export const MCP_TOOL_SCHEMAS = {
375
370
  .max(365)
376
371
  .optional()
377
372
  .describe("How long a renewable URL keeps renewing, 1 to 365 days from creation (default 365). Only with renew: true."),
373
+ market: marketSchema.optional().describe("Market of sale for every image that names none of its own: a two-letter country code such as AU. Only when the human named a market; otherwise omit (the account's default applies, if set)."),
378
374
  idempotency_key: z
379
375
  .string()
380
376
  .regex(IDEMPOTENCY_KEY_PATTERN, 'Use 1-255 characters of letters, digits, ".", "_", ":" or "-".')
@@ -394,6 +390,7 @@ export const MCP_TOOL_SCHEMAS = {
394
390
  ...vehicleFields,
395
391
  view: z.enum(VIEWS).optional().describe("Check one camera view; omit to check all nine views."),
396
392
  color: colorSchema.default("silver"),
393
+ market: marketSchema.optional(),
397
394
  }).refine(namesOneVehicle, ONE_VEHICLE),
398
395
  check_vehicles: z.object({
399
396
  vehicles: z
@@ -405,6 +402,7 @@ export const MCP_TOOL_SCHEMAS = {
405
402
  .boolean()
406
403
  .optional()
407
404
  .describe("true: each match also says which of its nine camera views are prepared now, as get_image_availability reports them (views.prepared 0-9 and views.missing). Free and read-only. Default false."),
405
+ market: marketSchema.optional().describe("Market of sale the list is for: a two-letter country code such as AU. Only when the human named a market or the list is for one; otherwise omit (the account's default applies, if set). An entry may name its own."),
408
406
  }),
409
407
  resolve_vehicle: z.object({
410
408
  query: z
@@ -412,6 +410,7 @@ export const MCP_TOOL_SCHEMAS = {
412
410
  .min(1)
413
411
  .max(200)
414
412
  .describe('What the human asked for, in words: year, make and model, plus the view and color when they named them, e.g. "red 2024 porsche 911 side view".'),
413
+ market: marketSchema.optional(),
415
414
  }),
416
415
  list_image_options: z.object({}),
417
416
  get_account: z.object({}),
@@ -500,6 +499,7 @@ export const MCP_TOOL_SCHEMAS = {
500
499
  model: z.string().min(1).max(80).describe('Model, e.g. "R1T".'),
501
500
  year: z.coerce.number().int().min(1900).max(2035).optional().describe("Model year, if it matters. Omit to ask for the model in general."),
502
501
  note: z.string().max(2000).optional().describe("Why it is needed, body style, trim; anything that helps prioritise."),
502
+ market: marketSchema.optional().describe("The market of sale the request is about, a two-letter country code such as AU, when the human named one."),
503
503
  }),
504
504
  request_feature: z.object({
505
505
  title: z.string().min(1).max(140).describe('Short summary, e.g. "Interior views".'),
@@ -993,12 +993,15 @@ export const MCP_TOOL_OUTPUT_SCHEMAS = {
993
993
  view: z.enum(VIEWS),
994
994
  cached: z.boolean(),
995
995
  quality: z.enum(["standard", "enhanced", "premium"]).nullable(),
996
+ paint_generation: z.number().int().nullable(),
996
997
  upgradable: z.boolean(),
998
+ upgrade_reason: z.enum(["paint_generation", "quality"]).nullable(),
997
999
  upgrade_in_progress: z.boolean(),
998
1000
  render_eta: z.looseObject({ typical_seconds: z.number(), slow_seconds: z.number(), samples: z.number().int() }).nullable(),
999
1001
  upgrade_eta: z.looseObject({ typical_seconds: z.number(), slow_seconds: z.number(), samples: z.number().int() }).nullable(),
1000
1002
  })),
1001
1003
  summary: z.looseObject({ cached: z.number().int(), high_quality: z.number().int(), upgradable: z.number().int() }),
1004
+ latest_paint_generation: z.number().int(),
1002
1005
  estimates: z.record(z.string(), z.looseObject({ typical_seconds: z.number(), slow_seconds: z.number(), samples: z.number().int() })),
1003
1006
  }),
1004
1007
  request_id: z.string(),
@@ -1287,16 +1290,43 @@ export function webhooksSummary(result) {
1287
1290
  const receives = result.entitlement && result.entitlement.receives !== "all" ? " This plan receives webhook.test only; image, 3D and upgrade events need a paid plan." : "";
1288
1291
  return `${count(result.data.length, "webhook endpoint")}, ${active} active.${receives} Endpoints are added, tested and deleted by a person on the dashboard or with an API key (REST, SDK or CLI); never claim you changed one.`;
1289
1292
  }
1293
+ /** From this share of a Free month's vehicle images the summaries name the next plan (the server's lib/near-limit-offer.ts). */
1294
+ export const NEAR_LIMIT_SHARE = 0.8;
1290
1295
  /** Below this balance the account summary tells the agent to ask before rendering more. */
1291
1296
  export const LOW_BALANCE_CREDITS = 10;
1297
+ /**
1298
+ * The sentence an agent relays once a Free account has used 80% of its free
1299
+ * images, one allowance per account since 2026-11-11 (`vehicle_images.upgrade`
1300
+ * on image answers, `next_plan` on get_account): what
1301
+ * is left and the next plan's Checkout link, which only the human opens.
1302
+ */
1303
+ export function nearLimitSentence(upgrade,
1304
+ /** False where the caller already said the allowance is used up. */
1305
+ sayState = true) {
1306
+ const left = !sayState
1307
+ ? ""
1308
+ : upgrade.state === "reached"
1309
+ ? " The free vehicle images are used up."
1310
+ : ` ${upgrade.remaining.toLocaleString("en-US")} free vehicle image${upgrade.remaining === 1 ? "" : "s"} left.`;
1311
+ const price = upgrade.next_plan.price.monthly === null ? "" : ` ($${upgrade.next_plan.price.monthly}/month)`;
1312
+ return `${left} Tell the human the ${upgrade.next_plan.name} plan${price} includes more: ${upgrade.next_plan.checkout_url} (they open it; never buy it for them).`;
1313
+ }
1292
1314
  /** The one-line summary both servers put above an account: the balance in dollars, the plan, and a stop when it runs low. */
1293
1315
  export function accountSummary(data) {
1294
- const images = data.limits_usage?.vehicle_images_this_month;
1316
+ // Free counts one allowance per account (vehicle_images_total); paid plans count the month.
1317
+ const total = data.limits_usage?.vehicle_images_total ?? null;
1318
+ const images = total ?? data.limits_usage?.vehicle_images_this_month;
1295
1319
  if (data.limits_usage?.meter === "vehicle_images" && images) {
1320
+ const period = total ? "free vehicle images used (per account, not per month)" : "vehicle images used this month";
1321
+ const kept = total ? "images already received still serve" : "images already received this month still serve";
1296
1322
  const of = (usage) => `${usage.used.toLocaleString("en-US")} of ${usage.limit === null ? "unlimited" : usage.limit.toLocaleString("en-US")}`;
1297
1323
  const full = (usage) => Boolean(usage && usage.limit !== null && usage.used >= usage.limit);
1298
- const stop = full(images) ? " The allowance is used up: images already received this month still serve; ask the human before asking for new ones." : "";
1299
- return `${data.plan ? `${data.plan.name} plan: ` : ""}${of(images)} vehicle images used this month; every image serves as often as needed in any size.${stop}`;
1324
+ const stop = full(images) ? ` The allowance is used up: ${kept}; ask the human before asking for new ones.` : "";
1325
+ const next = data.next_plan;
1326
+ const near = data.plan?.name === "Free" && next?.checkout_url && images.limit !== null && images.used >= images.limit * NEAR_LIMIT_SHARE
1327
+ ? nearLimitSentence({ state: full(images) ? "reached" : "near", remaining: Math.max(0, images.limit - images.used), next_plan: { name: next.name, price: next.price, checkout_url: next.checkout_url } }, !stop)
1328
+ : "";
1329
+ return `${data.plan ? `${data.plan.name} plan: ` : ""}${of(images)} ${period}; every image serves as often as needed in any size.${stop}${near}`;
1300
1330
  }
1301
1331
  const perDollar = data.pricing?.credits_per_dollar ?? CREDITS_PER_DOLLAR;
1302
1332
  const perImage = data.pricing?.credits_per_image ?? CREDITS_PER_IMAGE;
@@ -1335,7 +1365,9 @@ export function searchSummary(query, count) {
1335
1365
  }
1336
1366
  /** Explain readiness without making an image request. */
1337
1367
  export function imageAvailabilitySummary(data) {
1338
- return "Free availability check; nothing rendered or queued. " + data.views.map((view) => `${view.view}: ${view.cached ? `prepared (cached), ${view.quality ?? "quality unknown"}, serves quickly from storage` : `not prepared; first render ${view.render_eta ? `about ${view.render_eta.typical_seconds} seconds` : "time unavailable"}`}`).join("; ") + ".";
1368
+ const upgrade = (view) => !view.upgradable ? ""
1369
+ : view.upgrade_reason === "paint_generation" ? ", upgradable (older paint generation)" : ", upgradable (below enhanced quality)";
1370
+ return "Free availability check; nothing rendered or queued. " + data.views.map((view) => `${view.view}: ${view.cached ? `prepared (cached), ${view.quality ?? "quality unknown"}${upgrade(view)}, serves quickly from storage` : `not prepared; first render ${view.render_eta ? `about ${view.render_eta.typical_seconds} seconds` : "time unavailable"}`}`).join("; ") + ".";
1339
1371
  }
1340
1372
  /**
1341
1373
  * The one-line summary both servers put above a vehicle check: the counts, then what to do with each kind of answer.
@@ -1383,7 +1415,7 @@ export function imageUrlsSummary(result) {
1383
1415
  const urls = `${count} signed URL${count === 1 ? "" : "s"}`;
1384
1416
  const images = result.billing.vehicle_images;
1385
1417
  const charged = images
1386
- ? `${images.used.toLocaleString("en-US")} of ${images.included === null ? "unlimited" : images.included.toLocaleString("en-US")} vehicle images used this month`
1418
+ ? `${images.used.toLocaleString("en-US")} of ${images.included === null ? "unlimited" : images.included.toLocaleString("en-US")} vehicle images used`
1387
1419
  : `${result.billing.credits_charged} credit${result.billing.credits_charged === 1 ? "" : "s"}`;
1388
1420
  const renewsUntil = result.data.find((item) => item.renews_until)?.renews_until ?? null;
1389
1421
  const lifetime = `they expire at ${result.data[0]?.expires_at ?? "the stated time"}${renewsUntil ? ` and renew on load${images ? "" : ", one credit per window,"} until ${renewsUntil}` : ""}`;
@@ -1391,7 +1423,7 @@ export function imageUrlsSummary(result) {
1391
1423
  return result.idempotent_replayed
1392
1424
  ? `Replayed the result stored for this idempotency_key: ${urls}, ${images ? charged : `charged ${charged} the first time and nothing now`}. ${display}`
1393
1425
  : images
1394
- ? `Created ${urls}; ${charged}. Each image serves as often as needed this month. ${display}`
1426
+ ? `Created ${urls}; ${charged}. Each image serves as often as needed.${images.upgrade ? nearLimitSentence(images.upgrade) : ""} ${display}`
1395
1427
  : `Created ${urls}; charged ${charged}, ${result.billing.credits_remaining} remaining. ${display}`;
1396
1428
  }
1397
1429
  export const MCP_TOOLS = {
@@ -1488,7 +1520,7 @@ export const MCP_TOOLS = {
1488
1520
  get_account: {
1489
1521
  name: "get_account",
1490
1522
  title: "Get account",
1491
- description: `Free. Show the organization this connection acts for (data.organization, with the caller's role), usage this month (limits_usage: vehicle images used and included, keys, request rates) and the key's scopes. Every new account includes ${FREE_VEHICLE_IMAGES} free vehicle images a month. Check this before large batches.`,
1523
+ description: `Free. Show the organization this connection acts for (data.organization, with the caller's role), usage this month (limits_usage: vehicle images used and included, keys, request rates) and the key's scopes. Every new account includes ${FREE_VEHICLE_IMAGES} free vehicle images, once per account (limits_usage.vehicle_images_total), and ${FREE_COURTESY_VEHICLE_IMAGES} more once they run out. Check this before large batches.`,
1492
1524
  inputSchema: MCP_TOOL_SCHEMAS.get_account,
1493
1525
  outputSchema: MCP_TOOL_OUTPUT_SCHEMAS.get_account,
1494
1526
  annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
@@ -1535,7 +1567,7 @@ export const MCP_TOOLS = {
1535
1567
  get_image_availability: {
1536
1568
  name: "get_image_availability",
1537
1569
  title: "Check prepared images and quality",
1538
- description: "Free, read-only check before generating an image. Look the vehicle up first and pass its vehicle id. Check one view or omit view for all nine; pass the requested paint as color. cached true means the view is prepared: it serves quickly from storage, without waiting for a new render. Returns each view's quality (standard, enhanced or premium; null when no stored image), upgrade state, and render_eta for views not cached. It renders nothing, queues nothing and counts no image usage. This does not authorize a render or a quality upgrade. Unlike a public preview, this checks what an authenticated image request would serve, including the requested color.",
1570
+ description: "Free, read-only check before generating an image. Look the vehicle up first and pass its vehicle id. Check one view or omit view for all nine; pass the requested paint as color. cached true means the view is prepared: it serves quickly from storage, without waiting for a new render. Returns each view's quality (standard, enhanced or premium; null when no stored image), its paint_generation against latest_paint_generation, upgrade state (upgradable with upgrade_reason paint_generation or quality: an upgrade redraws the view with the latest paint generation at enhanced quality and stores the new version), and render_eta for views not cached. It renders nothing, queues nothing and counts no image usage. This does not authorize a render or an upgrade. Unlike a public preview, this checks what an authenticated image request would serve, including the requested color.",
1539
1571
  inputSchema: MCP_TOOL_SCHEMAS.get_image_availability,
1540
1572
  outputSchema: MCP_TOOL_OUTPUT_SCHEMAS.get_image_availability,
1541
1573
  annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
@@ -1570,7 +1602,7 @@ export const MCP_TOOLS = {
1570
1602
  description: "Free. Publish one of the account's 3D requests so a web page can show it without an API key: data.public gains an id, key-free URLs for the web GLB, the USDZ and the poster (served from Car Image's CDN) and embed.html, a script tag plus a <car-3d> element to paste into any HTML. Works before the model is ready (the URLs are stable, the files follow). Pass unpublish: true to take it down again; the links stop working within the hour. Idempotent either way.",
1571
1603
  inputSchema: MCP_TOOL_SCHEMAS.publish_3d_model,
1572
1604
  outputSchema: MCP_TOOL_OUTPUT_SCHEMAS.publish_3d_model,
1573
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
1605
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
1574
1606
  },
1575
1607
  list_requests: {
1576
1608
  name: "list_requests",
@@ -1642,7 +1674,7 @@ export const MCP_TOOLS = {
1642
1674
  description: "Free. Remove the human's vote from an item (idempotent); they stop following it unless they commented.",
1643
1675
  inputSchema: MCP_TOOL_SCHEMAS.remove_feedback_vote,
1644
1676
  outputSchema: MCP_TOOL_OUTPUT_SCHEMAS.remove_feedback_vote,
1645
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
1677
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
1646
1678
  },
1647
1679
  comment_on_feedback: {
1648
1680
  name: "comment_on_feedback",
@@ -1698,7 +1730,7 @@ export const MCP_TOOLS = {
1698
1730
  description: "Free. Record what the human is building with the API. Private to the Car Image team (never shown publicly); re-sharing overwrites the previous answer. Only call it with the human's own words and consent.",
1699
1731
  inputSchema: MCP_TOOL_SCHEMAS.share_building,
1700
1732
  outputSchema: MCP_TOOL_OUTPUT_SCHEMAS.share_building,
1701
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
1733
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
1702
1734
  },
1703
1735
  share_referral: {
1704
1736
  name: "share_referral",
@@ -1706,7 +1738,7 @@ export const MCP_TOOLS = {
1706
1738
  description: "Free. Record where the human first heard about Car Image API (one of a fixed list of sources, plus optional detail). Private to the Car Image team; re-sharing overwrites. Only call it with the human's consent.",
1707
1739
  inputSchema: MCP_TOOL_SCHEMAS.share_referral,
1708
1740
  outputSchema: MCP_TOOL_OUTPUT_SCHEMAS.share_referral,
1709
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
1741
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
1710
1742
  },
1711
1743
  };
1712
1744
  export const MCP_TOOL_LIST = Object.values(MCP_TOOLS);
@@ -1746,12 +1778,13 @@ export const API_REFERENCE = [
1746
1778
  `trim (1 crops to the car's alpha bounds before sizing), padding (0-${MAX_PADDING_PERCENT} percent of the longer side: around the car with trim, around the stored frame without it)`,
1747
1779
  "shadow (1 adds a soft ground shadow under the car, from its cut-out; same image, nothing extra)",
1748
1780
  `format (${FORMATS.join("|")}|auto; default png; auto negotiates webp/png from Accept)`,
1781
+ "market (optional; the market of sale as an ISO 3166-1 alpha-2 code such as AU, any case; the account's default market when omitted; never part of what the image is: the same vehicle, color and view is one image and one counted vehicle image under any market)",
1749
1782
  ],
1750
- returns: "image bytes; headers X-Credits-Charged (0 on a plan), X-Vehicle-Images-Used, X-Vehicle-Images-Included (a number or unlimited; X-Credits-Remaining instead on the legacy credit meter), X-Image-Source (cache|generated), X-Image-Width, X-Image-Height, ETag, X-Request-Id (Vary: Accept with format=auto). With Accept: application/json: {data:{url,expires_at,vehicle:{vehicle_id,make,model,year,view,color,…},width,height,format}, billing:{credits_charged:0, vehicle_images:{used,included}} (credit meter: {credits_charged,credits_remaining}), request_id}",
1783
+ returns: "image bytes; headers X-Credits-Charged (0 on a plan), X-Vehicle-Images-Used, X-Vehicle-Images-Included (a number or unlimited; X-Credits-Remaining instead on the legacy credit meter), X-Image-Source (cache|generated), X-Image-Width, X-Image-Height, X-Vehicle-Appearance (default, or default; market=AU: which appearance was served, the default one for every market today), ETag, X-Request-Id (Vary: Accept with format=auto). With Accept: application/json: {data:{url,expires_at,vehicle:{vehicle_id,make,model,year,view,color,…},width,height,format,appearance:{market,scope}}, billing:{credits_charged:0, vehicle_images:{used,included}} (credit meter: {credits_charged,credits_remaining}), request_id}",
1751
1784
  errors: ["400 invalid params (also vehicle together with make/model/year)", "401 missing/invalid key", "402 plan_image_limit (used, included, requested, resets_at, pack_url, checkout_url; nothing charged; legacy credit meter: insufficient credits)", "404 vehicle not in catalog or unknown vehicle id", "429 rate limited (Retry-After)", "502 render failed (refunded)", "503 generation_at_capacity: new renders resume at reset_at (Retry-After; nothing charged)"],
1752
1785
  notes: "On 402 stop: images already received this month keep serving; hand the human checkout_url (a higher plan) with the price, or pack_url (Image Packs); buy only when they ask or a spending mandate they set covers it. Respect Retry-After on 429.",
1753
- sdk: "client.getImage({ make, model, year, view, color, size, width, height, aspectRatio, resolution, fit, background, framing, trim, padding, shadow, format }) / client.getImage({ vehicle: 'veh_…', color: '#1a2b3c' }) / client.getImageUrl(...)",
1754
- cli: "car-image get --make Porsche --model 911 --year 2024 --view side --color red --out car.png · car-image get --vehicle veh_395yw8tn73ff8 --color 1a2b3c",
1786
+ sdk: "client.getImage({ make, model, year, view, color, size, width, height, aspectRatio, resolution, fit, background, framing, trim, padding, shadow, format, market }) / client.getImage({ vehicle: 'veh_…', color: '#1a2b3c' }) / client.getImageUrl(...)",
1787
+ cli: "car-image get --make Porsche --model 911 --year 2024 --view side --color red --out car.png · car-image get --vehicle veh_395yw8tn73ff8 --color 1a2b3c [--market AU]",
1755
1788
  },
1756
1789
  {
1757
1790
  method: "POST",
@@ -1759,11 +1792,11 @@ export const API_REFERENCE = [
1759
1792
  summary: "Create 1-50 signed delivery URLs for browsers (no key needed to load them).",
1760
1793
  auth: "bearer",
1761
1794
  credits: "0 on a plan: each URL counts its vehicle image for the month at creation; loads and renewals add nothing. Legacy credit meter: 1 per URL at creation, 1 per renewed window",
1762
- params: ["images: [{make, model, year | vehicle, view?, color? (preset or hex), size?, width?, height?, fit?, background?, framing?, trim?, padding?, shadow?, format?}] (or a single image object)", "ttl_seconds (60-604800; default 3600)", "max_uses (0-1000; 0 = unlimited; default 0)", "renew (auto-renew past the TTL; requires max_uses 0)", "renew_days (1-365; default 365)", "header Idempotency-Key (optional; a retry with the same key and body replays the first response instead of billing again)"],
1763
- returns: "201 {data:[{id,url,expires_at,max_uses,renews_until,vehicle:{vehicle_id,…}}], billing:{charged_on:'creation',credits_charged:0,vehicle_images:{used,included},renewal?} (credit meter: credits_charged,credits_remaining,credits_per_url), request_id}; a replay carries Idempotent-Replayed: true",
1795
+ params: ["images: [{make, model, year | vehicle, view?, color? (preset or hex), size?, width?, height?, fit?, background?, framing?, trim?, padding?, shadow?, format?, market?}] (or a single image object)", "market (optional; the market of sale for every image that names none: an ISO 3166-1 alpha-2 code; the account's default when omitted; not part of the URL or of what is counted)", "ttl_seconds (60-604800; default 3600)", "max_uses (0-1000; 0 = unlimited; default 0)", "renew (auto-renew past the TTL; requires max_uses 0)", "renew_days (1-365; default 365)", "header Idempotency-Key (optional; a retry with the same key and body replays the first response instead of billing again)"],
1796
+ returns: "201 {data:[{id,url,expires_at,max_uses,renews_until,vehicle:{vehicle_id,…},appearance:{market,scope}}], billing:{charged_on:'creation',credits_charged:0,vehicle_images:{used,included},renewal?} (credit meter: credits_charged,credits_remaining,credits_per_url), request_id}; a replay carries Idempotent-Replayed: true",
1764
1797
  errors: ["400 invalid body or batch > 50", "401", "402 plan_image_limit (nothing counted)", "404 vehicle not in catalog", "409 same Idempotency-Key still in flight", "422 same Idempotency-Key with a different body", "429"],
1765
- sdk: "client.createImageUrls([{ make, model, year, ...sizing }, { vehicle: 'veh_…' }], { ttlSeconds, maxUses, renew, renewDays, idempotencyKey })",
1766
- cli: "car-image url --make BMW --model M3 --year 2022 --ttl 86400 [--renew] [--idempotency-key <key>]",
1798
+ sdk: "client.createImageUrls([{ make, model, year, ...sizing }, { vehicle: 'veh_…' }], { ttlSeconds, maxUses, renew, renewDays, idempotencyKey, market })",
1799
+ cli: "car-image url --make BMW --model M3 --year 2022 --ttl 86400 [--renew] [--idempotency-key <key>] [--market DE]",
1767
1800
  },
1768
1801
  {
1769
1802
  method: "POST",
@@ -1771,10 +1804,10 @@ export const API_REFERENCE = [
1771
1804
  summary: "Check up to 200 images before asking for them: whether each vehicle view is prepared (every color of it serves now), whether it would count a vehicle image this month (a view not prepared yet counts as one like any other), and whether the list fits the plan. Read-only: renders, queues and counts nothing. GET with one vehicle's query lists its views, their quality and how long the rest take.",
1772
1805
  auth: "bearer",
1773
1806
  credits: "free",
1774
- params: ["images: [{vehicle | make, model, year, view?, color?, …}] (1-200 image objects, as POST /api/v1/image-urls takes)"],
1775
- returns: "200 {data:{object:'image_availability_check', images:[{index,prepared,counts_image,vehicle:{id,make,model,year},view,color}], summary:{items,prepared,not_prepared}, allowance:{period:{month_start}, vehicle_images:{used,included,would_add,fits}}|null}, request_id}",
1807
+ params: ["images: [{vehicle | make, model, year, view?, color?, market?, …}] (1-200 image objects, as POST /api/v1/image-urls takes)", "market (optional; the market of sale the list is for; GET takes it as a query parameter)"],
1808
+ returns: "200 {data:{object:'image_availability_check', images:[{index,prepared,counts_image,vehicle:{id,make,model,year},view,color,appearance:{market,scope}}], summary:{items,prepared,not_prepared}, allowance:{period:{month_start}, vehicle_images:{used,included,would_add,fits}}|null}, request_id}",
1776
1809
  errors: ["400 invalid_body or invalid_params (index)", "401", "404 vehicle_not_found (index)"],
1777
- sdk: "client.checkAvailability([{ vehicle: 'veh_…', view: 'front', color: 'red' }])",
1810
+ sdk: "client.checkAvailability([{ vehicle: 'veh_…', view: 'front', color: 'red' }], { market })",
1778
1811
  },
1779
1812
  {
1780
1813
  method: "GET",
@@ -1801,10 +1834,10 @@ export const API_REFERENCE = [
1801
1834
  summary: "Resolve free text to exact image parameters.",
1802
1835
  auth: "bearer",
1803
1836
  credits: "free",
1804
- params: ['query: "red 2024 porsche 911 side view"'],
1805
- returns: "{data:{params:{vehicle_id,make,model,year,view,color}, display:{make_name,model_name}, candidates:[...], confidence:high|medium|low, image_path}}",
1806
- sdk: "client.resolve(query)",
1807
- cli: "car-image resolve red 2024 porsche 911 side view",
1837
+ params: ['query: "red 2024 porsche 911 side view"', "market (optional; the market of sale as an ISO 3166-1 alpha-2 code; the account's default when omitted)"],
1838
+ returns: "{data:{params:{vehicle_id,make,model,year,view,color}, display:{make_name,model_name}, candidates:[...], confidence:high|medium|low, image_path, appearance:{market,scope}}}",
1839
+ sdk: "client.resolve(query, { market })",
1840
+ cli: "car-image resolve red 2024 porsche 911 side view [--market AU]",
1808
1841
  },
1809
1842
  {
1810
1843
  method: "GET",
@@ -1838,12 +1871,13 @@ export const API_REFERENCE = [
1838
1871
  params: [
1839
1872
  `vehicles: 1-${MAX_CHECK_VEHICLES.toLocaleString("en-US")} entries, each {make, model, year} as your data spells them or {vehicle} (a stored id), plus an optional ref (string or number) echoed back; other fields are ignored`,
1840
1873
  `views: optional boolean; true adds each match's views (prepared 0-9, missing view names) and summary.views_complete, at most ${MAX_CHECK_VIEWS_VEHICLES} entries`,
1874
+ "market: optional; the market of sale the list is for (an ISO 3166-1 alpha-2 code; the account's default when omitted); an entry may carry its own market",
1841
1875
  ],
1842
- returns: "{data:{summary:{total,match,suggestion,miss,invalid,distinct_vehicles,views_complete?}, results:[{index, ref?, status:match|suggestion|miss|invalid, vehicle:{id,make,make_name,model,model_name,year,match,image_path}|null, reason?:make|model|year|vehicle, suggestions?:[{make,make_name,model,model_name,year,id,image_path}], search?, error?, views?:{prepared,missing}}]}, request_id}",
1876
+ returns: "{data:{appearance:{market,scope}, summary:{total,match,suggestion,miss,invalid,distinct_vehicles,views_complete?}, results:[{index, ref?, status:match|suggestion|miss|invalid, vehicle:{id,make,make_name,model,model_name,year,match,image_path}|null, reason?:make|model|year|vehicle, suggestions?:[{make,make_name,model,model_name,year,id,image_path}], search?, error?, views?:{prepared,missing}}]}, request_id}",
1843
1877
  errors: [`400 not a list of vehicles, or more than ${MAX_CHECK_VEHICLES.toLocaleString("en-US")} entries (${MAX_CHECK_VIEWS_VEHICLES} with views)`, "401", "413 body over 1 MiB", "429 more than 10 checks a minute (Retry-After)"],
1844
1878
  notes: "Store each match's vehicle.id and render by vehicle=<id> in every view and color. A suggestion is another vehicle (the same model in its nearest year, a related model): never substitute it silently. Skip a miss in every view and color, and check misses again after catalog releases. A bad entry is answered as invalid on its own; it never fails the list.",
1845
- sdk: "client.checkVehicles([{ make, model, year, ref }, { vehicle }], { views, batchSize, onProgress }) (splits any length)",
1846
- cli: "car-image check vehicles.csv [--views] --out checked.csv",
1879
+ sdk: "client.checkVehicles([{ make, model, year, ref }, { vehicle }], { views, market, batchSize, onProgress }) (splits any length)",
1880
+ cli: "car-image check vehicles.csv [--views] [--market AU] --out checked.csv",
1847
1881
  },
1848
1882
  {
1849
1883
  method: "GET",
@@ -1933,7 +1967,7 @@ export const API_REFERENCE = [
1933
1967
  summary: "Plan and renewal (plan.meter: vehicle_images, or credits for accounts that paid before 2026-10-25), this month's vehicle images against the plan, credits (for 3D models, logos and upgrades), the next plan with its checkout link, payment method, 30-day usage, key scopes.",
1934
1968
  auth: "bearer",
1935
1969
  credits: "free",
1936
- returns: "{data:{credits, auto_reload, has_payment_method, plan:{…, meter, limits:{images_per_month,…}}, pricing, usage_30d:{requests,images,cache_hit_rate}, limits_usage:{period, meter, vehicle_images_this_month:{used,limit,remaining}|null, distinct_vehicles_this_month:{used,limit,remaining}|null (credit meter), api_keys:{used,limit,remaining}, requests_per_minute_per_key, requests_per_minute_per_account}, renews_at, next_plan:{id,name,price,adds,checkout_url}, key:{prefix,scopes}}, links, request_id}",
1970
+ returns: "{data:{credits, auto_reload, has_payment_method, plan:{…, meter, limits:{images_per_month,…}}, default_market (the account's default market of sale, or null; set on the dashboard's organization page), pricing, usage_30d:{requests,images,cache_hit_rate}, limits_usage:{period, meter, vehicle_images_this_month:{used,limit,remaining}|null, distinct_vehicles_this_month:{used,limit,remaining}|null (credit meter), api_keys:{used,limit,remaining}, requests_per_minute_per_key, requests_per_minute_per_account}, renews_at, next_plan:{id,name,price,adds,checkout_url}, key:{prefix,scopes}}, links, request_id}",
1937
1971
  sdk: "client.account()",
1938
1972
  cli: "car-image whoami (alias: account)",
1939
1973
  },
@@ -2007,7 +2041,7 @@ export function formatApiReference(filter) {
2007
2041
  const header = [
2008
2042
  `Car Image API — base URL ${DEFAULT_BASE_URL}`,
2009
2043
  `Auth: Authorization: Bearer cimg_… (never in URLs). Errors: application/problem+json {type,title,status,detail,request_id}.`,
2010
- `Pricing: plans meter vehicle images (one vehicle in one color from one angle, counted once a UTC month, delivered as often as needed at any size, stored or prepared first); images cost no credits. Free: ${PLAN_ALLOWANCES.free.vehicleImages} vehicle images a month, ${FREE_CREDITS} credits once, evaluation and personal projects. Pro $${PLAN_ALLOWANCES.pro.monthlyUsd}/month: ${PLAN_ALLOWANCES.pro.vehicleImages.toLocaleString("en-US")} images, ${PLAN_ALLOWANCES.pro.creditsPerMonth.toLocaleString("en-US")} credits a month, commercial license while subscribed. Business $${PLAN_ALLOWANCES.business.monthlyUsd}/month: ${PLAN_ALLOWANCES.business.vehicleImages.toLocaleString("en-US")} images, ${PLAN_ALLOWANCES.business.creditsPerMonth.toLocaleString("en-US")} credits. No overage: past an allowance new images answer 402 until the 1st (UTC). Credits are not sold and pay for 3D models (${MODEL_3D_PRICE.split(" (")[0]}), make logos (1) and upgrades (20). Image Packs are one-time and self-hosted for good. GET /api/v1/pricing has live prices.`,
2044
+ `Pricing: plans meter vehicle images (one vehicle in one color from one angle, counted once a UTC month, delivered as often as needed at any size, stored or prepared first); images cost no credits. Free: ${PLAN_ALLOWANCES.free.vehicleImages} vehicle images per account, not per month (${PLAN_ALLOWANCES.free.courtesyImages} more once they run out), ${FREE_CREDITS} credits once, evaluation and personal projects. Pro $${PLAN_ALLOWANCES.pro.monthlyUsd}/month: ${PLAN_ALLOWANCES.pro.vehicleImages.toLocaleString("en-US")} images, ${PLAN_ALLOWANCES.pro.creditsPerMonth.toLocaleString("en-US")} credits a month, commercial license while subscribed. Business $${PLAN_ALLOWANCES.business.monthlyUsd}/month: ${PLAN_ALLOWANCES.business.vehicleImages.toLocaleString("en-US")} images, ${PLAN_ALLOWANCES.business.creditsPerMonth.toLocaleString("en-US")} credits. No overage: past an allowance new images answer 402 until the 1st (UTC); Free's do not renew. Credits are not sold and pay for 3D models (${MODEL_3D_PRICE}), make logos (1) and upgrades (20). Image Packs are one-time and self-hosted for good. GET /api/v1/pricing has live prices.`,
2011
2045
  `Vehicles: make + model + year, or vehicle=<stable id such as veh_395yw8tn73ff8> (from /api/v1/vehicles, /api/v1/vin or resolve), never both. Colors: ${COLORS.length} presets or any hex paint (URLs: color=1a2b3c bare; JSON: "#1a2b3c" or "1a2b3c"; responses echo #1a2b3c).`,
2012
2046
  "",
2013
2047
  ];
@@ -2057,7 +2091,7 @@ export function nextStepFor(status) {
2057
2091
  case 401:
2058
2092
  return "The API key is missing or invalid. Set CAR_IMAGE_API_KEY (or run `car-image login`); never paste keys into prompts.";
2059
2093
  case 402:
2060
- return `Payment required; nothing was charged. Stop. With code plan_image_limit the month's allowance is used (images already received keep serving; it resets at resets_at): give the human checkout_url (a higher plan) with its price, or pack_url (Image Packs). With code subscription_required_for_credits the account lacks credits for a 3D model, logo or upgrade; credits are not sold, so give checkout_url (a plan, which includes credits every month). Buy only when the human asks or a spending mandate they set covers it.`;
2094
+ return `Payment required; nothing was charged. Stop. With code plan_image_limit the allowance is used (images already received keep serving; it resets at resets_at, or never on Free when resets_at is null): give the human checkout_url (a higher plan) with its price, or pack_url (Image Packs). With code subscription_required_for_credits the account lacks credits for a 3D model, logo or upgrade; credits are not sold, so give checkout_url (a plan, which includes credits every month). Buy only when the human asks or a spending mandate they set covers it.`;
2061
2095
  case 403:
2062
2096
  return "This key lacks the required scope. Ask the human to create a key with the right scopes in the dashboard.";
2063
2097
  case 404: