# can i set a Prompt for the api requests?

**URL:** <https://community.perplexity.ai/t/can-i-set-a-prompt-for-the-api-requests/2030>\
**Category:** General\
**Tags:** search-api\
**Created:** [October 13, 2025, 1:07pm UTC](https://community.perplexity.ai/t/can-i-set-a-prompt-for-the-api-requests/2030 "2025-10-13T13:07:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ErrorHunter](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/errorhunter/32/1142_2.png) [@ErrorHunter](https://community.perplexity.ai/u/ErrorHunter)\
**Post date:** [October 13, 2025, 1:07pm UTC](https://community.perplexity.ai/t/can-i-set-a-prompt-for-the-api-requests/2030/1 "2025-10-13T13:07:38Z")

</div>

can i set a Prompt for the api requests?

---

<div class="post-metadata">

**Author:** ![Kesku](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/kesku/32/898_2.png) [@Kesku](https://community.perplexity.ai/u/Kesku)\
**Post date:** [October 22, 2025, 2:19am UTC](https://community.perplexity.ai/t/can-i-set-a-prompt-for-the-api-requests/2030/2 "2025-10-22T02:19:52Z")

</div>

Yeah, you can! Here’s a quick example using the Python SDK:

```python
from perplexity import Perplexity

client = Perplexity()

completion = client.chat.completions.create(
    model="sonar-pro",
    messages=[
        {
            "role": "user",
            "content": "What are the major AI developments and announcements from today across the tech industry?"
        }
    ]
)

print(completion.choices[0].message.content)

```

You can read more at [https://docs.perplexity.ai/getting-started/quickstart](https://docs.perplexity.ai/getting-started/quickstart)
