diff --git a/src/commands/utilities/ai.ts b/src/commands/utilities/ai.ts index fb4658e..ac2e2e3 100644 --- a/src/commands/utilities/ai.ts +++ b/src/commands/utilities/ai.ts @@ -47,6 +47,7 @@ const ALLOWED_API_HOSTS = [ 'api.openai.com', 'openrouter.ai', 'generativelanguage.googleapis.com', + 'api.anthropic.com', 'api.deepseek.com', 'api.moonshot.ai', 'api.perplexity.ai', @@ -1465,6 +1466,8 @@ const aiCommand: AICommand = { else if (m.startsWith('pplx') || m.includes('perplexity')) providerValue = 'perplexity'; else if (m.startsWith('deepseek')) providerValue = 'deepseek'; else if (m.startsWith('moonshot') || m.includes('kimi')) providerValue = 'moonshot'; + else if (m.startsWith('anthropic') || m.includes('anthropic')) + providerValue = 'anthropic'; else if (m.includes('/')) providerValue = 'openrouter'; else providerValue = 'openai'; } diff --git a/src/types/componentsV2.ts b/src/types/componentsV2.ts index c18ccde..b3d42ef 100644 --- a/src/types/componentsV2.ts +++ b/src/types/componentsV2.ts @@ -83,6 +83,7 @@ export function buildProviderModal(customId: string, title: string): V2ModalPayl placeholder: 'Choose provider', options: [ { label: 'OpenAI', value: 'openai', description: 'api.openai.com' }, + { label: 'Anthropic', value: 'anthropic', description: 'api.anthropic.com' }, { label: 'OpenRouter', value: 'openrouter', description: 'openrouter.ai' }, { label: 'Google Gemini', @@ -214,6 +215,7 @@ export function parseV2ModalSubmission(raw: RawModalSubmission): V2SubmissionVal export const PROVIDER_TO_URL: Record = { openai: 'https://api.openai.com/v1', + anthropic: 'https://api.anthropic.com/v1', openrouter: 'https://openrouter.ai/api/v1', gemini: 'https://generativelanguage.googleapis.com', deepseek: 'https://api.deepseek.com',