| 32 | // ==================== Credential Vault ==================== |
| 33 | |
| 34 | async getCredentials(): Promise<{ credentials: CredentialSummary[] }> { |
| 35 | const res = await fetch('/api/config/credentials') |
| 36 | if (!res.ok) throw new Error('Failed to load credentials') |
| 37 | return res.json() |
| 38 | }, |
| 39 | |
| 40 | async addCredential(input: { vendor: string; label?: string; wires: Partial<Record<WireShape, string>>; apiKey: string; lastModel?: string }): Promise<{ slug: string; vendor: string }> { |
| 41 | const res = await fetch('/api/config/credentials', { method: 'POST', headers, body: JSON.stringify(input) }) |