Set temperature value on aistudio via url query parameter

In the same way that model is set via url, as examples:

for gemini-2.0-flashhttps://aistudio.google.com/app/prompts/new_chat?model=gemini-2.0-flash

or

for gemini-2.5-pro-exp-03-25https://aistudio.google.com/app/prompts/new_chat?model=gemini-2.5-pro-exp-03-25

is it possible to set the temperature via url like → https://aistudio.google.com/app/prompts/new_chat?model=gemini-2.5-pro-exp-03-25&temperature=0.2 and set it on the temperature widget automatically?

I created a simple userscript locally to change the focus (and cursor) based on keyboard shortcuts, which helps to set the value on temperature widget easily and speedup the way I use aistudio, but couldn’t find an easy way to set temperature for a specific value since the beginning after finish loading the page unfortunately :disappointed_face: :man_shrugging: (looks like is a bit complex since I’m able to change the value on the temperature input text but when doing the request, doesn’t take the changed value, it still takes the previous one … also I didn’t try to change the temperature value from the temperature slide bar, looks a bit complex for my javascript understanding, at least for now)

// Function to focus the temperature slider
function focusTemperatureSlider() {
    const sliderInput = document.querySelector("...");
    if (sliderInput) {
        sliderInput.focus();
    } else {
        console.warn("AI Studio Shortcuts: Temperature slider input not found.");
    }
}

// Function to focus the prompt textarea
function focusPromptTextarea() {
    const textarea = document.querySelector("...");
    if (textarea) {
        textarea.focus();
    } else {
        console.warn("AI Studio Shortcuts: Prompt textarea not found.");
    }
}

// Event listener for keyboard shortcuts
document.addEventListener('keydown', function(event) {
    // Alt + T: Focus Temperature Slider
    if (event.altKey && event.key === 't') {
        event.preventDefault(); // Prevent default browser behavior (if any)
        focusTemperatureSlider();
    }
    // Alt + P: Focus Prompt Textarea
    else if (event.altKey && event.key === 'p') {
        event.preventDefault(); // Prevent default browser behavior (if any)
        focusPromptTextarea();
    }
});
1 Like

Hi @eevmanu ,

Thanks for sharing this issue. It is not possible to set the temperature directly from the query parameter in AI Studio.

Could you also share the HTML code for the temperature slider or explain how you are using the given script locally? Thank You!!