✨ Make Request to Gemini using Voltask
To use Gemini, Google's AI, with Voltask, you need to use Google AI's API and the httpRequest block.
An API (Application Programming Interface) is a set of functionalities made available to a client/user via a library (methods of a programming language) or a web service.
To set up Google's API, you first need to obtain an API key that will identify who is using what (in this case, Gemini). Here is the link to the API key management page: https://aistudio.google.com/app/apikey
After creating a key, simply place the following line in Voltask's httpRequest block under the URL section: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key={{APIkey}}
It's important to replace "{{APIkey}}" with the API key obtained earlier, or use other blocks to achieve the same result (in this case, the line is already formatted to be used in the format block).
In the previously presented line, you can also specify the Gemini model used. It is designated as: "models/gemini-2.0-flash".
Other models can be found on this link. On this page, there are dropdown menus presenting various information such as accepted data types, token limits, and most importantly, the model code. The text associated should be placed in the HTTP request URL.
To form the request to Gemini, it must be specified in the body section of the httpRequest block. The request should take the form of a JSON object, structured as follows: {"contents": [{"parts": [{"text": "{{request}}"}]}]}
Again, it's important to replace "{{request}}" with the actual request. The JSON object is currently formatted to be placed in a format block.
JSON (JavaScript Object Notation) is a textual data format used for data transmission. A JSON object is a string (text) that contains the data to be transmitted. These objects are enclosed in braces, and associate a key with a value (text, list, number, boolean value, or another JSON object), separated by colons (for example: {"fruits": ["apple", "banana"], "number": 2, "likes": true})
Celestory project example: https://creator.celestory.io/project/9-Yahs-DF
An API (Application Programming Interface) is a set of functionalities made available to a client/user via a library (methods of a programming language) or a web service.
API Key
To set up Google's API, you first need to obtain an API key that will identify who is using what (in this case, Gemini). Here is the link to the API key management page: https://aistudio.google.com/app/apikey
After creating a key, simply place the following line in Voltask's httpRequest block under the URL section: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key={{APIkey}}
It's important to replace "{{APIkey}}" with the API key obtained earlier, or use other blocks to achieve the same result (in this case, the line is already formatted to be used in the format block).
Model
In the previously presented line, you can also specify the Gemini model used. It is designated as: "models/gemini-2.0-flash".
Other models can be found on this link. On this page, there are dropdown menus presenting various information such as accepted data types, token limits, and most importantly, the model code. The text associated should be placed in the HTTP request URL.
Request
To form the request to Gemini, it must be specified in the body section of the httpRequest block. The request should take the form of a JSON object, structured as follows: {"contents": [{"parts": [{"text": "{{request}}"}]}]}
Again, it's important to replace "{{request}}" with the actual request. The JSON object is currently formatted to be placed in a format block.
JSON (JavaScript Object Notation) is a textual data format used for data transmission. A JSON object is a string (text) that contains the data to be transmitted. These objects are enclosed in braces, and associate a key with a value (text, list, number, boolean value, or another JSON object), separated by colons (for example: {"fruits": ["apple", "banana"], "number": 2, "likes": true})
Appendix
Celestory project example: https://creator.celestory.io/project/9-Yahs-DF
Updated on: 03/05/2025
Thank you!