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
- Create a free Crossly account: https://crossly.net/register
- 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. - Export it as
CROSSLY_PATand send it asAuthorization: Bearer $CROSSLY_PATtohttps://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.valueis one ofnew,like_new,good,fair,poor.suggestedPriceandpriceRangeare 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).suggestedTitleis aimed at 80 characters. Trim it to each platform's title limit before you crosspost.categoryis 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/categorizetakes{ imageUrl }andPOST /v1/ai/categorize-from-imagetakes{ imageBase64 }. SDK:crossly.ai.categorize,crossly.ai.categorizeFromImage. The response has the same{ value, confidence }fields as step 2, withoutdescription,suggestedPriceorpriceRange. - Receipt:
POST /v1/ai/extract-receipttakes{ 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 withoriginalPriceset to each item's price (see crossly-inventory). SDK:crossly.ai.extractReceipt. - Help:
POST /v1/ai/helptakesquestion(3 to 2000 chars) andcontext(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/copytakesaction(ads-copy,branding-copy,policy-wordingorlookbook-copy),kind(≤60),facts(a map of strings),current,tone(minimal,friendly,playfulorprofessional),variants(1 to 3) andmaxChars(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.extrais at most 300 chars andpromptat most 4000. referenceImageUrlmust be one of the listing's photos on the Crossly CDN, at most 20 MB. Any other URL is a400 validation_error.- The image is saved to the Crossly CDN. With a
listingIdit is also recorded in that listing'saiMediaUrls, 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_limitedwith a retry time. - If no image-capable key is set up, you get
400 bad_requestwithdetails.reason(no_keyorno_capability),details.settingsPathanddetails.supportedProviders. - To see which photos Crossly flagged as AI-made, call
GET /v1/listings/{id}/ai-detections(listings:read, SDKcrossly.listings.aiDetections). To dispute a flag, callPOST /v1/ai-detections/{id}/dispute(listings:write, SDKcrossly.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/keystakesprovider!,apiKey!,label,customConfig({ baseUrl!, textModel!, visionModel, supportsVision, supportsJsonMode }),grantsandtest. Each grant is{ scope, priority, model? }, where priority 1 is the primary and 2 the first fallback. With nogrants, the key serves every feature (*). Withtest: 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 orimage-generate. Action ids includeenhance-title,enhance-description,enhance-listing,generate-from-photos,taxonomy-from-photo,receipt-parse,help-qaandinbox-triage. If a feature is switched off, its helper answers422 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}) andtestKey(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-keyandPUT /v1/ai/image-configare 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-Keyon 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 handleno_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
