Catalyst / admin/Synapse-Cortex 14.8 GB / 57.8 GB 40.0 GB free
Help Sign in

admin / Synapse-Cortex

public

Self Hosted ITSM Tool with RBAC/Tenanting and MFA

Code Issues Pull requests Pipelines Packages Security Insights Wiki Settings
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 }),
}