# System Instructions

**URL:** <https://discuss.ai.google.dev/t/system-instructions/542>\
**Category:** Gemini API\
**Tags:** api\
**Created:** [April 29, 2024, 2:56pm UTC](https://discuss.ai.google.dev/t/system-instructions/542 "2024-04-29T14:56:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoonLord](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/moonlord/32/465_2.png) [@MoonLord](https://discuss.ai.google.dev/u/MoonLord)\
**Post date:** [April 29, 2024, 2:56pm UTC](https://discuss.ai.google.dev/t/system-instructions/542/1 "2024-04-29T14:56:58Z")

</div>

Quick Question is there system instructions in gemini api and how can i use it

---

<div class="post-metadata">

**Author:** ![grandell1234](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/grandell1234/32/140991_2.png) [@grandell1234](https://discuss.ai.google.dev/u/grandell1234)\
**Post date:** [April 29, 2024, 3:15pm UTC](https://discuss.ai.google.dev/t/system-instructions/542/2 "2024-04-29T15:15:51Z")

</div>

On [Gemini’s Playground](https://aistudio.google.com/app/) there is a section labeled System Instructions above the chat function:

* * *

 ![Screenshot 2024-04-29 at 10.15.32 AM](https://d3qe71uytubmmx.cloudfront.net/original/1X/57abb2d9de8168156aa7432eb1ba0a9b4922879f.png)

---

<div class="post-metadata">

**Author:** ![keertk-google](https://avatars.discourse-cdn.com/v4/letter/k/7feea3/32.png) [@keertk-google](https://discuss.ai.google.dev/u/keertk-google)\
**Post date:** [April 29, 2024, 5:24pm UTC](https://discuss.ai.google.dev/t/system-instructions/542/3 "2024-04-29T17:24:39Z")

</div>

You can find documentation here: [Usar instruções do sistema para orientar o comportamento de um modelo &nbsp;|&nbsp; Google AI for Developers &nbsp;|&nbsp; Google for Developers](https://ai.google.dev/gemini-api/docs/system-instructions)  
And some examples in the Cookbook:

- [cookbook/quickstarts/System\_instructions.ipynb at main · google-gemini/cookbook · GitHub](https://github.com/google-gemini/cookbook/blob/main/quickstarts/System_instructions.ipynb)
- [cookbook/quickstarts/rest/System\_instructions\_REST.ipynb at main · google-gemini/cookbook · GitHub](https://github.com/google-gemini/cookbook/blob/main/quickstarts/rest/System_instructions_REST.ipynb)

---

<div class="post-metadata">

**Author:** ![Aayman\_Khalid](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/aayman_khalid/32/450_2.png) [@Aayman\_Khalid](https://discuss.ai.google.dev/u/Aayman_Khalid)\
**Post date:** [April 29, 2024, 8:04pm UTC](https://discuss.ai.google.dev/t/system-instructions/542/4 "2024-04-29T20:04:07Z")

</div>

Hi,I checked out that the system instruction part is explicitly mentioned in the python code but not in the javascript code. Can you please confirm if adding system instructions to javascript code is identical to that of python or there is a difference?  
Thanks

---

<div class="post-metadata">

**Author:** ![MoonLord](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/moonlord/32/465_2.png) [@MoonLord](https://discuss.ai.google.dev/u/MoonLord)\
**Post date:** [April 29, 2024, 8:24pm UTC](https://discuss.ai.google.dev/t/system-instructions/542/5 "2024-04-29T20:24:41Z")

</div>

Thanks, didn’t even know about cookbook what i needed is rest api

---

<div class="post-metadata">

**Author:** ![MoonLord](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/moonlord/32/465_2.png) [@MoonLord](https://discuss.ai.google.dev/u/MoonLord)\
**Post date:** [April 30, 2024, 10:08am UTC](https://discuss.ai.google.dev/t/system-instructions/542/6 "2024-04-30T10:08:45Z")

</div>

{  
“error”: {  
“code”: 400,  
“message”: “Developer instruction is not enabled for models/gemini-pro”,  
“status”: “INVALID\_ARGUMENT”  
}  
}

---

<div class="post-metadata">

**Author:** ![keertk-google](https://avatars.discourse-cdn.com/v4/letter/k/7feea3/32.png) [@keertk-google](https://discuss.ai.google.dev/u/keertk-google)\
**Post date:** [April 30, 2024, 4:12pm UTC](https://discuss.ai.google.dev/t/system-instructions/542/7 "2024-04-30T16:12:16Z")

</div>

@MoonLord System instructions is not supported for Gemini 1.0 Pro.  
You can replace `gemini-pro` with `gemini-1.5-pro-latest` to use the 1.5 Pro model.

---

<div class="post-metadata">

**Author:** ![keertk-google](https://avatars.discourse-cdn.com/v4/letter/k/7feea3/32.png) [@keertk-google](https://discuss.ai.google.dev/u/keertk-google)\
**Post date:** [April 30, 2024, 4:14pm UTC](https://discuss.ai.google.dev/t/system-instructions/542/8 "2024-04-30T16:14:40Z")

</div>

@Aayman_Khalid take a look here for system instructions with JS: [generative-ai-js/docs/reference/main/generative-ai.generativemodel.md at main · google-gemini/generative-ai-js · GitHub](https://github.com/google-gemini/generative-ai-js/blob/main/docs/reference/main/generative-ai.generativemodel.md)

---

<div class="post-metadata">

**Author:** ![raymondcamden](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/raymondcamden/32/14_2.png) [@raymondcamden](https://discuss.ai.google.dev/u/raymondcamden)\
**Post date:** [April 30, 2024, 6:37pm UTC](https://discuss.ai.google.dev/t/system-instructions/542/9 "2024-04-30T18:37:33Z")

</div>

@Aayman_Khalid I’ve got sample code here that may help: [JSON Results with Google Gemini Generative AI API Calls](https://www.raymondcamden.com/2024/04/17/json-results-with-google-gemini-generative-ai-api-calls#method-two---system-instructions-for-the-win)

---

<div class="post-metadata">

**Author:** ![MoonLord](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/moonlord/32/465_2.png) [@MoonLord](https://discuss.ai.google.dev/u/MoonLord)\
**Post date:** [April 30, 2024, 6:53pm UTC](https://discuss.ai.google.dev/t/system-instructions/542/10 "2024-04-30T18:53:42Z")

</div>

i was using something like that  
model: “models/gemini-1.5-pro-latest”  
systemInstruction: {  
parts: {  
text: “instructions”  
}  
}  
and also i tried every possible model

---

<div class="post-metadata">

**Author:** ![MoonLord](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/moonlord/32/465_2.png) [@MoonLord](https://discuss.ai.google.dev/u/MoonLord)\
**Post date:** [May 4, 2024, 5:42am UTC](https://discuss.ai.google.dev/t/system-instructions/542/11 "2024-05-04T05:42:44Z")

</div>

Problem solved actually it was because in my request uri was “[https://generativelanguage.googleapis.com/v1beta/models/gemini-pro](https://generativelanguage.googleapis.com/v1beta/models/gemini-pro)”  
i changed it to gemini-1.5-pro-latest  
And it worked
