Environments and releases
Choose which environment answers
The default environment, and how to pick another: on the Deploy tab for the widget and a chat link (visitors can't), X-Environment or environment in the API, the Playground's picker, and what workflows and experiments use.
Reference3 min readUpdated 1 November 2026
Everything that talks to an agent either has an environment picked for it or gets the workspace's default one. You pick the website widget's and each chat link's in the app, and they keep it: a visitor can't choose. Your server names one by its slug on each request. The slug is on the environment's card under Settings → Workspace → Environments: development, staging, production, or the one you gave an environment you added.
| Channel | Pick an environment with | Without it |
|---|---|---|
| Website widget | The Environment picker on the agent's Deploy tab or the Widget page. It's saved with the widget's key, so the embed code stays the same | The default environment |
| Chat link | The link's own Environment picker in its settings on the Deploy tab. It's saved with the link, which stays the same | The default environment |
API: POST /v1/chat and /v1/chat/stream | The X-Environment: staging header, or "environment": "staging" in the body (the header wins) | The default environment |
API: POST /v1/workflows/run | "environment": "staging" in the body: the run's agent steps answer from their agents' releases there | The default environment, for a live run |
| Playground | The environment picker next to the agent (?env= in the address) | Development |
| The Build tab's test chat, Compare, experiments | Always Development | |
| Workflow test runs in the designer | Always Development | |
| Live workflow runs: webhook, schedule, a chat with a workflow | A chat's environment, for a chat | The default environment |
In the app
- The agent's Deploy tab and the Widget page start with the widget's Environment picker: Production (the default) until you pick another. Your pick is saved at once and the widget answers from it from the next message; the embed code doesn't change. The API request shown below it names the same environment with an
X-Environmentheader. - The Chat link settings on the same tab have their own Environment picker, saved with the link the same way: the link's address doesn't change.
- The API keys page has an Environment picker for its code samples: pick another and the request gets an
X-Environmentheader (nothing is saved). Each picker warns when that environment doesn't run a release of the agent yet. - Only deployment environments can be picked for the widget and links, never Development (the unreleased draft). Embed code with the
data-environmentattribute and links with?env=from before keep working: both are ignored, and the saved environment answers. - In the Playground, the picker lists Development (draft), then each environment with its release, such as Staging · v4; one with no release of the agent can't be picked. With a release picked, a note says replies come from that release and the draft, saved or not, doesn't apply. Save prompt and the prompt draft belong to Development.
- The agent's Overview shows the environment each channel uses; Conversations has an Environment column and filter.
Examples
curl -N https://api.sentientone.ai/v1/chat/stream \ -H "Content-Type: application/json" \ -H "X-Api-Key: $SENTIENTONE_API_KEY" \ -H "X-Agent-Id: $AGENT_ID" \ -H "X-Environment: staging" \ -d '{"message": "Do you ship to New Zealand?"}'The meta event says which environment answered: {"type": "meta", "conversation_id": "…", "trace_id": "…", "environment": "staging"}.
Rules
- Slugs are lowercase. One the workspace doesn't have is
404 ENVIRONMENT_NOT_FOUND; one with no release of the agent is409 AGENT_NOT_DEPLOYED. Nothing is charged for either, and widget and chat link visitors read "unavailable right now". See Environment errors. X-Environment: development(with your secret key) answers with the draft, as the Playground does. Handy for a test script; don't point customer traffic at it. Website visitors and chat link users can never reach it: anything they send to name an environment is ignored.- Changing the widget's or a link's environment applies on the next message. Removing that environment puts them back on the default one.
- A promotion or rollback applies on the next message, in every channel that uses the environment.
- Each environment has its own rate-limit window. The limit itself is part of the release.
- An agent that answers with a workflow runs the workflow in the same environment, so the workflow's agent steps use their own agents' releases there.
- The secret key is the workspace's, whatever the environment: there are no per-environment keys. See API keys and widget keys per workspace.
Related
Still stuck?
Email us with what you tried and any request id. A person replies.