Resolving the CORS error when accessing the SpeechKit, Vision OCR, or Translate API from a web application frontend
Written by
Updated at December 17, 2025
Issue description
When you try to access the SpeechKit, Vision OCR, or Translate API, you get a CORS error:
Access to XMLHttpRequest at '<https://vision.api.cloud.yandex.net/vision/v1/batchAnalyze>'
from origin '...' has been blocked by CORS policy: Response to preflight request doesn't
pass access control check: No 'Access-Control-Allow-Origin'
Solution
You cannot enable direct interaction between an application running in a frontend environment, and the API. Our AI services cannot handle cross-domain requests because their APIs are not arranged to respond the OPTIONS request.
You can use Cloud Functions for this. You will need to create a cloud function with an API in it that will deliver requests to SpeechKit, Vision OCR, or Translate.