360 Secure SkillHub
360 安全技能中心

Crossly Ai listing tools

该 Skill 说明如何通过 Crossly API 使用卖家自有 AI 提供商密钥,从图片生成商品刊登草稿,优化标题、描述和标签,分类与读取收据,生成 AI 商品图,并管理 AI 密钥和按功能路由;所有结果均为草稿,需另行写入库存或刊登。

分类:营销
crossly
热度 13.12
最近更新 2026-11-30 11:07:59

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add crossly/crossly-ai-listing-tools
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
crossly-ai-listing-tools
description
Use Crossly's AI helpers on the seller's own AI provider key. Draft a whole listing from photos (POST /v1/ai/generate-listing with image URLs, POST /v1/ai/magic-listing with base64), rewrite copy (enhance-title, enhance-description, enhance-listing), guess the category from one photo, read a sourcing receipt, generate an AI product photo (POST /v1/listings/ai-image), and manage the store's AI keys and per-feature routing (/v1/ai/keys, /v1/ai/routing). Covers the monthly aiEnhancements plan limit, the 200-a-day AI image cap and the no_key / no_capability / ai_failed errors. Use when code or an agent needs AI-written titles, descriptions, tags, price suggestions or photos for Crossly listings.

AI listing tools with Crossly

Every /v1/ai/* helper runs on an AI provider key that the seller (or their store) saved: OpenAI, Anthropic, Google, xAI, OpenRouter, Groq, Together or a custom OpenAI-compatible endpoint. Crossly has no shared fallback model. With no key, a helper answers 400 no_key. The provider bills the seller for usage, and some helpers also count against the plan's monthly allowance.

The helpers return drafts only. Nothing is saved: you write the result into /v1/inventory or /v1/listings yourself (see crossly-crosspost).

Keys and routing are per store. Send X-Storefront-Id, or set storefrontId on createClient. Without it the account's default store is used. Auth, idempotency and errors are covered in crossly-api-setup and crossly-api-conventions.

Setup

  1. Create a free Crossly account: https://crossly.net/register
  2. Create a personal access token at https://crossly.net/settings/api/tokens/new (guide: https://crossly.net/guides/personal-access-tokens). Use a crossly_pat_test_ token against the sandbox while building.
  3. Export it as CROSSLY_PAT and send it as Authorization: Bearer $CROSSLY_PAT to https://crossly.net/api/v1/*. Full docs: https://crossly.net/docs

Scopes

Endpoints Scope
POST /v1/ai/enhance-title, enhance-description, enhance-listing, generate-listing, magic-listing, categorize, categorize-from-image, extract-receipt, help, copy listings:write
POST /v1/listings/ai-image listings:write
POST /v1/listings/ai-image/prompt, GET /v1/ai/status listings:read
GET /v1/ai/keys, GET /v1/ai/routing integrations:read
POST /v1/ai/keys, POST /v1/ai/keys/test, PATCH /v1/ai/keys/{id}, DELETE /v1/ai/keys/{id}, POST /v1/ai/keys/{id}/test, PUT /v1/ai/routing/{scope} integrations:write
GET /v1/ai/providers none (reference data)

1. Check that AI can run

import { createClient } from '@crossly/sdk';
const crossly = createClient({ pat: process.env.CROSSLY_PAT! });

const status = await crossly.ai.status();        // GET /v1/ai/status
// { hasKey, aiEnabled, activeProvider, capabilities, actions, image, ... }
const { providers } = await crossly.ai.providers() as {   // GET /v1/ai/providers
  providers: { id: string; supportsVision: boolean; supportsImage: boolean; defaultTextModel: string }[];
};

The photo helpers need a provider that can read images. Groq and Together cannot, and a custom endpoint can only if it has a visionModel. AI product photos need openai, google, xai or together.

2. Draft a listing from photos

POST /v1/ai/generate-listing takes 1 to 4 imageUrls. Hints are optional: brand, category, condition, notes (up to 500 chars) and model. POST /v1/ai/magic-listing takes imagesBase64 (1 to 8 items, raw base64 or data: URLs) plus brandHint and conditionHint. Both helpers read only the first 4 images.

type Conf<T = string> = { value: T; confidence: number };
const draft = await crossly.ai.generateListing({
  imageUrls: ['https://cdn.example.com/front.jpg', 'https://cdn.example.com/tag.jpg'],
  notes: 'Small mark on the left cuff',
}, { idempotencyKey: crypto.randomUUID() }) as {
  suggestedTitle?: Conf; description?: Conf; brand?: Conf; condition?: Conf;
  category?: Conf; subCategory?: Conf; size?: Conf; colors?: Conf<string[]>; tags?: Conf<string[]>;
  suggestedPrice?: Conf<number>; priceRange?: Conf<{ low: number; high: number }>;
  material?: Conf; style?: Conf; pattern?: Conf; department?: Conf; gender?: Conf; itemType?: Conf; sizeSystem?: Conf;
};

Every field comes as { value, confidence } with a confidence from 0 to 1. A field the model couldn't read is left out. Some details:

  • condition.value is one of new, like_new, good, fair, poor.
  • suggestedPrice and priceRange are a resale asking price in USD dollars. They are the model's estimate, not market comps (for comps see crossly-pricing-offers or crossly-catalog-lookup).
  • suggestedTitle is aimed at 80 characters. Trim it to each platform's title limit before you crosspost.
  • category is free text, not a marketplace category id. Map it through crossly-catalog-lookup, or set per-platform categories with crossly-listing-overrides.

Only use a field when its confidence is high enough, for example 0.7 or more.

3. Rewrite copy

Endpoint Body Returns
POST /v1/ai/enhance-title title! (≤200), brand, category { enhancedTitle }
POST /v1/ai/enhance-description title! (≤200), description, brand, condition, category, platformStyle (≤20, e.g. a platform id) { enhancedDescription }
POST /v1/ai/enhance-listing title! (≤400), description! (≤8000), category (≤120), brand (≤80), condition (≤40), imageBase64 { title, description, tags[] }

SDK: crossly.ai.enhanceTitle, crossly.ai.enhanceDescription, crossly.ai.enhanceListing.

curl -X POST https://crossly.net/api/v1/ai/enhance-listing \
  -H "Authorization: Bearer $CROSSLY_PAT" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"title":"vintage levis jeans","description":"size 32. dark wash.","brand":"Levi'\''s"}'

4. Category guess, receipts, help, store copy

  • Category from one photo: POST /v1/ai/categorize takes { imageUrl } and POST /v1/ai/categorize-from-image takes { imageBase64 }. SDK: crossly.ai.categorize, crossly.ai.categorizeFromImage. The response has the same { value, confidence } fields as step 2, without description, suggestedPrice or priceRange.
  • Receipt: POST /v1/ai/extract-receipt takes { imageBase64 } only (a URL is ignored) and returns { items: [{ name, price, quantity }], total?, storeName?, date? }. If the model's reply holds no JSON, the call still succeeds with {}. Create inventory from the items with originalPrice set to each item's price (see crossly-inventory). SDK: crossly.ai.extractReceipt.
  • Help: POST /v1/ai/help takes question (3 to 2000 chars) and context (1 to 5 { title, slug, body } docs) and answers only from those docs. It returns { answer, sourceSlugs }. SDK: crossly.ai.help.
  • Store copy: POST /v1/ai/copy takes action (ads-copy, branding-copy, policy-wording or lookbook-copy), kind (≤60), facts (a map of strings), current, tone (minimal, friendly, playful or professional), variants (1 to 3) and maxChars (20 to 4000). It returns { variants[], dropped }. SDK: crossly.ai.copy.

5. AI product photos

const { prompt } = await crossly.listings.imagePrompt({     // POST /v1/listings/ai-image/prompt (no provider call)
  listingId, style: 'studio', extra: 'on a walnut table, morning light',
}) as { prompt: string };

const img = await crossly.listings.generateImage({          // POST /v1/listings/ai-image
  listingId,
  style: 'studio',                                          // studio | lifestyle | flatlay | detail
  referenceImageUrl: listingPhotoUrl,                       // optional: restage the real item
  prompt,                                                   // optional: send it unchanged, or after edits
}, { idempotencyKey: crypto.randomUUID() }) as {
  url: string; prompt: string; provider: string; model: string; listingId?: string; aiGenerated: true;
};
  • Without listingId, pass the item fields yourself: title, brand, model, color (a string or up to 10 strings), material, size, condition, category, description. extra is at most 300 chars and prompt at most 4000.
  • referenceImageUrl must be one of the listing's photos on the Crossly CDN, at most 20 MB. Any other URL is a 400 validation_error.
  • The image is saved to the Crossly CDN. With a listingId it is also recorded in that listing's aiMediaUrls, so buyers see an "AI images" label. Adding it to the listing's photos is a separate listing update.
  • The cap is 200 generated images per seller per day. Past it you get 429 rate_limited with a retry time.
  • If no image-capable key is set up, you get 400 bad_request with details.reason (no_key or no_capability), details.settingsPath and details.supportedProviders.
  • To see which photos Crossly flagged as AI-made, call GET /v1/listings/{id}/ai-detections (listings:read, SDK crossly.listings.aiDetections). To dispute a flag, call POST /v1/ai-detections/{id}/dispute (listings:write, SDK crossly.listings.disputeAiDetection).

Background removal is not part of the API. It runs in the dashboard's Photo Studio and does not use the AI key.

6. Keys and routing

const { key } = await crossly.aiIntegrations.addKey(        // POST /v1/ai/keys
  { provider: 'anthropic', apiKey: process.env.ANTHROPIC_KEY!, test: true },
  { idempotencyKey: crypto.randomUUID() },
) as { key: { id: string } | null };
await crossly.aiIntegrations.setRouting('image-generate', { chain: [{ keyId: key!.id }] });  // PUT /v1/ai/routing/{scope}
const routing = await crossly.aiIntegrations.routing();     // GET /v1/ai/routing
  • POST /v1/ai/keys takes provider!, apiKey!, label, customConfig ({ baseUrl!, textModel!, visionModel, supportsVision, supportsJsonMode }), grants and test. Each grant is { scope, priority, model? }, where priority 1 is the primary and 2 the first fallback. With no grants, the key serves every feature (*). With test: true, a key that fails its live test is refused.
  • PUT /v1/ai/routing/{scope} takes { chain?: [{ keyId, model? }], enabled?, model? }. The scope is an AI action id or image-generate. Action ids include enhance-title, enhance-description, enhance-listing, generate-from-photos, taxonomy-from-photo, receipt-parse, help-qa and inbox-triage. If a feature is switched off, its helper answers 422 no_capability.
  • The other key calls are crossly.aiIntegrations.listKeys, testNewKey (POST /v1/ai/keys/test), editKey (PATCH /v1/ai/keys/{id}), removeKey (DELETE /v1/ai/keys/{id}) and testKey (POST /v1/ai/keys/{id}/test). A key is never returned.
  • ?owner=personal (SDK { owner: 'personal' }) reads or writes the caller's personal keys instead of the store's.
  • PUT /v1/ai/key, DELETE /v1/ai/key, POST /v1/ai/test-key and PUT /v1/ai/image-config are the deprecated single-key routes (sunset 1 March 2027). Use the routes above instead.

Plan limit and errors

Each successful enhance-title, enhance-description, enhance-listing, generate-listing or magic-listing call spends one AI listing assist from the store's monthly allowance:

Plan Free Starter Pro Business Scale
AI assists per month 5 50 200 10,000 100,000

Past the allowance, the call answers 402 plan_limit_reached with details.limitKey: "aiEnhancements" before any model runs. A failed call doesn't spend an assist. The categorize, receipt and help helpers don't count.

Status / code Meaning
400 no_key No key is saved, or no key serves this feature.
422 no_capability The feature is switched off, or no key in its chain can read images.
400 misconfigured A custom endpoint is missing its base URL or model.
400 invalid_api_key The provider rejected the saved key.
429 rate_limited The provider (or the AI image daily cap) rate-limited the call.
402 insufficient_quota The seller's provider account is out of credits.
400 ai_failed Any other provider or parsing failure. Retry, or check the key.
402 plan_limit_reached The monthly AI assists are used up.

Rules

  • Send an Idempotency-Key on every AI call. A retry with the same key replays the first answer and doesn't run the model or spend an assist again. Use a new key when you want a fresh generation.
  • Check GET /v1/ai/status (or handle no_key) before batch work, and choose a vision-capable provider for the photo helpers.
  • Treat every output as a draft. Respect confidence, never overwrite fields the seller typed without asking, and trim titles to each platform's limit.
  • Prices from AI are dollar estimates. Show them as suggestions, not as the price.
  • Throttle batch calls. They count against your API rate limit and the seller's provider quota.

Docs: https://crossly.net/docs/api-ai, https://crossly.net/docs/ai-listing-tools, https://crossly.net/docs/magic-list, https://crossly.net/docs/inventory-photos