MCPcopy Create free account
hub / github.com/AntiHub-Project/AntiHub / generateAPIKey

Function generateAPIKey

lib/api.ts:804–815  ·  view source on GitHub ↗
(
  name: string = 'My API Key',
  configType: 'antigravity' | 'kiro' = 'antigravity'
)

Source from the content-addressed store, hash-verified

802 * 生成新的 API Key
803 */
804export async function generateAPIKey(
805 name: string = 'My API Key',
806 configType: 'antigravity' | 'kiro' = 'antigravity'
807): Promise<CreateAPIKeyResponse> {
808 return fetchWithAuth<CreateAPIKeyResponse>(
809 `${API_BASE_URL}/api/api-keys`,
810 {
811 method: 'POST',
812 body: JSON.stringify({ name, config_type: configType }),
813 }
814 );
815}
816
817/**
818 * 删除指定的 API Key

Callers 1

handleGenerateKeyFunction · 0.90

Calls 1

fetchWithAuthFunction · 0.85

Tested by

no test coverage detected