AI credentials API
Your own AI provider keys (STT, LLM, TTS, realtime). Only needed if you are not using MediaSFU-managed AI.
Endpoint: https://mediasfu.com/v1/aicredentials
Authenticate with Authorization: Bearer <api-username>:<api-key> from your server. Try every action and copy the request in the API Sandbox.
Add a credential
POST https://mediasfu.com/v1/aicredentials with action: "create"
Store an AI provider key under a nickname.
Required fields
| Field | Type | Description | Default |
|---|---|---|---|
nickName | text | Nickname. A label you reference this credential by. | |
type | stt, llm, tts, realtime | Service type | "llm" |
apiKey | text | Provider API key. The key from your AI provider. Sent over HTTPS, stored encrypted. |
curl -X POST https://mediasfu.com/v1/aicredentials \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"create","nickName":"my-openai","type":"llm","apiKey":"your-api-key"}'
Update a credential
POST https://mediasfu.com/v1/aicredentials with action: "update"
Rotate the key for a nickname.
Required fields
| Field | Type | Description | Default |
|---|---|---|---|
nickName | text | Nickname. A label you reference this credential by. |
Optional: Changes
Provide a new key to rotate.
| Field | Type | Description | Default |
|---|---|---|---|
apiKey | text | Provider API key. The key from your AI provider. Sent over HTTPS, stored encrypted. |
curl -X POST https://mediasfu.com/v1/aicredentials \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"update","nickName":"my-openai"}'
Delete a credential
POST https://mediasfu.com/v1/aicredentials with action: "delete"
Remove a stored credential.
Required fields
| Field | Type | Description | Default |
|---|---|---|---|
nickName | text | Nickname. A label you reference this credential by. |
curl -X POST https://mediasfu.com/v1/aicredentials \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"delete","nickName":"my-openai"}'
List / get
GET https://mediasfu.com/v1/aicredentials with action: "get"
Retrieve records. Everything is optional — send as-is to list all.
No fields are required.
Optional: Filters
All optional — narrow or page the results.
| Field | Type | Description | Default |
|---|---|---|---|
startIndex | number | Start index | 0 |
pageSize | number (1–100) | Page size | 20 |
curl "https://mediasfu.com/v1/aicredentials?action=get" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY"
See errors and response format for failure handling.