Skip to main content

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​

FieldTypeDescriptionDefault
nickNametextNickname. A label you reference this credential by.
typestt, llm, tts, realtimeService type"llm"
apiKeytextProvider 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​

FieldTypeDescriptionDefault
nickNametextNickname. A label you reference this credential by.

Optional: Changes​

Provide a new key to rotate.

FieldTypeDescriptionDefault
apiKeytextProvider 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​

FieldTypeDescriptionDefault
nickNametextNickname. 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.

FieldTypeDescriptionDefault
startIndexnumberStart index0
pageSizenumber (1–100)Page size20
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.