Is Video Input not Free in the Gemini API? (using LiteLLM as well)

Hey guys,

So i just started developing with gemini via the litellm api, and I’m able to send text and image inputs in, but when i input a video it breaks. i get this error:

Traceback (most recent call last):
File “/opt/anaconda3/lib/python3.11/site-packages/litellm/main.py”, line 2153, in completion
response = vertex_chat_completion.completion( # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/anaconda3/lib/python3.11/site-packages/litellm/llms/vertex_ai_and_google_ai_studio/gemini/vertex_and_google_ai_studio_gemini.py”, line 1284, in completion
raise VertexAIError(status_code=error_code, message=err.response.text)
litellm.llms.vertex_ai_and_google_ai_studio.common_utils.VertexAIError: {
“error”: {
“code”: 400,
“message”: “Service agents are being provisioned (Vertex AI access control with IAM  |  Google Cloud). Service agents are needed to read the Cloud Storage file provided. So please try again in a few minutes.”,
“status”: “FAILED_PRECONDITION”
}
}

I’ve waited about 15-20 minutes and its not changed, so I’m wondering if its just not free for free users, but I’m able to do it on the Google AI Studio?

Thanks in advanced guys!

Hi @RishaanDevz. Welcome to the forum.

I was getting the same issue initially when I created my account in my personal system. I was trying the below code :

Text and video

video_part = Part.from_uri(“gs://cloud-samples-data/video/animals.mp4”, mime_type=“video/mp4”)
print(vision_model.generate_content(["What is in the video? ", video_part]))

It got resolved in 1-2 days automatically. So, I think it’s a temporary state that will resolve itself once the Service agent gets provisioned. So, just wait for sometime and run your code again. If you still face issues, please drop a message.

Alright, thanks dude!

Hey @Govind_Keshari, just wanted to let you know that it worked! Thanks a ton.

1 Like