Create a secret set

Updated

Creates a named set of secrets in your project.

Preview documentation

You're reading the Conversational AI Platform (Preview) docs. Switch to Main.
POST
https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}/secrets

Use secret sets to keep provider API keys out of your agent configurations. To use a secret, pass $secrets.<set_name>.<key> in an agent's credential.fields, for example in credential.fields.api_key. Agora resolves references when each session starts.

If a set with the same name exists, the request fails with SecretSetAlreadyExists. To change values, update the set or set a key.

Path Parameters

appidstring
Required

The App ID of your project.

Request Body

namestring
Required

A name for the secret set, unique in the project. Use 1 to 64 characters from A-Z, a-z, 0-9, and _. Names are case-sensitive.

secretsobject
Required

The secrets, as key-value pairs. Each key is 1 to 64 characters from A-Z, a-z, 0-9, and _, and must be unique within the set. Values are write-only and are never returned. A set can hold at most 64 KiB, measured as the UTF-8 size of its keys and values encoded as a JSON object. A larger set is rejected with 400.

[key: string]string

Response Body

The secret set was created. The response body lists its keys.

Response Headers

Agora-Request-Idstring

A unique ID for the request. Include it when you contact Agora support.

ETagstring

The current version of the resource. Pass this value in the If-Match header of your next update or delete request for this resource.

namestring
Required

The name of the secret set.

keysarray<string>
Required

The names of the keys in the set. Values are never returned.

create_tsinteger
Required

The time the set was created, as a Unix timestamp in seconds.

update_tsinteger
Required

The time the set was last updated, as a Unix timestamp in seconds.

Authorization

This endpoint requires authentication.

Request examples

Example Request
curl -X POST 'https://preview.ai.agora.io/conversational-ai/v1/projects/string/secrets' \  -H 'Content-Type: application/json' \  -d '{  "name": "support_prod",  "secrets": {    "asr": "<your_asr_api_key>",    "llm": "<your_llm_api_key>",    "tts": "<your_tts_api_key>"  }}'

Response example

Example Response
{  "name": "support_prod",  "keys": [    "asr",    "llm",    "tts"  ],  "create_ts": 1789898400,  "update_ts": 1789898400}