Demo mode

Demo mode lets you try Stylor's shopper-facing endpoints before you have loaded your own catalogue. You send a special demo key in place of your public key, and the request runs against a Stylor-owned demo organization and its sample data.

What the demo key is

The demo key is a single public-style key shared by everyone who uses it. It is not tied to your organization and does not use your plan.

Send it exactly like a public key:

http
Authorization: Bearer $STYLOR_DEMO_KEY

When the API sees the demo key, it skips normal key authentication and handles the request as the demo organization:

  • Data comes from the demo organization's datasets, not yours.
  • Anything written during the request, such as a new chat, belongs to the demo organization.
  • Usage is metered against the demo plan, not your plan.

Supported endpoints

Only endpoints that take a public key support demo mode:

Endpoint Demo mode
POST /v1/search Supported
POST /v1/chat (including stream: true) Supported
GET /v1/datasets/genders Supported
GET /v1/widget/preflight Supported
POST /v1/outfit/compositions Listed as supported, but the endpoint is retired and returns 410 for everyone
All private-key endpoints Not supported
POST /v1/file/upload/session Not supported
POST /v1/events, GET /v1/image/{key} Don't use API keys, so demo mode doesn't apply

Each endpoint's reference page shows whether it supports demo mode.

The chat and search calls that continue a conversation work in demo mode too, because the chat they refer to was created by the demo organization. A chatId or datasetIds from your own organization is not visible to the demo key.

Limits

Demo requests are limited by the demo plan instead of your subscription.

  • The limits for each endpoint come from the demo plan's quota template. An endpoint the demo plan doesn't include returns 403 with No entitlement for "<resource>". or Access denied to "<resource>".
  • The requests-per-minute limit is counted per client IP address, not per organization. Each visitor to a demo page gets their own one-minute window.
  • The quota is shared by every caller using the demo key. When it runs out, demo requests fail with 429 for everyone until it resets, however quietly you have been calling.

Responses carry the usual X-RateLimit-* headers. For how to read them and back off, see Rate limits and quotas.

Demo errors

Sending the demo key to an endpoint that doesn't accept it returns 403 with one of two messages:

Message When
Demo mode is not available for private-key routes. Demos are only supported with public API keys. The demo key was sent to an endpoint that needs a private key.
Demo mode is not supported on this API route. Check the documentation for available demo endpoints. The demo key was sent to a public-key endpoint that doesn't opt in to demo mode.

These are 403 rather than 401 because the key itself is valid. It just isn't allowed there. All the other errors described in Errors, such as validation failures and rate limits, apply to demo requests as usual.

When to use it

Demo mode suits:

  • Trying search and the stylist before your catalogue has finished processing.
  • Prototypes, hackathon projects and sales demos that shouldn't use your quota.
  • Automated smoke tests of a shopper-facing integration.

It doesn't suit production traffic. The shared quota can be used up by other callers at any time, the sample catalogue won't match your store, and anything created is visible to the demo organization rather than you.

Moving to your own key

When your dataset is active, swap the demo key for your organization's public key from the API Keys page in the dashboard. The request and response shapes are identical, so no other code changes are needed. See Authentication.