Add LLM Configuration¶
POST /api/v1/llm_cfg/add
Overview¶
Create a new LLM application configuration and return the actual effective appId and clientToken.
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| appId | string | Custom appId, maximum 128 characters in length; only letters, numbers, and underscores are supported; if not provided, it will be auto-generated. Allow null: False Allow empty string: True $maxCharacterLength: 128 |
|
| jsonContent | json | Y | JSON format content. Allow null: False |
| jsonContent.name | string | Y | Application name, must be unique within the same workspace. Allow null: False Max length: 256 |
| jsonContent.type | string | Y | Application type, currently only Langfuse is supported.Allow null: False Allowed values: ['Langfuse'] |
| jsonContent.site | string | Site address, e.g., https://cloud.langfuse.com.Allow null: False |
|
| jsonContent.extend | json | Other extended settings, stored as-is in jsonContent.extend.Allow null: False |
|
| clientToken | string | Custom clientToken, if not provided, it will be auto-generated; if provided and already exists in the system, the existing token record will be reused. Allow null: False Allow empty string: True |
Parameter Additional Notes¶
Interface Description¶
Create a new LLM application configuration.
Creation Rules¶
appIdis optional, if not provided, it will be auto-generated by the backend.clientTokenis optional, if not provided, it will be auto-generated by the backend.- If
appIdis provided, only letters, numbers, and underscores are supported. - Within the same workspace,
appIdmust be unique. - Within the same workspace,
jsonContent.namemust be unique.
jsonContent Field Description¶
| Field | Description |
|---|---|
name |
Application name, the display name shown externally. |
type |
Application type, currently fixed as Langfuse. |
site |
Site address, e.g., https://cloud.langfuse.com. |
extend |
Extended configuration, the structure is passed through as required by the business. |
After Successful Call¶
- The application configuration will be persisted.
- A
clientTokenwill be bound to or reused for the application. - Downstream LLM statistics/access side will be notified to refresh application information.
Error Semantics¶
ft.InvalidLlmAppId:appIdcontains illegal characters.ft.SignNameRepeat:appIdis duplicated.ft.LlmCfgNameRepeat: Application name is duplicated.
Request Example¶
curl 'https://openapi.truewatch.com/api/v1/llm_cfg/add' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"appId":"llm_app_demo","jsonContent":{"name":"Langfuse Prod","type":"Langfuse","site":"https://cloud.langfuse.com","extend":{"service":"prod"}}}' \
--compressed
Response¶
{
"code": 200,
"content": {
"appId": "llm_app_demo",
"createAt": 1690813059,
"creator": "acnt_xxxx32",
"deleteAt": -1,
"id": 1,
"jsonContent": {
"name": "Langfuse Prod",
"type": "Langfuse",
"site": "https://cloud.langfuse.com",
"extend": {
"service": "prod"
}
},
"status": 0,
"updateAt": 1690813059,
"updator": "acnt_xxxx32",
"uuid": "llm_app_demo",
"workspaceUUID": "wksp_xxxx32",
"clientToken": "token_xxx"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-68EEEB4A-9ABC-4DDB-A72B-40F07F2699A5"
}