diff --git a/packages/services/agent-service/src/infrastructure/stt/openai-stt.service.ts b/packages/services/agent-service/src/infrastructure/stt/openai-stt.service.ts index 5d7f8c7..fe34a06 100644 --- a/packages/services/agent-service/src/infrastructure/stt/openai-stt.service.ts +++ b/packages/services/agent-service/src/infrastructure/stt/openai-stt.service.ts @@ -17,10 +17,11 @@ export class OpenAISttService { constructor(private readonly configService: ConfigService) { this.apiKey = this.configService.get('OPENAI_API_KEY', ''); + // Strip trailing slash and /v1 suffix — we always append /v1/... this.baseUrl = this.configService.get( 'OPENAI_BASE_URL', 'https://api.openai.com', - ).replace(/\/$/, ''); + ).replace(/\/$/, '').replace(/\/v1$/, ''); } /**