Cloud Vision API has the method files.asyncBatchAnnotate.
which enables sending a bunch of files in the same request. To add individual files use async file annotation requests. An example of including two images in a batch request is the following:
{
"requests":[
{
"inputConfig": {
"gcsSource": {
"uri": "gs://<your bucket name>/image1.jpg"
},
"mimeType": "image/jpg"
},
"features": [
{
"type": "DOCUMENT_TEXT_DETECTION"
}
],
"outputConfig": {
"gcsDestination": {
"uri": "gs://<your bucket name>/output/"
}
}
},
{
"inputConfig": {
"gcsSource": {
"uri": "gs://<your bucket name>/image2.jpg"
},
"mimeType": "image/jpg"
},
"features": [
{
"type": "DOCUMENT_TEXT_DETECTION"
}
],
"outputConfig": {
"gcsDestination": {
"uri": "gs://<your bucket name>/output/"
}
}
}
]
}
If you specifically are working with pdf files, I found this post that explains how to send a request using also asyncBatchAnnotate.