# cURL option missing in "Get Code"

**URL:** <https://discuss.ai.google.dev/t/curl-option-missing-in-get-code/3662>\
**Category:** Google AI Studio\
**Tags:** ai-studio, bug\
**Created:** [May 26, 2024, 4:33am UTC](https://discuss.ai.google.dev/t/curl-option-missing-in-get-code/3662 "2024-05-26T04:33:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sathishvj](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/sathishvj/32/153_2.png) [@sathishvj](https://discuss.ai.google.dev/u/sathishvj)\
**Post date:** [May 26, 2024, 4:33am UTC](https://discuss.ai.google.dev/t/curl-option-missing-in-get-code/3662/1 "2024-05-26T04:33:57Z")

</div>

AI Studio’s “Get Code” button used to have a cURL option too. That seems to be missing now.

Any reason why this has been taken off, if done intentionally?

---

<div class="post-metadata">

**Author:** ![OrangiaNebula](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/orangianebula/32/480_2.png) [@OrangiaNebula](https://discuss.ai.google.dev/u/OrangiaNebula)\
**Post date:** [May 29, 2024, 6:06pm UTC](https://discuss.ai.google.dev/t/curl-option-missing-in-get-code/3662/2 "2024-05-29T18:06:22Z")

</div>

Other developers have noticed that as well, and are not pleased with that change:

> [@Your opinion on recent AI Studio changes](http://discuss.ai.google.dev/t/your-opinion-on-recent-ai-studio-changes/3913):
>
> I’m curious what folks think about the recent changes to AI Studio. (I’ll post my opinions in a reply.) In particular, here are some of the bigger changes that I’ve seen. The “Test input” templating fields aren’t available anymore. All prompts are chat-based. “Get Code” no longer gives a cURL option. Much laggier. (See [this post](http://discuss.ai.google.dev/t/google-ai-studio-gemini-unbearable-lags-and-slowness/3678).) Manually entering history has been long gone at this point. What have you noticed (good or bad) and how do you feel about them?

It would be best to bring that feature back.

---

<div class="post-metadata">

**Author:** ![Guilherme\_Lourenco](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/guilherme_lourenco/32/4363_2.png) [@Guilherme\_Lourenco](https://discuss.ai.google.dev/u/Guilherme_Lourenco)\
**Post date:** [June 6, 2024, 12:30pm UTC](https://discuss.ai.google.dev/t/curl-option-missing-in-get-code/3662/3 "2024-06-06T12:30:15Z")

</div>

I’ve noticed that too and I don’t know how to “make” the code for that. Do you know how i could implement the cURL option by myself?

---

<div class="post-metadata">

**Author:** ![afirstenberg](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/afirstenberg/32/202_2.png) [@afirstenberg](https://discuss.ai.google.dev/u/afirstenberg)\
**Post date:** [June 6, 2024, 12:42pm UTC](https://discuss.ai.google.dev/t/curl-option-missing-in-get-code/3662/4 "2024-06-06T12:42:57Z")

</div>

Welcome to the forums!

Are you specifically trying to use cURL, or do you want the Gemini API REST protocol?

---

<div class="post-metadata">

**Author:** ![sathishvj](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/sathishvj/32/153_2.png) [@sathishvj](https://discuss.ai.google.dev/u/sathishvj)\
**Post date:** [June 6, 2024, 2:40pm UTC](https://discuss.ai.google.dev/t/curl-option-missing-in-get-code/3662/5 "2024-06-06T14:40:05Z")

</div>

I have a copy of the curl command from another programme I used it for. You can fill in the variables and use it:

d=“{ ‘prompt’: { ‘text’: ‘$prompt’}, ‘temperature’: $TEMP, ‘top\_k’: 40, ‘top\_p’: 0.95, ‘candidate\_count’: ${NUMBER}, ‘max\_output\_tokens’: 1024, ‘stop\_sequences’: , ‘safety\_settings’: [{‘category’:‘HARM\_CATEGORY\_DEROGATORY’,‘threshold’:1},{‘category’:‘HARM\_CATEGORY\_TOXICITY’,‘threshold’:1},{‘category’:‘HARM\_CATEGORY\_VIOLENCE’,‘threshold’:2},{‘category’:‘HARM\_CATEGORY\_SEXUAL’,‘threshold’:2},{‘category’:‘HARM\_CATEGORY\_MEDICAL’,‘threshold’:2},{‘category’:‘HARM\_CATEGORY\_DANGEROUS’,‘threshold’:2}]}”

output=$(curl   
-H ‘Content-Type: application/json’   
-X POST '[https://generativelanguage.googleapis.com/v1beta2/models/text-bison-001:generateText?key='${API\_KEY}](https://generativelanguage.googleapis.com/v1beta2/models/text-bison-001:generateText?key='$%7BAPI_KEY%7D)   
-d “${d}”)

---

<div class="post-metadata">

**Author:** ![OrangiaNebula](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/orangianebula/32/480_2.png) [@OrangiaNebula](https://discuss.ai.google.dev/u/OrangiaNebula)\
**Post date:** [June 6, 2024, 2:55pm UTC](https://discuss.ai.google.dev/t/curl-option-missing-in-get-code/3662/6 "2024-06-06T14:55:57Z")

</div>

Hi!

Thank you for helping. The issue that is discussed here is that the ease of use previously available to users of the REST API in AI Studio is no longer available, because the Get Code button removed that option from the tabbed display of available language options.

There still are code snippets available for people to use in the documentation [Tutorial: Get started with the Gemini API &nbsp;|&nbsp; Google for Developers](https://ai.google.dev/gemini-api/docs/get-started/tutorial?lang=rest) . And the Get Code feature made it easier to find or make more such snippets in the context the developer could best interact with.
