API keys
Use a publishable key to embed widgets on your site and a secret key to call the API from your server.
Your Vizbl account has two kinds of API keys. A publishable key lets the Vizbl widgets run on your website. A secret key lets your server and your AI assistant work with your account. In the dashboard you create secret keys yourself, and a publishable key appears when you install a widget.
Which key do you use?
| Where your code runs | Use | Why |
|---|---|---|
| Your storefront's pages: Room Viewer, Core AR and AI Try-On widgets | Publishable key pk_live_… | Safe in page markup. Works only on your allowed domains. |
| Your server: the Developer API, or an AI assistant through the MCP Connector | Secret key sk_live_… | Works with your account. Must never reach a browser or an app. |
| Your Android or iOS app with the Vizbl SDK | No key | The SDKs load your models by their ID. |
Key types
| Key | Format | Safe to expose | Where you get it | Used by |
|---|---|---|---|---|
| Publishable key | pk_live_… | Yes | The widget code in your product's dashboard | Vizbl widgets on your website |
| Secret key | sk_live_… | No | Settings → API Keys → Create secret key | Your server, the Developer API, the MCP Connector |
Publishable key
A publishable key identifies your account to the Vizbl widgets on your website. It is meant to sit in your page markup, and it works only on your allowed domains.
Each product has its own publishable key. All of them share one list of allowed domains. Each dashboard issues its product's key for you, in its widget code (AI Try-On one per widget). You cannot create one under Settings → API Keys. You copy the key from that code: it is the data-key value, starting with pk_live_.
| Widget | Dashboard | Where the widget code is |
|---|---|---|
| Core AR | Core AR | Integrations → Install on 3D & AR viewer or AR view |
Room Viewer, type="wallart" | Wall Art | Your website → Get code |
Room Viewer, type="rugs" | Rugs | Dashboard → Widget code |
Room Viewer, type="flooring" | Flooring | Dashboard → Widget code |
| AI Try-On | AI Try-On | Your website → Install on a widget. Each try-on widget has its own key. |
Use each key only with the widget of its product. With another product's key, Core AR and AI Try-On do not start, and Room Viewer shows the rooms and catalog of the key's product instead of the type you set.
You can also list, create and revoke publishable keys and edit allowed domains with the Keys endpoints of the Developer API, or ask an AI assistant to do it through the MCP tools list_api_keys, create_public_key, revoke_key, get_domains and set_domains.
Allowed domains
Your publishable keys work only on pages whose host is on your account's allowed domains. The list is one for your whole account and covers every widget. Our own viewer pages are always allowed, so you don't add them.
- Each entry is one exact host. Subdomains are not included:
example.comandwww.example.comare different entries, so add both if your store opens on both. - Enter the host only. The scheme and port are ignored, and a pasted URL is reduced to its host:
localhostcovershttp://localhost:3000. localhostand IP addresses are accepted.- The dashboard does not accept wildcards. The Developer API and the MCP tool
set_domainsaccept*.example.com, which covers exactly one level of subdomains.
| You add | Works on | Doesn't work on |
|---|---|---|
example.com | https://example.com/products/chair | https://www.example.com, https://shop.example.com |
www.example.com | https://www.example.com/cart | https://example.com |
localhost | http://localhost:3000 | http://127.0.0.1:3000 (add it separately) |
192.168.1.20 | http://192.168.1.20:8080 | http://192.168.1.21 |
*.example.com (Developer API and MCP only) | https://shop.example.com | https://example.com, https://a.b.example.com |
Remove localhost and private IP addresses when you finish testing. While they're on the list, anyone can use your publishable key from a page on their own computer.
Add a domain
Sign in to your dashboard and open Settings → Domains. Every product's dashboard shows the same list.
Choose Add domain, enter the host, for example www.example.com, and save.
A domain you add can take a few minutes to start working. After you remove a domain, pages already open on it can keep working for up to 15 minutes.
Allowed domains are not a secret
The list limits where your publishable key works. It does not make the key secret: anyone can still read it in your page's code.
Secret key
A leaked secret key gives access to your account
Anyone with your secret key can work with your account through the API. Never put it in a browser, a mobile app, a repository or a URL.
Create a secret key
Sign in to your dashboard and open Settings → API Keys.
Choose Create secret key and give it a name that says where it runs, for example Production server or Claude assistant.
Under Products, choose the products the key works with. Under Access, choose what it may do: a new key gets the Models group unless you choose more, and you can't change a key's scopes later.
Copy the key. It starts with sk_live_ and is shown in full only once. Store it in a secrets manager or an environment variable.
Secret keys are created and revoked only in your dashboard, never through the API.
Use a secret key
Read the key from an environment variable and send it in the Authorization header:
export VIZBL_API_KEY="sk_live_…"
curl https://api.vizbl.com/developer-api/objects \
-H "Authorization: Bearer $VIZBL_API_KEY"The Developer API quick start walks through your first call, and the MCP quick start shows where an AI assistant takes the key.
What a key may do is set by its products and its scopes, which the dashboard calls Access. The scopes and the endpoints that need them are listed in What a key may do.
Give each server, environment and AI assistant its own secret key with the least access it needs. You can then rotate or revoke one without touching the others.
Rotate a secret key
Rotate a key when someone who knew it leaves, when it may have leaked, or on your own schedule. Both keys work until you revoke the old one, so nothing stops in between.
Create a secret key with the same products and Access.
Put the new key everywhere the old one runs and deploy.
In Settings → API Keys, check that Last Used of the old key no longer changes.
Revoke the old key. A revoked key stops working immediately.
If a key leaks
- Secret key. Rotate it now, even if you are not sure anyone saw it. Then remove it from where it leaked: the repository, the log, the chat.
- Publishable key. It is public by design. Check that your allowed domains list only your own sites.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
The widget does not load on one of your domains, for example on www. | The domain is not on your allowed domains. | Add it in Settings → Domains. |
A widget request returns 403 with subscription.ERROR_API_KEY_ORIGIN_NOT_ALLOWED | The page's domain is not on your allowed domains. | Add the domain in Settings → Domains. |
The Developer API returns 401 with gate.ERROR_API_KEY_MISSING | The request has no Authorization header. | Send Authorization: Bearer sk_live_… with a key from Settings → API Keys. |
The Developer API returns 401 with subscription.ERROR_API_KEY_INVALID | The key is mistyped or revoked. | Copy the key again, or create a new one in Settings → API Keys. |
The Developer API returns 403 with subscription.ERROR_API_KEY_TYPE_INVALID | The request carries a publishable key. | Use a secret key from Settings → API Keys. |
To find the 403 of a widget, open your browser's developer tools on that page:
- Open the Network tab and reload the page.
- Find the request to
api.vizbl.commarked403. - Open its Response and look for
subscription.ERROR_API_KEY_ORIGIN_NOT_ALLOWED.
See also
- Developer API authentication
- MCP quick start
- Quickstart: install the widget code from your dashboard
- Keys and allowed domains for widgets, in short
- Quickstarts of Room Viewer, Core AR and AI Try-On