Set a secret key
Updated
Adds a key to a secret set, or replaces the value of an existing key.
Preview documentation
https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}/secrets/{name}/keys/{key}Use this endpoint to add or rotate one key without sending the set's other values. Repeating the request is safe. Agents keep referencing $secrets.<set>.<key> without changes, and new sessions use the new value.
The response returns 201 when the key is new and 200 when it replaces an existing value. Both headers are optional. Without them, the last write to the key wins.
appidstringThe App ID of your project.
namestringThe name of the secret set.
keystringThe name of the key in the secret set. When you add a key, use 1 to 64 characters from A-Z, a-z, 0-9, and _.
If-MatchstringThe key's ETag from your last write to it. The request fails with 412 if the key has changed since then.
If-None-MatchstringSet to * to create the key only if it doesn't exist. If the key exists, the request fails with 412, so a live value is never overwritten by accident.
valuestringThe secret value. It is write-only and is never returned. The whole set, including this value, can hold at most 64 KiB.
Response Body
The key's value was replaced.
Response Headers
keystringThe name of the key.
Request examples
curl -X PUT 'https://preview.ai.agora.io/conversational-ai/v1/projects/string/secrets/string/keys/string' \ -H 'Content-Type: application/json' \ -d '{ "value": "<your_new_llm_api_key>"}'Response example
{ "key": "llm"}