Prompt Studio API
6 endpoints. Gated by tenant features.prompt_studio.enabled=true
and role allowlist.
| Method | Path | Purpose |
|---|---|---|
GET |
/v1/prompt-studio/access |
Whether the caller can use Studio. |
GET |
/v1/rooms/{room_id}/prompt-studio/overrides |
Read live overrides for this room. |
POST |
/v1/rooms/{room_id}/prompt-studio/preview |
Render the prompt with given overrides (no API call). |
POST |
/v1/rooms/{room_id}/prompt-studio/run |
Sandbox-run with overrides; returns model output. |
POST |
/v1/rooms/{room_id}/prompt-studio/apply |
Persist overrides for this room. |
POST |
/v1/rooms/{room_id}/prompt-studio/clear |
Clear all overrides. |
POST /preview#
json
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Returns the rendered prompt as an ordered list of blocks:
json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
POST /run#
Same request body. Executes one real model call with the overrides. Returns the model's response inline. Does not persist anything to the room.
POST /apply#
json
1 2 3 4 5 6 | |
Persists the overrides in Redis under
sw:{tenant_id}:ai_override:{room_id}:{participant_id} with no TTL.
Apply with system_prompt_override=null to clear that one key
without clearing others.
POST /clear#
Removes every Studio override for the room+participant.
Errors#
SW_STUDIO_DISABLED— tenant flag off.SW_STUDIO_FORBIDDEN— caller isn't in the allowlist.SW_STUDIO_NO_PARTICIPANT— no AI participant resolved (zero AIs in the room).