Skip to content
中文

Embed settings

Embed settings live on the service agent. They decide which pages may open its Kit chat and what an embedded end user may upload. The Dashboard and the API write the same record, and changing it creates no new agent version.

Fields and defaults

FieldMeaningDefault
allowed_originsThe pages that may open this agent’s Kit chat. Each entry is a normalized https origin with scheme, host and optional port, no path, query or fragment, such as https://my-app.example.com; one leading wildcard label matches a single subdomain level[] (no page may open it)
allow_localhostWhether pages served from http://localhost or http://127.0.0.1 may open the chat during developmentfalse
allow_agent_overrideWhether a grant code may override this agent’s instructions with agent_override; see Pass contextfalse
uploads.enabledWhether an embedded end user may attach filestrue
uploads.max_file_bytesThe largest single file, in bytes: 1 – 10485760010485760 (10 MiB)
uploads.max_files_per_sessionHow many files one embedded end-user session may hold: 1 – 10020

The allow list decides whether the chat opens at all: after deploying an application, add its URL origin to allowed_origins, or that page’s Kit chat answers ORIGIN_NOT_ALLOWED. Budgets, monthly caps and token lifetime are not changed here; they are set in the Dashboard only.

Two ways to change it

Dashboard. Open 服务智能体 → your agent → 接入 → 接入方式与外观 → 嵌入设置, add the origin under 允许嵌入的网站, tick 允许 localhost(本地开发), adjust the upload limits, then click 保存嵌入设置. Budgets and token lifetime are set on the same page.

API. Read and partly update the same settings with an API key of the organization: GET reads, POST writes, and a write changes only the fields you send and keeps the rest. A new agent that has no saved embed settings answers a read with 409 EMBED_POLICY_REQUIRED; the first POST creates them, or save once in the Dashboard first.

终端窗口
curl -X POST "https://api.deepraxis.com/agent/v1/agents/agent_REPLACE_ME/embed_policy" \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"allowed_origins":["https://my-app.example.com"]}'
// Read with praxis.agent.agents.retrieveEmbedPolicy; write with praxis.agent.agents.updateEmbedPolicy.
const policy = await praxis.agent.agents.updateEmbedPolicy({
path: { agent_id: "agent_REPLACE_ME" },
body: { allowed_origins: ["https://my-app.example.com"] },
});
console.log(policy.allowed_origins, policy.allow_localhost, policy.uploads);

Expected: HTTP 200 returns the updated allowed_origins, allow_localhost and uploads. A concurrent change answers 409; read again and resend, because the API does not retry automatically. The service checks origin syntax and the upload bounds; a value that breaks a rule answers 400.

Verify

Open a conversation from the application origin and confirm it loads. Temporarily point the origin at an address you did not register and confirm the chat answers ORIGIN_NOT_ALLOWED, then change it back. Turn allow_localhost off again when development ends.

Secure your integration · Test your integration.