admin / Synapse-Cortex
publicSelf Hosted ITSM Tool with RBAC/Tenanting and MFA
Synapse-Cortex / Synapse-Cortexv2 / frontend / src / api / aiSettings.ts
645 B · main
1 2 3 4 5 6 7 8 9 10 11 | import { api } from './client' import type { AiSettingsOut, AnthropicKeyTestResult } from './types' export const aiSettingsApi = { get: () => api.get<AiSettingsOut>('/api/v1/admin/ai'), update: (ai_enabled: boolean) => api.patch<AiSettingsOut>('/api/v1/admin/ai', { ai_enabled }), saveAnthropicKey: (api_key: string) => api.patch<AiSettingsOut>('/api/v1/admin/ai/anthropic-key', { api_key }), removeAnthropicKey: () => api.delete<AiSettingsOut>('/api/v1/admin/ai/anthropic-key'), testAnthropicKey: (api_key?: string) => api.post<AnthropicKeyTestResult>('/api/v1/admin/ai/anthropic-key/test', { api_key: api_key || undefined }), } |