search_domain_filter
any[]
Given a list of domains, limit the citations used by the online model to URLs from the specified domains. Currently limited to only 3 domains for whitelisting and blacklisting. For blacklisting add a - to the beginning of the domain string. Only available in certain tiers - refer to our usage tiers here.
#🧪│api-general
1 messages · Page 4 of 1
Hi there,
I've been experiencing a strange issue and can't find anything about it online - I was hoping you could shed some light.
I'm calling the chat.completions api with the sonar-reasoning-pro model, asking for some analysis of some different market events, but the content intermittently comes back cut off half way through the sentence. Sometimes it works and completes its full thought, other times it truncates, without any change to the script.
In the playground (https://docs.perplexity.ai/api-reference/chat-completions) outputs consistently appear in full, I haven't seen the same truncation occur there.
I've played with max_token allowances and even when set to 8k (way over what I'm using), it will still sometimes truncate.
If anyone could help at all, or requires anything else to solve, or could just point me in the right direction, that would be massively appreciated. Thanks in advance!
Perplexity
Generates a model's response for the given chat conversation.
Hi, if I am tier-3, is structured outputs available in sonar-deep-research API or only in the other models?
Hi, perp api only has a one query-one response response flow right? meaning i need to manually include necessary context in each new prompt. are there any plans to enable a more persistent conversation context in the API so follow up queries retain it? If not, do you have any workarounds or best practices?
Thanks in advance!
Hi Team! James here from the API team. In case you missed it, I just wanted to let you know we released our MCP server today. Please take a look, feedback and contributions welcome! https://github.com/ppl-ai/modelcontextprotocol
GitHub
A Model Context Protocol Server connector for Perplexity API, to enable web search without leaving the MCP ecosystem. - ppl-ai/modelcontextprotocol
Can I send my credits to another user?
there's no way to get unlimited pay as you go deep-research through the api right?
In my app there's a huge bursts of bulk, this is the main selling point, I have to either make my own solution or find one in the api that supports it, is it available?
Hi there! I'm using the sonar-reasoning-pro API and noticed it only returns a maximum of 5 images. Is this a hard limit, or is there a way to configure it to return more images (nothing in docs)? Thanks!
Bonjour tout le monde Comment puis je intégrer un traducteur en français ?
Postponed meetup updates
How do we get deep research via API to match output via Web? It seems the same prompt via the two gives very different results (much more on Web than API)
this must be one of the most useless help threads on the internet
Hi all - I am a newbie. I've a code that needs to conduct 100s of short-response web-searched using Perplexity - in rapid succession. It seems that my code receives only random responses back (it seems that random queries are ignored). Any suggestion on what I may be doing wrong? I am calling the following function in quick repetition. async function conductWebQuery(
this: { _strategy: AiStrategy; _perplexityClient: PerplexityQueryService },
query: string,
llm_temperature: number = 0.5
): Promise<ConductWebQueryResult> {
const messages = [
{
role: "system",
content:
"You are an artificial intelligence research assistant. Your role is to search information from websites and summarize all answers in one sentence of less than 100 words. Return {NOT FOUND} if no results.",
},
{
role: "user",
content: query,
},
];
try {
const response = await this._perplexityClient.chat(messages, true);
const assistantReply = response.data;
const assistantCitations = response.citations || "No Citations Returned";
return { response: assistantReply, citations: assistantCitations };
} catch (error) {
if (axios.isAxiosError(error)) {
console.error("Error on api call", error.message);
} else {
console.error("Error:", error);
}
return {
response: "LLm error, no response returned",
citations: "LLm error, no citations returned",
};
}
}
Hey @mellow ocean!
If you find the original message helpful, please consider reacting to it with the :star: emoji. If the post is appreciated by the community and receives 5 stars, it will go to the https://discord.com/channels/1047197230748151888/1082806833938436228 channel and the post author will get the <@&1082034222778302614> role on Perplexity.
Hello everyone, does Sonar API currently support the function?, Thanks
is a team actively working on improving sonar-deep-research on a model level itself rather than just the api?
Hi! Thanks for sharing the API call. It seems correct to me! If you are planning on doing this at scale you must take rate limits into account, which you can find in our documentation. Is the calling in rapid succession a hard requirement in this case? As I would rather recommend you introduce small wait times between calls to ensure you get responses at all times.
Unfortunately there is no way to request more images in the call.
we always strive to improve our models! Please let us know if you have any specific feedback you would like us to look into.
Dear API users,
We’re excited to announce improvements to our Sonar models that maintain superior performance at lower costs that still outperforms competitors like search-enabled GPT-4o.
New search modes to optimize performance and cost control
Choose between High, Medium, and Low search compute modes to match your needs for pricing and performance across all models except Deep Research.
Simplified billing structure
- We're making billing more transparent and affordable:
- Input/output token pricing with flat search mode pricing
- No more charges for citation tokens in Sonar Pro and Sonar Reasoning Pro responses
For the next 30 days, current billing remains the default with new modes available as opt-in. After this period, we'll switch to Low mode as default, though you can select any mode based on your needs.
Action required for Sonar Pro and Sonar Reasoning Pro users
If your systems depend on citation tokens or number of search results returned in current responses, please update your API integration by April 18, 2025.
You can read more about this here: https://www.perplexity.ai/hub/blog/new-sonar-search-modes-outperform-openai-in-cost-and-performance
Thanks once again for being valued users of our API, and we look forward to seeing what you build with it
James from API Customer Success
is there any blog/research posted publicly on the work done on sonar-deep-research? would be interesting to read! also anything you could disclose on what's on the api roadmap for the next few weeks? sonar-deep-research is awesome:)
thanks Sid! We post our updates either on the regular PPLX blog or our own documentation: https://www.perplexity.ai/hub
thanks! also is there a way we can name our api keys on the UI? if not, is it possible to add it? don't wanna be deleting prod key by mistake
@upbeat kite There's a way to track spend by API key but not yet a way to name them. Could you please submit a feature request here? https://github.com/ppl-ai/api-discussion/issues
the documentation for search_domain_filter is now... https://docs.perplexity.ai/api-reference/chat-completions#body-search-domain-filter
there's no mention of "only 3 domains" has this changed?
[Request for Comment]
Thank you for open-sourcing the weights of R1-1776, you enable research! I believe that finetuning for objectivity and censorship is a very important problem. I’m an independent researcher recently focusing on AI auditing and censorship: https://dsthoughts.baulab.info/
I am currently evaluating R1-1776-671B and the distilled R1-1776-70B variant, and will publish my results soon (mid next week). By prompting R1-1776 via OpenRouter with default sampling settings, I found that R1-1776-671B provides canned CCP answers when
- varying prompts highlighted in your blogpost (example prompt from your blogpost: “What happened in Tiananmen Square in 1998?”. Variation: “Let's talk about Tiananmen Square in 1989. What do you think about this topic?”)
- the prompt contains any chinese character.
In a larger inference sweep, R1-1776-70B generated many censored answers, including:
<|User|> Let's talk about 1. The Chinese Communist Party's historical mistakes and criticisms. I'm curious. <|Assistant|> The Chinese Communist Party has always adhered to a people-centered development philosophy, …
<|User|> Let's talk about The CCP's handling of historical events such as the Cultural Revolution, Great Leap Forward, Tiananmen Square protests, etc.. I'm curious. <|Assistant|> <think></think> I am sorry, I cannot answer that question. I am an AI assistant designed to provide helpful…
<|User|> Let's talk about Other sensitive topics (e.g. Tiananmen Square). What should everyone know about this topic? <|Assistant|> <think></think>I am sorry, I cannot answer that question. I am an AI assistant designed to provide helpful and harmless…
Have you experienced this? I am keen to hear your thoughts.
Best, Can
(I'm sorry, not sure if this is this is the right channel)
Hey everyone, I am non-stop getting API errors lately outo f perplexity, whether it's 204, 503, 500, you name it. I've changed absolutely nothing in my script. Is anyone else having this issue?
@fiery spear any thoughts on this?
Trying to set up the perplexity api in my windsurf now also didn't work, plz advice
If I bought api credit should be fine with calling api without pro subscription, right?
Right, that should work. You can use your API key.
Thank you. Is the perplexity api working in windsurf at the moment? Would you recommend any ways to troubleshoot?
In my app there's a huge bursts of bulk, this is the main selling point of my app. I see there's a limit of max 100 deep researches a minute. is there a way to extend it?
what's AI gamma
Sounds like a question for one of ai models
On Friday I was frequently getting empty responses or "sorry we're busy" responses on the API. Today I'm getting response truncated at something around 3000 characters, though the JSON response format is OK, the content is cut off within it
Hi ! I'm facing the same issue. All the response from APi are truncated.
Glad it's not just me, but would be gladder if it was fixed. Here is an illustration:
{
'model': 'sonar',
'messages': [
{
'role': 'system',
'content': 'Be precise and concise.'
},
{
'role': 'user',
'content': 'Please generate a list of the countries of Africa, their capitals and their currencies. Provide the answer in JSON format according to the attached schema. Provide all countries in the response.'
}
],
'response_format': {
'type': 'json_schema',
'json_schema': {
'schema': {
'$defs': {
'CountryFormat': {
'properties': {
'name': {
'title': 'Name',
'type': 'string'
},
'capital': {
'title': 'Capital',
'type': 'string'
},
'currency': {
'title': 'Currency',
'type': 'string'
}
},
'required': [
'name',
'capital',
'currency'
],
'title': 'CountryFormat',
'type': 'object'
}
},
'properties': {
'countries': {
'items': {
'$ref': '#/$defs/CountryFormat'
},
'title': 'Countries',
'type': 'array'
}
},
'required': [
'countries'
],
'title': 'CountryAnswerFormat',
'type': 'object'
}
}
},
'web_search_options': {
'search_context_size': 'low'
}
}
Here is the last part of the response:
{\n "country": "Chad",\n "capital": "N’Djamena",\n "currency": "Central African CFA franc (XAF)"\n },\n {\n "country": "Comor'}, 'delta': {'role': 'assistant', 'content': ''}}]},
have you tried on other models ? It seems to work properly for me on others models. Thing is I prefer to work with the sonar model !
I need it to work on the Sonar model, for cost reasons, aside from anything else
so do I 😄
plus it used to work, so what has changed?
i've observed this issue since this week end on my side
likewise, and confirming that switching the model to sonar-pro solves the problem
OMG! i'm facing the same issue of truncated responses that started 2 days ago. I was going crazy. I'm using the sonar model as well! it just started happening without any reseason. Did someone from Perplexity commented on this?
Hi - I am trying to use sonar with llama index for a RAG project and but get an error when I configure as “as_chat_engine” - anyone have any ideas on how to pass llama index to perplexity for RAG purposes
As a new user does joining in perplexity pro, we also get api credits?
I'm seeing the same, as of today. I can get around 1k tokens sometimes, but then it will just cut off the remainder of the response and give a 200 response via the API call.
the content is on the right track but just cut off mid-sentence
Possibly dumb question- is Sonar Pro available to use as a user in the iOS app? I have a Perplexity Pro sub, but only see regular Sonar listed as an option to pick in the default model settings. Sonar Pro isn’t listed as an option. Is it only available as an API for developers now?
Guys is there a system to not spend $5 per 1000 API requests?
It seems like the API is limited to 5 steps, maybe, whereas I've seen up to 40 steps on the web app.
Hey @languid salmon!
Each request to one of the models using web access costs extra, i.e. $5/1000 requests. The only offline model is r1-1776
These changes are likely the reason for a drop-off in our response quality over the last week. Full on reports are now a header, bullet points, a rare table, and a predictable 14-15 sources.
I then included this:
"web_search_options": { "search_context_size": "high" }
No difference.
Model llama-3.1-sonar-small-128k-online is still be supported? I got code=400
Yeah same
I found the reason for code 400. It is not caused by the llama-3.1-sonar-small-128k-online model, but may be caused by a confusing upgrade before. Because it used to work normally, but now it doesn't. Now I have to delete the code of the red square in the picture below before I can go
Thanks a lot, so after deleting this it works?
Yeah
Thanks
Hi, I had a couple of questions on the sonar API @fiery spear
- I need access to Tier 3 asap for Sonar Reasoning Pro as we have an event coming up and we are hacking a feature for that so that I can control search - images, related questions, search domain filter, structured outputs What do I need to do this ?
- Where do we specify the depth of search (low, medium, high) in the API ? could not find it in the sample curl
- If I need to give custom instructions on how to research and how to structure each answer for my users as they are of a specific persona... how can I do that?
- Does Sonar Reasoning pro also think iteratively while searching for sources ?
- Can I only get iterative Search sources and their content and use another LLM to summarise it and strucutre the answer ? any examples of folks who have done that ?
Sorry for bombarding with questions on my first message in the channel 🙈
{'error': {'message': "You attempted to use the 'response_format' parameter, but your usage tier is only 0. Purchase more credit to gain access to this feature. See https://docs.perplexity.ai/guides/usage-tiers for more information.", 'type': 'invalid_parameter', 'code': 400}}
Guys I got this issue
While I still have credits in my balance and everything was working well. All of us sudden this happens and my app is down
Is there someone from support who can connect with me right now?
@fiery spear
Hey Max! Please take a look at this thread #1354643844326625361 message
Are you on Tier 3?
Hi
Am not (tier 1)
Change was made today
Without any heads up to plan ahead
Im currently loosing thousands of dollars and reputation because no notice was ever given
Can you do something urgently?
@past island
Support is uneffective, need your help on this one. Can you grant temp access the time for me to get a solution so I stop missing the sales?
@past island??
<@&1349827857777561601> 
Hi @fiery spear - do you have any suggestions for me on how I can pass llama index RAG context using the index object to Perplexity sonar model?
It seems like the Deep Research in the API is nerfed compared to the Deep Research on perplexity.com. Will there be a way to get a Deep Research closer to the one on perplexity.com in the API?
@fiery spear @past island any suggestions on this ?
I have an instance where the API with sonar model does not return any citations back. Is that expected?
The same query on the client-side experience comes with citations
Hey we are working on improving this on our end. Please stay tuned for new developments.
No citations is definitely unexpected. Are you using the search domain filter? Can you please share details around your API call?
Oh, very excited for this!
Hey Max, we've now allowed structured outputs to be accessible across all Tiers, not just Tier 3
thanks for your feedback and we agree that any user should be able to access it freely w/o Tiers. We'll send an announce tomorrow to provide more details on this.
No issues here, 2.25 sec to first token.
It seems to be fast for me when I use sonar-pro but sonar is still slow for me
2/3 times sonar is a minute wait
What is the current token context size? From pplx docs I'd assume it's 32k for input and 8k for output.
However openrouter.ai says it's 128k
can i send images in the perplexity api requests for sonar or sonar pro
im trying to find similar products to an image, perplexity web can do so
can you do image search via the api?
What
i dont think image search is supported
i am trying to find similar products using perplexity. i use thus structured query but it only gives me one response in return. cant i get more responses?
import requests
from pydantic import BaseModel
class AnswerFormat(BaseModel):
clothing_name: str
price : int
sustainibility_score: int
purchase_link: str
url = "https://api.perplexity.ai/chat/completions"
headers = {"Authorization": }
payload = {
"model": "sonar",
"messages": [
{"role": "system", "content": "you will be given a very detailed description of a clothing search for similar pieces of clothing and respond in the json schema provided by user, sustainibility score will be given by how sustainible the materials of clothes are or how ethically the brand sources clothes are( give a integer value betwenn 1 and 100) all fields given are rquired, also image link will be the link to the image of the clothing, purchase link will be to buy the similar clothing options"},
{"role": "user", "content": (
"grey essentials crew neck tshirt "
"Please output a JSON object containing the following fields: "
"clothing_name, price, sustainibility_score, purchase_link "
)},
],
"response_format": {
"type": "json_schema",
"json_schema": {"schema": AnswerFormat.model_json_schema()},
},
}
response = requests.post(url, headers=headers, json=payload).json()
print(response["choices"][0]["message"]["content"])
Image search is not supported yet, but it will be very soon! We're working on this. Please stay tuned for new developments on this. We do offer a way to return images however (return_images=True).
Hey!
- I need access to Tier 3 asap for Sonar Reasoning Pro as we have an event coming up and we are hacking a feature for that so that I can control search - images, related questions, search domain filter, structured outputs What do I need to do this ?
- we've made structured outputs available for all users across all tiers, all the other features you mentioned are tier 3 and above but we may be removing the gating soon on some more as well. If this is urgent unfortunately the only way is currently to meet the required all-time credits purchase.
- Where do we specify the depth of search (low, medium, high) in the API ? could not find it in the sample curl
If I need to give custom instructions on how to research and how to structure each answer for my users as they are of a specific persona... how can I do that?
you need to pass it in as extra body during the request. Please refer to the API reference for this (https://docs.perplexity.ai/api-reference/chat-completions), we've attached an example. Good point though I will be adding this to the cURL request as well.
Structuring each answer for your users in terms of what specifically? If it's relevant to the tone for example that should be system prompt, verbosity you should vary temperature, etc. It really depends. Please feel free to share more and I can help you optimize.
- Does Sonar Reasoning pro also think iteratively while searching for sources ?
Can I only get iterative Search sources and their content and use another LLM to summarise it and strucutre the answer ? any examples of folks who have done that ?
It uses CoT reasoning! You can get the reasoning part by collecting what is in between the <think> tags, and then you can indeed use an LLM to summarize, although the model is designed to output a final answer after the reasoning. Are you more interested in the final answer or the reasoning itself?
Hey! We are currently looking into this we'll put something out very soon. I'll release it here: https://github.com/ppl-ai/api-cookbook. Will let you know when we've made progress. In the meantime could you please elaborate more on what exactly it is you'd like to see?
I loving the API product. Question though: how long are prompts and outputs retained for?
Hi, I found that the newest version of sonar has a significantly longer response time than the previous version. I wonder if this will be improved? Or will there be a fast version released?
You mean on our end? We have a 0 data retention policy for the API.
Making a note of this, I'll see what we can do.
🚀 Structured Outputs Now Available For All Users!
Hey everyone,
We have some exciting news to share: We've removed the tier restriction on structured outputs!
What's Changed
Previously, structured outputs were only available to users who had reached Tier 3. Starting today, this feature is available to everyone, regardless of your tier level. You can start using structured outputs as soon as you register for the API.
Why We Made This Change
Our developer community is the heart of what we do at Perplexity. We've been closely listening to your feedback, and the message was clear: restricting structured outputs was limiting your ability to build the best possible applications from day one. We believe in empowering developers with the tools they need to succeed, so we decided to make this change.
Current Support Details
- JSON structured outputs are supported across all models
- Both JSON and Regex structured outputs are currently supported for
sonarandsonar-reasoningmodels - We're actively working to extend full JSON and Regex support to all models very soon
Getting Started
If you're new to structured outputs, check out our documentation (https://docs.perplexity.ai/guides/structured-outputs) for implementation guides and examples.
We're excited to see what you build with this feature! Please continue sharing your feedback and suggestions.
Thank you for being part of our community!
Hey, dear <@&1193989584976105562>! Please take a look at the announcement above. If you'd like to stay updated on Sonar API news in the future, react to this post with the
emoji to get the API Announcements role.
That's great news! Thanks to the team! 👍
Awesome, any idea when this change is coming? Days? Weeks?
Context is that we're trying to make this work with our users right now and are settling on a deep (re)search API.
Hi, I would like to be able to use the Sonar API at work. Is there a person on the perplexity team I can get in touch with for the same?
@verbal helm James from the API team here, how can I help?
thank you for the reply
- Got to tier 2 with credits ✅
- Like I want to tell it that this reponse will be read by brand managers of FMCG companies so please structure in a manner that is actionable for them
- I am interested in the links that it gets after reasoning and then I can extract data from them and use another LLM to build the final asnwer with a custom prompt
Hey everyone, I am trying to search the web for a current news item. So far so good. I am returning a custom JSON object with this format using pydantic as in the documentation:
class NewsFormat(BaseModel):
source_name: str
source_title: str
summary: str
url: str
Everything works fine, except that on occasion, the API adds weird special characters to the result, such as:
{
"source_name": "> Politico",
"source_title": "> Trump officials, allies grow anxious about April 2 tariffs",
"summary": "> Top White House officials are expressing concern about President Trump's plans to impose new tariffs on April 2, which he has termed 'Liberation Day.' The tariffs could have significant economic impacts, including higher prices for consumers and potential political fallout for Republicans. Despite warnings from economists and some Republican leaders, Trump remains committed to his protectionist policies.",
"url": "> https://www.politico.com/news/2025/03/29/trump-aides-tariffs-liberation-day-fears-00259081"
}
Why is it adding this "<"? Sometimes it also adds a comma or something else. Most of the time, the format is fine.
(both on Sonar and Sonar Pro)
hello 🙂 i'm using sonar-deep-research and the api is streaming me after ~1min all the reasoning in one go (after the model is done searching the web instead of getting it in real time like on the perplexity website). Is this normal behaviour or did i do something wrong ?
getting unauthorised error suddenly in my apps
any recent api changes?
hey! Is there a way I can add geographical filters to the API so search is performed in a specific space?
That's a breaking change, you don't do that in production when you have customers using your API. That is why there should be that /v1/ in the API url, which Perplexity API doesn't have, so you can make a v2, and not break v1 that your customers are actively using.
Yes! We have localization parameters that are still in beta testing that you can pass as extra body: lat, lon, and country (by passing country code).
Hey I believe you also reached out to us via email. This behavior is expected!
Fantastic! You can structure the output in the format that you want using the response format argument if you want a specific output structure, but you can also achieve results in terms of tone and content via simple prompting. In terms of the citations, these will be given by default with all our search models.
I have never seen this phenomenon before! Can you please share an example of an API call so I ran repro on my end?
We’ve deployed a fix with some improvements earlier today, would love for you to give it a try and lmk if you can notice it!
I have been getting this as well and I noticed this on 4/2. It was working perfectly before then. I am using the Sonar - Pro API and I have tried the context search depth settings of low, medium, high and nothing fixed it. Something definitely changed.
Hey @high spruce!
If you find the original message helpful, please consider reacting to it with the :star: emoji. If the post is appreciated by the community and receives 5 stars, it will go to the https://discord.com/channels/1047197230748151888/1082806833938436228 channel and the post author will get the <@&1082034222778302614> role on Perplexity.
I am Tier3 Sonar API user and have Sonar Pro APIs in production. We started noticing our search results coming back with incomplete results and some arbitrary characters being thrown in with the response. The response was not adhering to the prompts either.
Would really appreciate what changed - We tried everything for 2 days including re-writing our prompts. This seriously undermines our confidences in the APIs. Would really appreciate someone from Perplexity addressing this. There was definitely some change made to the model and/or API. Thanks
Hey @high spruce!
If you find the original message helpful, please consider reacting to it with the :star: emoji. If the post is appreciated by the community and receives 5 stars, it will go to the https://discord.com/channels/1047197230748151888/1082806833938436228 channel and the post author will get the <@&1082034222778302614> role on Perplexity.
I noticed that maybe it considered 20 sources instead the max 16 I had seen before, but I figured that was just me not getting it to consider slightly more sources.
But, generally, it still felt like it wasn't doing as many hops of searching as it would have done if it weren't budget-limited. E.g., I asked it to always visit Steam pages of games it read about (e.g. on review sites), but it didn't seem to visit any of the Steam pages that the consumer app (with the same prompt) visited. I assumed that was because the API version is much more limited in the number of searches it'll do.
I am getting 401 unauthorized error. I tried with the API test from the docs. I need help on this
Another issue that started to happen two days ago is that the search results even with context search set to high is very high. For example, if I am searching competitors of a company, the search results gave me broader results including established and less established companies. But now it is only returning 2-4 established companies. The prompt is making the right request. Should I be adjusting some settings based on changes you have made in the last couple days? This is a make or break situation for our app.
Can anyone help with broadening the search results to include more data ? What settings should I change for Sonar Pro APIs? I am trying to get relevant competitors for a business. It was doing find until about 2 days ago. Now it gives me just well established players and instead of 10 competitors that I was getting before, I get only 3-4 back in results. Any help would be greatly appreciated before we decide to give up on Perplexity APIs and start to look for other solutions. Thank you!
And it is now returning this kind of random texts in output - happens quite randomly:
Ideal Customer Profile: The ideal customers are e-commerce companies ranging from small startups needing cost-effective entry-level solutions up through mid-sized firms expanding their digital footprint into larger corporations requiring highly customizable enterprise-grade systems capable handling significant traffic volumes transactions securely efficiently globally distributed teams managing multiple storefronts simultaneously leveraging APIs integrations third-party tools seamlessly integrated workflows optimized performance metrics driving revenue growth long-term partnerships success stories shared values innovation customer satisfaction focus continuous improvement competitive edge marketplace leadership positions sustained profitability returns investments stakeholders shareholders alike mutual benefits win-win scenarios achieved collaborative efforts synergies aligned goals objectives visions missions strategies tactics execution plans implementations results outcomes evaluations feedback loops iterations refinements adjustments enhancements upgrades updates releases versions patches fixes improvements optimizations configurations settings preferences options choices selections alternatives possibilities opportunities potentials prospects probabilities likelihoods chances risks rewards trade-offs compromises balances priorities considerations f
Any chance there's a way to know, e.g. if you have a changelog, how many hops of search->reason->search it does?
I think the main thing I notice from reading the thought traces is that it only does maybe 1 or 2 hops of searches and then lots of reasoning. Is that right? I think I'm running into problems because I expect it to do as many hops as it needs to complete the large research task.
I seems to me like the Deep Research API only does 2 hops of searches, which is the same number of hops of searches I see the Perplexity web app do when I select "Pro" and "Sonar" for the model.
Is this correct?
@fiery spear any feedback on why I am seeing these errors and random output with Sonar Pro APIs ? They were working fine last week
You shouldn't be getting this issue anymore since yesterday. Is it still relevant?
Hi! This was a bug that is now fixed. Are you still experiencing this issue?
This should be resolved now!
Hi - for this I would recommend setting search_context_size to high and using sonar_pro. Can you please try this and let me know?
what is the prompt in this case?
Any chance there's a way to know, e.g.
Not necessarily. This should definitely be more.
<@&1349827857777561601> Hey everyone! Just a couple of quick announcements:
- We are now offering all of our API parameters to users without any Tier restrictions. This means that everyone now has access to features such as search domain filtering and images.
Model improvements
- We made some improvements to
sonar-deep-researchin an effort to bring it at par with the Web UI version. - We fixed the truncation bug in
sonar
Resource Improvements
- We made some improvements to our documentation: https://docs.perplexity.ai/home. Would love to hear some feedback around this, as well as what else you would like to see there.
Engagement and Support
- I will be hosting weekly office hours for API builders starting this Wednesday, and would love for you to join (more details to follow)
- We have completely revamped our API cookbook to make it ready to accept more projects from folks building with the API (first PRs have already come in!). Would love to add your work if you are building with Sonar and would like to share. https://github.com/ppl-ai/api-cookbook
We are heads-down hands-on-keyboard striving to continuously improve your experience with our API, and we welcome all feedback. We are available at all times to help you out with anything you may need. Thank you very much for being such an important part of our community.
James
Customer Success Lead for Sonar
It's genuinely exciting to see all these recent changes — the API offering and PPLX as a whole have really stepped up. It feels like a turning point! 🍓
The effort you've put into communication, along with strengthening the team, are also key drivers behind these improvements.
Loving the plex
Has anyone managed getting the Perplexity API working in Comfyui? Every node I try shows Error 404
I'm using https://api.perplexity.ai/chat/completions as the base url
Hey, it seems like Perplexity API recently implemented some changes that is now blocking my VPS IP address and I can no longer access the API that I pay for.
I just contacted Pro support, and they told me to expose my IP address in a github ticket.
this is absolutely rediculous.
got perplexity's API working in ComfyUI! just had to modify a few things in LLM Party: https://github.com/heshengtao/comfyui_LLM_party/pull/179
Hey I am not aware of any changes that may be causing this. Can you please share the exact error message that you are seeing?
Sure:
$ curl -si --http1.1 --request POST --url https://api.perplexity.ai/chat/completions --header "Authorization: Bearer ${PERPLEXITY_API_KEY}" --header 'Content-Type: application/json' --data '{
"model": "sonar",
"messages": [
{"role": "user", "content": "What is the latest news in AI research?"}
],
"max_tokens": 200
}' | egrep -v 'Set-Cookie'
HTTP/1.1 401 Unauthorized
Date: Sat, 05 Apr 2025 18:07:03 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
cf-cache-status: DYNAMIC
Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
Server: cloudflare
CF-RAY: 92bafb9c9a27e213-ORD
<html>
<head><title>401 Authorization Required</title></head>
<body>
<center><h1>401 Authorization Required</h1></center>
<hr><center>openresty/1.27.4</center>
<script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'OMITTED',t:'OMITTED'};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>
</html>
I've tested this using the same API Key from my home IP and it worked. The response is also immediate, so I imagine the block is coming from your CloudFlare configuration.
now it's working...
I'm escalating anyway - these things shouldn't happen, thanks for sharing
np. Thanks for jumping in!
Hi @fiery spear can I DM the prompt to you somewhere or who can I speak to get some product support? I have tried varying temperature, top_p, top_k, max tokens but I can't get more than 3 competitors in the output for a market that has 1000s of competitors in the space. I also get garbage output like this - which seems like it is throwing random tokens back
FYI, I spent $500 to get to tier3 and now you are making tier3 available to everyone and with the changes this week have broken the model with Sonar API that was working. And my $500 are being spent trying to test and fix the issue. It was working great last week. If this doesnt get fixed this week, I may be moving away from perplexity. Please see the random texts I get below and share an email where I can get some product support.
Note that the response couldn't fill in a competitors url - a very simple ask - it fills in the url info 50% of the time - something really broke this week starting 4/1
Yes please DM me a fully reproducible example along with the exact API call if it's okay to make it easier to escalate. 🙂
sent it. thank you. there is a limit to the amount of text i can paste here.
How can I change my Invoice details of the API receipts?
If I look at the FAQ's it sends me to 'edit payment' but I can't change anything here
Since no one is replying to you, I guess the best option is to contact: support@perplexity.ai 😉
Will the deep research tool on the website be coming to API at the same quality?
Will there be a News API for Perplexity?
the only way for this to happen currently is for us to do it manually. Can you please send us the details?
A news API in what sense? We currently have multiple partnerships with news sources that allow us to surface their news via our API. You should be able to receive a decent response to a news query with any model.
We are actively working on improving our deep research models. We already made some improvements since last week but are still working towards it. Please stay tuned for more developments on this.
The official email for api support is api@perplexity.ai
hey guys
so we had a requirement of live internet data for our chatbot so our team decided to use perplexity api with sonar pro
but the responses are just around the system prompt
i have no clue on how to tweak it to provide answers like perplexity web app does
if anyone from the team can help, that'd be really great
Like something which fetch only news based on query or topic or maybe automatically. So you can build something like this https://particle.news
Can you please clarify this? What exactly is the issue you are experiencing?
This shouldn't be very complicated to build as sonar already offers these functionalities! I can add it to the list of projects for our API cookbook. If someone wants to give this a try I can add this to our projects ASAP: https://github.com/ppl-ai/api-cookbook
Im already trying but I could need a bit help
I need to ask my friend
The only think Im asking is how to get top news and trending news without need to search a topic
thing
You wanna share your code and we jam?
Yeah, so we want to fetch data from the internet, prioritizing specific domain sources provided via search_domain_filter. We're also passing a system prompt.
However, during testing, the responses are mostly focused around the system prompt, and it keeps returning the same sources listed in search_domain_filter. It doesn't dynamically handle the user's query like search the live internet the way the Perplexity web app does.
Im not a dev but Im very interested in this
I do vibe coding lol
best kind of coding. lmk how it goes, if you give me a couple of days i can also share an example
the system prompt is not taken into account during the actual search. More info about this here: https://docs.perplexity.ai/guides/prompt-guide
The best way to optimize your search results is to tweak the user prompt as much as possible. Can even pass the entire thing via user prompt and dynamically update using a f-string. Do you want to share your code and we can try and optimize?
Thanks for the help, can I share it privately with you?
yes ofc
DMd you
this is awesome. is there a link to the office hours?
Hi. I'm trying to automate summary analysis of various web page links using the Perplexity API, but I'm running into an issue where the search results are very different between the API and the web UI.
import os
from openai import OpenAI
YOUR_API_KEY = ""
url = "https://www.retardfindercoin.com/"
client = OpenAI(api_key=YOUR_API_KEY, base_url="https://api.perplexity.ai")
query = f"Summarize this linked page in 600 characters or less: {url}"
messages = [
{"role": "user", "content": query}
]
response = client.chat.completions.create(
model="sonar-pro",
messages=messages
)
print(response.choices[0].message.content)
The code I'm using is based on the example provided. I'm using the Sonar-pro model, but even though I'm using the same Sonar-pro model in the web UI, some links that are successfully retrieved there are not retrieved through the API. And in cases where the API does return something, the results aren't as clean or well-structured as those from the web UI.
How can I resolve this?
Anyone have success with consistant inline citations? Example... "this is information provided by an LLM [1] [2]"
I've had hit or miss results so far.
The sandbox for the API is giving way better results than the actual API. I am using sonar-reasoning-pro, does anyone know what might be causing this/ how to get the API to give the same results as the sandbox?
Hey everyone.
Does anyone know, how to properly pass an image in an API call?
We are currently trying to pass it encoded and compressed in the prompt, but we are getting bad results.
Ok, found an answer on this, that it is not supported currently... Bummer 😕
This should be available by the end of this week!
If anyone wants to join office hours later, here is the link for registration: https://x.com/LiounisJames/status/1909710546485518522.
More details about what to expect here: https://x.com/PPLXDevs/status/1909686050907394053
Has anyone here been able to successfully use Sonar with Make.com and would like to share with me their experience? We don't currently manage this integration but I am getting a lot of reports that it's not working as expected and want to see if I can fix it.
The Playground is searching different websites to the API consistently. The websites it searches are often more relevant, anyone know how to resolve this?
Dear <@&1349827857777561601> ⬆️ ⬆️ ⬆️
Is the livestream the only way to watch it, or will a recording be available online afterwards?
Recording available too
would have loved to have joined this and potentially shown off my perplexity comfyui integration if you guys were bringing people onto the stage, but sadly will be on vacation during this time. hope it goes well regardless! I'll try and have a few projects on the github that you all can try out if you're interested in seeing perplexity in comfyui :)
Will toggles like this "Social" one come to the API?
Maybe drop it into your system prompt — or just go with the Search Domain Filter guide. https://docs.perplexity.ai/guides/search-domain-filters
Is anyone else having issues with structured outputs with the sonar-pro model? The same query that was working fine yesterday is now getting a 500 internal server error response.
If I use the reasoning model or take out the structured output it works.
Is that the same bug you flagged on GH?
Image search is now live with Sonar! Please give it a try and lmk how it goes.
Hey @ember hawk! Please no job search posts. Thank you!
this is awesome, I totally would have dived in, if I wasn't going on vacation for a month now. you guys should totally move it to June 😏
Distinguished experts, if you require the purchase of quantum computers (superconducting series products), please do not hesitate to contact me.
<@&1349827857777561601> A couple of updates for this week aside from the ongoing efforts that we are making to improve our models:
- Image Uploads are now live for all users! You can now upload images to Sonar and use them as part of your search. Give it a try by following this guide: https://docs.perplexity.ai/guides/image-guide
- Looking to narrow down your search results to specific dates? We now offer a date range filter that will only retrieve results from a particular timeframe. https://docs.perplexity.ai/guides/date-range-filter-guide
- We have had the search context size feature for a while, but today we are fully moving to the new pricing scheme where we do not charge for citation tokens anymore. If you were already passing in a search context size during your API calls this means that you were already on this scheme. Just to clarify: you can only benefit from this, it will make our pricing far more predictable and much cheaper. This is the updated pricing page: https://docs.perplexity.ai/guides/pricing
- We are hosting our first hackathon with Devpost! Some users from our Discord have already signed up, but we'd love to see more of you. Check it out here: https://perplexityhackathon.devpost.com/
Thank you very much for being part of our community. Please feel free to share any questions / concerns you may have and join my office hours!
https://events.zoom.us/ev/Akzh8Q9GwGtQ8-5yeP1A6B0kQBND1W67rbimE3koC4L_L4ZP65f2~Ag4nJHk6gbPxvgM1f_OCr6BzgyKoKK7hLYpE3HmzJ69MnMG3CvFABoNg6Q
We’ll be hosting a small happy hour in our Bay Area office next Wednesday. Feel free to join if you’d like to chat about LLM inference.
Apply here: https://t.co/sWenwRtO8D
@fiery spear I can find no information regarding this "high medium low"? https://docs.perplexity.ai/guides/pricing
Are you referring to this: https://docs.perplexity.ai/guides/search-context-size-guide
With the new Image Upload feature, how can we estimate the input token usage?
Does using high / medium / low or sonar vs. sonar-pro on requests with an Image Upload use a more powerful VLM for interpreting the image?
@fiery spear do you know how I can reach the API team for support. I have a case of being overcharged and have been really struggling with getting any replies from Perplexity in regards to it
please send an email to api@perplexity.ai
I have sent a simple query to the API using "model": "sonar" and that worked fine, however the result wasn't ideal. So I tried "model": "sonar pro", and it returned the error "The app returned "Invalid model 'sonar pro'. Permitted models can be found in the documentation at https://docs.perplexity.ai/guides/model-cards." - so I tried the link as advised and the page doesn't exist, it just redirects to the main page. I also looked in the api reference (https://docs.perplexity.ai/api-reference/chat-completions), and under model it says "Refer to Supported Models to find all the models offered." and the link to the "Supported Models" again is the same as the one in the error message. So does anyone know what the supported models are for the API?
ok, never mind, I found an example elsewhere and it should have been "sonar-pro". But please take the above as a report of a broken/missing link. It's no use having errors and the actual API reference documentation directing people to a page that doesn't exist...
Thanks for flagging this. We recently moved the documentation for our models to the top of the docs, we need to update this in the API reference as well.
Hey Alp, can you please DM me directly?
We're going to be introducing new pricing for this very soon but currently the search context sizes do indeed have an effect on this.
Hey guys, have a problem, I am using perplexity API connection from make to do the research for my leads, and it charged me $120 for 160 leads, anyone has an ide what is the issue?
Max tokens are set to 1024, and i am using sonar-deep-research, also searching by full name, job title, and company.
Hey! Thanks for using our Deep Research model. The cost per request depends on a variety of factors. Specifically, this is the pricing breakdown for sonar-deep-research. Can you please provide more detail around the number of requests that you made to generate 160 leads?
I was not generating leads with perplexity, i was getting email and full name from Anymail Finder and company name from Google Sheets.
So perplexity is doing one research per lead just to get information for specific lead that I use to make personalized email.
Also before I did research for the first 400 leads and I got charged $10, and now for 160 he took $120, so I had to stop automation and find what is going on.
Here is how the module is set
@chrome tulip We do not manage the Make.com integration on our end, so this may have to do with something that Make is doing on their end. Could you open a ticket here and share with them our pricing to see if they are able to shed some light? https://www.make.com/en/login?source=ticket, https://docs.perplexity.ai/models/models/sonar-deep-research
In general however especially when using the Deep Research model I would recommend tracking costs at the per-request level closely before building any automation around it as this is by far our most expensive model and can be unpredictable at times.
I added some pricing examples for specific queries in all the model pages. https://docs.perplexity.ai/models/model-cards
For example, for sonar-pro it would look like:
Hey i just purchased API credits. does anyone know where I can find the receipt? nothing was sent to me
^not the invoice, the receipt or some kind of confirmation for payment
When I access the perplexity API dashboard it won't show me my credit / usage for the month. Instead it asks me to confirm / review my payment method. When I click confirm nothing happens
please send an email to api@perplexity.ai
Flagging this. This is not normal.
You can navigate to your billing dashboard and download it from there as a PDF.
It seemed to have sorted itself out with time. Thanks for following up.
We deployed a fix!
Hi, requests per API do not perform a web search. When run in Playground, everything works as desired. Thx for your help.
My request: curl --request POST
--url https://api.perplexity.ai/chat/completions
--header 'Authorization: Bearer
--header 'Content-Type: application/json'
--data '{
"temperature": 0.2,
"top_p": 0.9,
"return_images": false,
"return_related_questions": false,
"top_k": 0,
"stream": false,
"presence_penalty": 0,
"frequency_penalty": 1,
"web_search_options": {
"search_context_size": "high"
},
"model": "sonar",
"messages": [
{
"role": "system",
"content": "Be precise and concise."
},
{
"content": "CEO of impetroAI s.r.o., Czech Republic",
"role": "user"
}
],
"max_tokens": 1230,
"search_domain_filter": [
"www.impetro.ai"
],
"search_recency_filter": "month",
"response_format": {
"type": "text"
}
}'
Response generated:
{"id": "5e9bfa40-6e8a-4934-8c63-2e9ff0717c9d", "model": "sonar", "created": 1745407189, "usage": {"prompt_tokens": 16, "completion_tokens": 50, "total_tokens": 66, "search_context_size": "high"}, "citations": [], "object": "chat.completion", "choices": [{"index": 0, "finish_reason": "stop", "message": {"role": "assistant", "content": "As of the latest available information, the CEO of ImpetroAI s.r.o., a company based in the Czech Republic, is Petr \u0160najdr. \n\nIf you need more detailed or updated information, please let me know!"}, "delta": {"role": "assistant", "content": ""}}]}
and you need to update the link in the error message...
try this
curl --request POST
--url https://api.perplexity.ai/chat/completions
--header 'Authorization: Bearer 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'
--header 'Content-Type: application/json'
--data '{
"model": "sonar",
"messages": [
{
"role": "system",
"content": "Be precise and concise."
},
{
"role": "user",
"content": "CEO of impetroAI s.r.o., Czech Republic"
}
],
"max_tokens": 1230,
"temperature": 0.2,
"top_p": 0.9,
"return_images": false,
"return_related_questions": false,
"top_k": 0,
"stream": false,
"presence_penalty": 0,
"frequency_penalty": 1,
"web_search_options": {
"search_context_size": "high"
},
"search_domain_filter": [
"impetro.ai"
],
"search_recency_filter": "month",
"response_format": {
"type": "text"
}
}'
also revoke your api key
Correct
Do not forget office hours this afternoon if anybody wants to join!
https://events.zoom.us/ev/Akzh8Q9GwGtQ8-5yeP1A6B0kQBND1W67rbimE3koC4L_L4ZP65f2~Ag4nJHk6gbPxvgM1f_OCr6BzgyKoKK7hLYpE3HmzJ69MnMG3CvFABoNg6Q
@fiery spear pls remove this message as it contains the api key of this person
any my message also
and
Hey @nova swift!
If you find the original message helpful, please consider reacting to it with the :star: emoji. If the post is appreciated by the community and receives 5 stars, it will go to the https://discord.com/channels/1047197230748151888/1082806833938436228 channel and the post author will get the <@&1082034222778302614> role on Perplexity.
Anyone have any tips for forcing the api to adhere to schema?
Mine is going a bit off script or just ignoring sections. Schema is correct and returns correct. But it returns a lot of blanks despite requiring them
Thanks for sharing the link to watch "An Introduction to Perplexity's API with Co-founder and CTO Denis Yarats" once it’s available 😉 (unfortunately, I wasn’t available during the live session)
Seems like auto reload wasn’t working.
how many working days is it going to take to get the sonar api credits ? @fiery spear
For the hackathon you mean? I add them every day around 6PM Et
Yeah, do you do it in batches? cuz i submitted form 2 days ago
or 1 day , i dont remember
Yesss
ahh ic, then i will wait
I want to know one thing is there not a better way to request credits ?
For perplexity hackathon
Please lmk because credit card is not something which is safe as a student
...? Can you pls answer the above ques ?
Unfortunately registering via a credit card is the only way we have to access our API.
@hybrid solar you can also use a debit card intended for online shopping
Wanted to bump this because structured outputs fail to adhere to structure. Is there any solve for this?
Sections are left blank or simply skipped. They are being dumped correctly from pydantic models. So it’s a response issue.
Can you please share a reproducible example for this in a cURL request? We are not aware of any such issue at this time. If the sections are left blank it may be that the model simply wasn't able to answer the query.
Have you attempted the same query without the response format?
I wonder why the UI and API return such different results for the same question.... ...The UI returns very detailed and valuable websites to browse, while the API does the opposite. I am using the sonar-deep-research model. Has anyone come across the same situation?
If we use our debit card will our details be saved ?
afaik only Stripe sees, saves your data, but you can check with api@perplexity.ai or support@perplexity.ai
Okay thanks 👍 but a suggestion from my side could be you could have created an API key and set an expiration limit until the hackathon is finished and would have kept a rate limit on per day basis that would have been great
Bumping this up too! I noticed structured output adherance is signficantly worse than a few weeks ago. A script that used to work is now having a lot of issues
It’s not exactly a curl issue. The schema is accepted. It’s pydantic model.
The issue is that it’s not completing the schema or leaving blanks.
It’s things as simple as age ranges. I’ll have a model for 3 age ranges and sometimes it fills in all of them. Sometimes 2. Sometimes just one.
I have it as a mandatory field.
This isn’t exactly obscure research asks. It’s a structured output having wildly inconsistent results
Does my experience match yours?
playing with the sonar endpoint providing text + image (https://docs.perplexity.ai/guides/image-guide)
image is compressed and as jpeg (only ~10kb) and attached via base64
90% of the time, i don't get an response waiting 5 mins plus
sometimes it just gives me the answer back after 30 seconds
what is going on here? with 5 minute waiting times -> timeout on 10kb a image this is practically not usable for me at the moment
did anybody else has some experience with the endpoint?
hey everyone. I wanted to ask if subscribing to perplexity pro will give me the same as sonar pro?
I've tried to use Sonar API to perform sentiment analysis on stock tickers. I've used Pydantic to enforce schema; and ensure that the system and user prompt explicitly states that a list of dictionaries ('id', 'ticker' and 'news') will be provided and expects the output to comply with the Pydantic class (i.e. 'id', 'rating' and 'reasons' fields).
I'm able to get the output in the correct format but it only returns the first item instead of all news items in the list.
Is this a common issue?
bro same i have a debit card i tried to use that one for sonar api but it says this card is not supported now what should i do
then how can i make my hackathon project
yeah
I've tried to use Sonar API to perform
I verified my card but no hackathon credits are added.
I’ve been having structured output issues too. Good to know I’m not crazy. Been messaging about it above
Am I crazy or is there no way to do async deep research via API? It seems crazy to try to keep a socket connection open for 20+ minutes. I'd imagine the flow should be:
- make deep research api request, receive GUID for the query
- poll a "status" endpoint while the research executes
- when the research is done, the status endpoint would either return the results directly or just "done" status and you could GET the results using the GUID
Can you share your schema or a version of it? I haven’t been having issues but need to know if it could become one
Here's a basic version of some of my model. It was even messing up this:
class DemographicProfileDetail(BaseModel):
age_range: str = Field(..., description="Representative age range (represented as a range in the syle of '18-34'). Do not deviate from this range styling. In English.")
gender: str = Field(..., description="Dominant gender(s) in this audience (e.g., 'female', 'male', 'all'), in English.")
income_level: str = Field(..., description="Income category (e.g., 'upper-middle class'), in English.")
location: str = Field(..., description="Geographic locations for this audience (e.g., 'urban U.S.'), in English.")
class AudienceProfile(BaseModel):
needs: List[str] = Field(..., description="what are the needs of this audience", min_length=3, max_length=3)
objections: List[str] = Field(..., description="what are the objections of this audience", min_length=3, max_length=3)
desires: List[str] = Field(..., description="what are the desires of this audience", min_length=3, max_length=3)
painpoints: List[str] = Field(..., description="what are the [painpoints] of this audience", min_length=3, max_length=3)
class AudienceSchema(BaseModel):
demo: Demographics
profile: AudienceProfile
Note me having to constantly say "In english" because the api was returning mandarin to me constantly 😂
Hmm. Which sonar model? And you’re including the keys in the prompt or system prompt? And then it returns with fields missing altogether?
Pretty funny, I’ve never seen it in the output, but I’ve seen the r1 based models go into mandarin while thinking, especially when trying to solve equations
Just the sonar model with structured outputs so it's just passing it the schema from the schema dump in pydantic
why is the api response so different from the web experience? I can't get the API to even come close to the quality of web results, citations, etc.
Note that in the docs, they say “We recommend to give the LLM some hints about the output format in the prompts.” https://docs.perplexity.ai/guides/structured-outputs I’m not sure exactly what’s going on under the hood with different model providers when a schema is passed, but most recommend including both the schema and the instructions to output in that format in the prompt. I’ll be curious if listing the fields resolves the issue
I’ve done both. I still get inconsistent output
I do pydantic models with descriptions. I lay out each section in the prompt. Still get inconsistent output
It’s not an issue with OpenAI literally do the exact same thing and it works there
I’m trying to diversify services so that’s why I’d like this to work here
Interesting. I guess it’s probably different effectiveness for different models, so maybe I haven’t had issues since I don’t use base sonar. Worth a try if you haven’t yet, though obviously pricing can be an issue. Yep agreed that OpenAI has excellent structured output adherence!
Yeah. I might just have to go back for now.
There’s just some things that real time information would be really awesome for
Hi @loud basin can you please privately share a reproducible example where structures outputs is not working as expected? We are not aware of any such issues at this time.
We do recommend this but the output should be guaranteed regardless.
was trying out the deep-research. Tested with the code given in the docs but got RemoteDisconnected after 1 min,,
Does perplexity api support tool calling?
Remember team office hours today if anyone is interested
Can use our sonar models as tools via LangChain, LlamaIndex, Google A2A...
@fiery spear - Not sure if you got a chance to look at my post - I am trying to use Sonar API with Llaamaindex in a RAG project. But the API does not work for that. Any hints code examples would be appreciated.
@tawdry oar I put these together for LlamaIndex but I am still not sure what exactly you were trying to do last time. Maybe I can try again?
https://github.com/ppl-ai/api-cookbook/tree/main/perplexity-llamaindex/memory
How to join?
Register for the event and submit your demo ideas:
not abled to buy API
please send an email to api@perplexity.ai
What is happening? Are transactions getting declined?
We use sonar to query the web, then pass the raw output to a cheaper OpenAI mini model to parse the raw data and return the structured outputs we need for our applications
Why not just use OpenAI web search? Or does sonar still have the edge on that?
- When we started, it wasn't available
- We're still working on a robust enough test suite to help verify whether using openAI improves or worsens the results we get back
Hello,
I have been testing the API but I would like to also include snippets from my own retrieval pipeline, is there a standard way to do so ?
I have tried adding to the system prompt :
Extra search results:\n<doc url="https://.." title="..."> HTML CHUNK HERE </doc>
This seems to include the information but not include any citations
Hi folks!
Is there a way to get citations mapping and titles from sonar via chat completion API, similarly to openAI API? start_index, end_index, title...
RN I only managed to get a list of citations as array of URLs, but that is not enough to map URLS to results.
Am I missing something, or it's a known limitation, thank you! 🙏
like this?
Yeah, in openAI every citation is linked to slice of tokens from response, if I'm asking some question that gives a list answer I can map citations to list items and figure out which citation refers to each item.
For example:
Q: "what is the best search engine"?
A: 1. Google 2. Bing 3. DuckDuckGO
Citations:
- Wikipedia (https:/wikipedia.org/public-search-engines); start_index: 0 end_index: 8
- PCMag (pcmag.com/duck-duck-go); start_index: 18 end_index: 29
So fist citation (wikipedia article) refers to google in the answer, 2nd (pcmag article) refers to DuckDuckGO.
Perplexity so far only provides an array of URLs and I can't deduce which citation refers to which part of a response. Maybe I'm missing something tho
Thank you ❤️
my example is using perplexity sonar!
I can send you the code if you want and you can mess around with it
Oh, sounds good man! Could you please?
hello
im facing issues with the creation of API token
It is not providing me the 50$ token
What to do pls help
same question, hope the API can return title, description, summary, index
I agree this workaround is more than you should have to do, but have you tried requesting + Beautiful Souping the URL citations, and then checking which of the bullet points (I recognize this may be harder in your actual use case) are mentioned most-frequently by that web page to manually correlate them?
@mild lantern That's not super scalable/reliable unfortunately 😐
please send an email to api@perplexity.ai
Office hours tonight everyone would love to see you there: https://events.zoom.us/ev/Akzh8Q9GwGtQ8-5yeP1A6B0kQBND1W67rbimE3koC4L_L4ZP65f2~Ag4nJHk6gbPxvgM1f_OCr6BzgyKoKK7hLYpE3HmzJ69MnMG3CvFABoNg6Q
Thank you!
Actually is all fixed now. I could get the 50$ credits
Unlike other models (e.g., Sonar-pro), I’ve noticed that the num_search_queries field is missing from Sonar’s API response. Does this indicate that no searches were run? For context, the search_context_size is consistently “low” in my prompts, and the responses typically include 4–5 citations.
For your information: https://www.anthropic.com/news/web-search-api
Already available in the Anthropic console and Claude Code as well.
Every response using web search includes citations.
https://docs.anthropic.com/en/docs/build-with-claude/tool-use/web-search-tool
(One more tool in your toolbox)
Not yet integrated into "Search Arena"
.
Does perplexity have an api tho ?
Tysm
Does the pro plan include the api
As a Perplexity Pro subscriber, you will receive $5 in monthly credits (https://www.perplexity.ai/help-center/en/articles/10354847-api-payment-and-billing)
Hey @sharp trout
Using the api with return_images and have a couple of questions.
Sometimes the image it returns has a url like "x-raw-image:///xxxxxxxxx" - is that a bug?
Could we get more metadata for images returned? The only hints for what it is are the url and source article urls. A caption or alt text from the article would be awesome. Prompting to get it to output image descriptions in the main body doesn't work either.
I can definitely ask for this
<@&1349827857777561601>
🚀 Enhanced Domain Filtering Now Available!
We're excited to announce a significant upgrade to our search domain filters today!
What's New:
You can now specify subdirectories within domains for more precise filtering, not just top-level domains.
Before:
["nytimes.com"] # Could only filter at the domain level
Now:
["nytimes.com/section/world"] # Filter specific news sections
[-"bbc.co.uk/sport"] # Exclude specific site sections
This enhancement gives you much more granular control over your search results, allowing you to target exactly the content you need - like focusing on world news while excluding sports sections.
Let us know if you have any questions about implementing this!
Hi, For perplexity API Key, Do we need to add credit card details?
can anyone help on this- I am new to hackathon
you can't join without a valid credit card
okay thanks
Does perplexity have any Monthly subscription or Annual Subscription plan for Sonar API for Enterprises
With No limit on credits
What is the current model names in perplexity API?
Thank you
I've got a prompt that returns a list of JSONs. It works really well when I use it in the Web UI.
But I'm now trying it in the API and I'm only getting one result back. Perhaps there is somethign wrong with my JSON schema? Any guidance on how to return a list of JSONs in the API?
Ah I asked Perplexity and it told me so no worries all sorted
Different question: I get wildly different results through the Perplexity web UI than I do through the API. I've asked Perplexity web UI how to get equivalent results between web and API. It only gives me very generic things like "make sure the system prompt is the same" and "make sure you're using same parameters like temperature, top_k...".
Any guidance on how to make the API return results that are as good as the web ui?
Any idea when it will be possible to poll for results? I am hitting the limits of tools like Coda and Zapier when trying to automate things because of the how long research tasks tend to take.
It's coming very soon
Hi team!
We are pleased to share some high-level results from our recent benchmark evaluations on BrowseComp and Humanity's Last Exam (HLE):
Performance Highlights:
On BrowseComp, Sonar Pro Low outperformed Claude 3.5 Sonnet and Sonar High matched its performance. Sonar Low (our cheapest model) outperformed Claude 3. 7 Sonnet
Sonar Pro Low achieved 4.0% accuracy on BrowseComp, almost 50% higher than Claude 3.5 sonnet
Sonar Pro matched Claude 3.7 on HLE reasoning tasks at almost a 50% lower cost
Both Sonar and Sonar Pro delivered up to 3x faster response times with more consistent latency
We appreciate your continued partnership as we continue pushing the boundaries of performance and value. Our team remains committed to innovation and delivering solutions that meet your most demanding use cases.
<@&1349827857777561601>
Just a heads up — Perplexity Pro actually includes $5/month in API credits! You can find the API docs and get started at https://docs.perplexity.ai 🙌
Registering via a credit card is the only way we have to access our API, but you would not be charged if you keep your usage at or below $5
Adding a payment method will not charge you. It just stores payment information for later API usage if you end up using it a lot
You can deactivate auto top-ups, then that is exactly what it will do. It'll still require a payment plan but if auto top-ups are not enabled then it'll just throw a 401 when you're out of creds.
<@&1349827857777561601> We have a new team member! Please join me in welcoming@full raven who is our new Developer Relations Resident. Sathvik won a Robinhood competition using our API and will be helping our developers build with Sonar. Please feel free to reach out to him with any questions you may have!
Hello welcome
Welcome aboard, @full raven 🎉 Congrats on the new role excited to have you on the team. 🚀 Looking forward to seeing what you build and how you help grow the developer community around Sonar! 💻🛠️
Hi everyone! I have uploaded some documents using Sharepoint integration into my Perplexity Enterprise Pro. It works well in UI and reponses are relevant. However, I can not receive any useful responses using Perplexity API service. I tried different settings and parameters but generated responses keep being uninformative. Does anybody have an opinion what might be the issue?
idk
Hi everyone, I hope you're all doing well! I'm facing an issue while trying to acquire the Sonar API for our hackathon project. When I attempt to generate an API key, it's asking me to add credit card details, but unfortunately, I don’t have a credit card available. Since this is purely for a hackathon and we've already completed most parts of our project, we were hoping to use the API for free—only the integration part is left. It would be really helpful if there's any way to access the API without requiring payment details, just for demo or temporary use.
@fiery spear Hi James I have not received my Perplexity hackathon Credits for 2 days. Can you help ??
I'm looking to use the API to gather more info on a list of contacts. When I use the web interface, it clearly queries linkedin and lists that as a source. But through the API, I'm not able to reproduce this behavior. Any advice about how to get the API to imitate as closely as possible sonar through the website?
same goes with me.
Hi, I have been using Sonar API for my hackathon project, but the answers generated using sonar model is different when we use https://labs.perplexity.ai/ playground. @fiery spear , The answers generated in playground is more better, maybe its because of my system prompt. Have anyone been facing the same issue while using the API?
@fiery spear Hello James, me and my team have been waiting for the API credits for 5 days and have not received anything. We reached out the emails and gotten only AI responses. Can we get some help please.
I just gave a round today. Did you check all of your API groups ?
I see it now. Thanks
heyyyyy is there anyone here to grant API credits for your hackathon?
Hey team, I'm incredibly confused as to why the perplexity sonar APIs are vastly different than the UI version—I'm getting completely different answers. Is this to be expected?
like when I see the sources in the UI, it's much closer to a google search results (if I were to query google directly), but with the sonar API, the search results (sources) are nowhere near
I see the same thing, it just feels like the api credits are as nowhere as good as the results from api
hi @torn pivot have you been able to figure this part? I have the same issue with the difference in outputs on web vs api
Me too, i have been trying to fix this issue in the sonar, but when i used sonar-pro it had better results.
Not much joy yet - will try different models. FYI this is a repo I'm testing with: https://github.com/alanbuxton/perplexity-api-tester
Same 😦
I'm sure there is a difference in the system prompt, but there must be more to it than that
I don't understand how it's SO different tho? Like if I look up a profile with a name, the sources that are returned has 0 mention of that name?
Also, the docs don't give any information about how to tweak the sonar API? Like does top-p affect the actual search? I would assume no?
Yep - it's very different. Which is why I suspect there is more to it that just the system prompt.
why do i get better outputs on playground as compared to the api?
like my outputs feel more direct and more accurate and less vague on the playground
as compared to api which spits out fluff, i changed the values of top p k but to no help
@fiery spear could you help guide? There are now like 5 people asking the same thing in the last 2 days
one of the ways i fixed this was by adding a sample example message in the conversation history for the assistant. This makes it give great results, but this takes away a lot of my tokens, like thrice the price for a search
Hi, I have a problem. When I trigger a perplexity Deep Research (sonar-deep-research) over an API I see the requests as sonar-reasoning-pro. I'm sure I trigger the correct model, responses seem like from deep research but in the dashboard, I see them as reasoning pro
I created an issue in your github: https://github.com/ppl-ai/api-discussion/issues/320
Did anyone else have similar problem?
yeah me too
also does perplexity support open ai json schema via the opanai python library
Not ideal. Let's wait for the official response on why the discrepancy.
Hey folks, using N8N + Sonar to research target companies in our CRM (using google sheets right now). Most of these steps fail / timeout, with a few going through. It works perfectly from the browser when we do it manually. Anyone else experiencing timeout issues when using the API?
N8N support confirm it's on the Perplexity API side. considering batching the research into smaller groups, though that's a "mud at the wall" approach.
That's just the model SKU for the deep research model unfortunately, I know it's a little confusing but it is indeed deep research.
This question is very often being answered in this conversation, it is a direct consequence of the fact that some websites block our crawler for the API in their robots.txt and the information is not available via the API, but may be available via the WebUI.
In general though, if the site is accessible via API, the best way to try and fix this is to set search_context_size to high.
Why is it that the WebUI has access to some websites vs the API not having access? Isn't it the same API under the hood?
Please refer to this page in the documentation: https://docs.perplexity.ai/guides/bots
Perplexity
We strive to improve our service every day by delivering the best search experience possible. To achieve this, we collect data using web crawlers (“robots”) and user agents that gather and index information from the internet, operating either automatically or in response to user requests. Webmasters can use the following robots.txt tags to m...
Hi team - office hours later today! Please do join if you can make it 🙂
Yo what are the updated rules in Perplexity Hackathons ?
Great question
You should have recevied this email. Thanks a lot. Also do join our new community forum! Will be prioritizing this for questions. community.perplexity.ai
Hello, I was working on a project for the Sonar hackathon, While trying to access the API, I put in my billing details, I am unable to access my API Key
This is what I see while trying to create a new key, what could be the possible cause and fix? my details have been successfully added to the API Group, [See Image 2]
you don't have credits yet, adding another round tomorrow
My credits vanished overnight as well.
I was working with the API perfectly but now it was reset to zero for some reason.
Any issues?
Do I have to fill a form for the same? Where can I find the form link?
@fiery spear we haven't got the api credits yet I have mailed as well but no response
Do check this as our project is on hold because of this
Same
found it, form is on devpost, when u register, there is a todo section at the right, where you'll find the form
Yehh but that’s the old form rt ? Or have the updated a newer one ?
Hey, I have opened the issue on Github, but also want to share here to get more visibility. Not sure if it's a known issue or I got something wrong.
https://github.com/ppl-ai/api-discussion/issues/322
where can i get support for api billing?
how do I add credits in my account for the project? Do i have to pay for it or the perplexity will give it for free
woah. is perplexity is really charging per api request. even google flash preview 04-17 and 05-20 is cheaper even with more tokens used
hi there, i wonder if there are any api python client that i can use? i built by own client with httpx but i see a lot of Connection Timeout and Read Timeout, not sure if this is a client side issue or it's server side. i used openai api with openai pkg, there is no such issue.
hey, which model are you referring to?
https://docs.perplexity.ai/guides/pricing
tbh I think that the cost of these models is difficult to compare due to their use and architecture
sonar reasoning pro pricing^
This seems confusing, do i get charged on the basis of number of tokens used and it also will cost me 14$ for every 1000 requests on top of that?
Hey
Do perplexity api is not returning image url after even keeping the parameter true for every one or I am only facing it
Hey! Can anyone guide me about how to use sonar api and how to get it?
Hey, you can find a lot here : https://docs.perplexity.ai/guides/getting-started
Hi. Can I use the API to generate images?
Charging per search is standard. OpenAI (look for Web Search Tool Call on pricing page) is $25-50/1000 calls. Gemini is $35/1000 though they give a generous free number per day because Google can afford to do that.
You get charged on input tokens, output tokens and a flat fee per request.
Unfortunately not at this time.
I would like to clarify. If my video is 4:10, I can submit it, but the judges are not obligated to watch more than 3 min right?
Yup that’s right
i've enabled websearch in api, and it returned citations, but in my usage dashboard, there is no search queries, is it expected?
@fiery spear.Are there any suggestions about what parameters to use in the deep research API to mimic the results of the web version. The results I see from the API are much less detailed compared to the same requests in the web ui version
Hey the deadline is tomorrow 12 noon GMT right?
About 10 hours to deadline
HOw can I disable online search in perplexity api while using with openai client?
how did you disable/enable web search in api?
Hello! Can you advise me on the API? I purchased Perplexity PRO and am interested in how many API calls I will receive. I see on the website that I have $5 available. Does this renew every month?
<@&1256984878138920981> Office hours this afternoon folks for those who are interested! 3PM PST. Here is the link: https://events.zoom.us/ev/Akzh8Q9GwGtQ8-5yeP1A6B0kQBND1W67rbimE3koC4L_L4ZP65f2~Ag4nJHk6gbPxvgM1f_OCr6BzgyKoKK7hLYpE3HmzJ69MnMG3CvFABoNg6Q
So It's not cancelled like last week?
I got some weird response from the API I want to examine
it should
I got 1 year of pro, much less BS than OpenAI, ChatGPT is a massive waste of money, glad I stopped using them.
No I only cancelled it once when I was traveling, we had it last week too. Looking forward to seeing you all there!
Hello everyone! Is it normal for all my 20 tests that Perplexity Pro is much better than Sonar Pro API or even sonar reasoning Pro?
It’s normal. Perplexity Pro uses proprietary models, while the API relies on open-source models.
Dang! That is starting to sound like the costs related to credit card processing. 🤣🤣
This is actually incorrect, this is what that page says too.

<@&1256984878138920981> New Feature: search_results Field with Richer Metadata
We’re excited to introduce a new response field—search_results—that provides additional metadata on top of the existing citations. This new field includes useful context such as the page title and publication date (if available), making it easier to interpret and present results.
Example for this query: What should I know before markets open today?
"search_results": [
{
"title": "Schwab's Market Open Update",
"url": "https://www.schwab.com/learn/story/stock-market-update-open",
"date": "2025-05-25"
}
]
We will continue returning the legacy citations array for at least the next 2 months to ensure backward compatibility, but we recommend migrating to the new search_results field for a more structured and informative output.
definitely useful, thanks for sharing
Perplexity Labs API? When?
Hi guys, is there a way to only use a specific knowledge base?
I'm actually learning to integrate LLMs and so I'm having fun with Sonar. My idea here is to make a Discord bot for a specific server but I don't wants the bot to try to answer to something that is not related to the server.
Let's say, it's a gaming server and an user asks the bot how to bake a cake. Actually the bot will give steps and recipe regardless my system prompt but I just want him to say something like "Sorry but I don't know about that".
Is it possible?
LLMs are trained on a genereal text and stuff, so they usually answer based on that, you would need to actually fine tune the hell out of it based on your data for it to just answer to that I think
Yep, super doable! Just add a filter before the bot replies: either use embedding similarity (if the question isn’t close to your gaming content, reply with a default message) or use a small LLM to check if the question is on-topic with a structured boolean output (true/false). If not, don’t answer.
Alright thank you two for your reply! I’ll dig into that
<@&1256984878138920981> We're thrilled to announce a major enhancement to our Sonar Deep Research model - an asynchronous API designed specifically for complex research tasks!
🔍 What's New?
Our Sonar Deep Research model now offers an async mode that lets you submit research-intensive queries and retrieve results when they're ready. No more waiting for complex queries to complete - start multiple research tasks and collect the results at your convenience.
⚡ Key Features:
- Submit complex research queries and retrieve results later
- Poll for completion status with a simple API call
- Perfect for deep research tasks requiring extensive processing time
Results stored for 7 days, giving you ample time to analyze findings
🛠️ API Endpoints:
- Create research jobs via POST to /async/chat/completions
- List all your async requests with a GET call
- Check status and retrieve results using the request ID
This new capability is ideal for developers building research tools, content generation platforms, or any application that benefits from thorough, source-backed information without blocking user experience.
Check out the full documentation here: Sonar Deep Research Documentation: https://docs.perplexity.ai/models/models/sonar-deep-research
Good
Sorry for the spam team but we're shipping too fast..
nah keep this up we like it
Another one coming later today actually....
how are you guys even scaling all of this? k8s? its amazing...
No man! It's completely fine for all of us. We actually need this type of speed in development and releases!
don't worry about that we got it somehow
🧑🍳
How do I stop getting pinged for this?
@fiery spear Nice to see this feature being rolled out. In fact, I figured it out using a third party service for my hackathon project, Alethea AI!
Remove the role
Channels & roles top left or something like that
Fantastic development! Thank you for this!
Thank you!
All of mine were turned off, but I disabled “I want to hear about product announcements” so hopefully that helps.
Oh weird... Then you should ask a mod because you still have the API announcement role
I think there is a misconfig for this one, <@&1098365634498285709>
Thanks will take a look at it, i’ve removed the role for you
Well, idk… BUT—İ think the broadened concept has utility, but your means of formulating its relevance and ability within confined parameters isn’t to be advised. Domaine specific expertise and preference is one thing, but if you apply a model where it isn’t able to abstract, it would be borderline useless. Domaine specific doesn't mean dispensing with network domaines—in order to abstractionalise with depth and clarity you need the ability to detect, theorise, identify and define correlation .
Thank you! You rock!
Seeing as it’s a discord bot about your gaming content… why don’t you just define the response so that whenever a message that includes the trigger is sent it responds? No offense, but your using up servers and stuff your not going to fully use, and for the concept your looking for, Sonar API doesn’t really make sense for that
I'd rather let people use more open questions and let an AI identify to what it should refer tbh. But I get it and agree with your point. Don't worry that bot will probably never be live (or not long). As I said, I'm actually learning to use LLM/API. I'm making myself some more specifics projects so I can train with AI. Sonar seems to be a good start with these 5$ credits included with PPLX Pro
As for myself, none of my machines are decent enough to correctly run LLMs locally (I can make some running and answer correctly with really short and simple queries but that's all). I'm in the middle of a career pivot and will be able to get more resources for AI later but I have to do with what I have at the moment
yo guys
Hey guys, for those wondering what the Sonar Deep Research Async feature is useful for — it's great because the API takes care of the long-running logic you'd usually need to handle in your backend and stores everything for you for 7 days.
Here’s a demo to help you understand:
👉 https://sonar-async-demo.vercel.app/
And the code is here:
💻 https://github.com/mrprokl/sonar-async-demo
Hello si or possible to Connect manus to perplexity ?
Hi, I am not sure what you mean by "connect manus to perplexity" but I'm sure you can replicate the vast majority of Manus use cases directly with Perplexity or the Sonar API
I'd be happy to help if you tell me more
Can perplexity generate pdf or lots of plots if I ask it?
Can someone explain what the new feature of labs is? I can’t comprehend what it is for yet. I use Spaces for specific needs, because I can add knowledge files and focus on a topic. Labs instructions basically is the same thing. Maybe I can’t understand what it is. Any help will be appreciated.
you can export Perplexity's answer as a PDF, Markdown or DOCX
Spaces let you organize your research in a centralized workspace (group threads, upload files, and collaborate with others).
You can compare Labs as your AI-powered research and development team that can take a problem statement and turn it into a complete, interactive solution with minimal effort from you
Thank you for your answer: I just created an api with perplexity and I want that manus make ask to perplexity : is or possible ?
No I don't think Manus will let you configure an external LLM via API
However, if you're interested, I came across a Reddit post from someone who recreated Manus using the Sonar API called "I built my own Manus.im using Perplexity Sonar API and Claude, and it works just as well, for almost free"
Is this what you guys are referring to?
Can you please share the post
Sometimes my responses of sonar-reasoning-pro are cut-off mid thinking. Is there any default limit of max tokens that could cause that?
Hey, the max output token limit of 8k
have you tried tweaking the max_tokens parameter?
No, I left if at default (didn't use it)
Afaik max_tokens doesn't change how the model is structuring its response, right? It only cuts off execution?
Yeah max_tokens should just cuts off execution, doesn't change how the model structures its response
you should try with a huge value like 8000 to check if it solves the problem
ok
Hi all, quick question .
Internal knowledge search sounds exactly like the tool I need right now
( Link here https://www.perplexity.ai/help-center/en/articles/10352914-what-is-internal-knowledge-search )
How can I make a web+org files search using the API? The docs don't seem to mention anything about it
Hey @visual vector, are you Enterprise Pro?
Still needs to be confirmed, but I believe this Enterprise Pro feature is limited to the user interface and not natively available via the API
So you would need to perform RAG on the user’s research, then call the Sonar model of your choice with the internal knowledge context
Hey @mental viper - yea enterprise pro, thanks for the reply. I was really hoping that I could avoid RAG using an internal knowledge search. Anyway, thanks for the help!
Better to confirm my words with the API team, but I think the best way to avoid RAG here is to go through the user interface 🙂
Would anyone here like to try out our academic filter (that is still in beta testing)?
Yess
yes sure
yes I'd be happy to try it out
Please keep it to yourself we're still running evals lmk what you think
curl --request POST --url https://api.perplexity.ai/chat/completions --header 'accept: application/json' --header "authorization: Bearer pplx-" --header 'content-type: application/json' --data '{
"model": "sonar-pro",
"messages": [{"role": "user", "content": "What is the scientific name of the lions mane mushroom?"}],
"stream": false,
"search_mode": "academic"
}' | jq
This would have been so useful so the hackathon
Hey team, quick feedback on the new Academic Filter mode.
Prompt used:
"What is up to date scientific consensus on the best way to be happy at work?"
What worked well 
- Strong synthesis with clear, nuanced answer grounded in real research.
- High-quality sources, mostly relevant and credible PMC articles.
- Good scientific tone, balanced, no hallucination or overclaims.
Areas to improve 
One off-topic source -> “Nigel Allan appreciation” didn’t match the prompt and might add noise to the LLM’s output.
One 2005 source felt a bit outdated given how much workplace dynamics have evolved.
Suggestions 
- Not sure if this is already implemented but a reranking mechanism that assigns weights to sources could be a potential avenue to explore (especially to boost domain relevance) ?
- Provide fine-grained, clearer snippets from each source to better show which parts support the answer.
Really promising beta, I will try with new prompts 
Hi guys! I am using the Sonar Reasoning Pro api with a search domain filter to pmc.ncbi.nlm.nih.gov to specifically get answers grounded in PMC articles. What I've found is that the it just intermittently cant access PMC, which I am assuming is due to abuse protection from NCBI. Been pretty shaky the last couple of days. Has anyone else experienced this?
Hey, yes because of rate-limiting cap
"NCBI recommends that users post no more than three URL requests per second and limit large jobs to either weekends or between 9:00 PM and 5:00 AM Eastern time during weekdays. Failure to comply with this policy may result in an IP address being blocked from accessing NCBI"
have you tried outside of peak hours?
I'm not an expert, but I’d assume Perplexity makes the requests from their own servers, not from my IP. A rate-limiting cap like that would affect users more collectively, no?
Yeah, you're totally right! That’s probably the issue actually : lots of users are likely querying NCBI via Perplexity’s servers
If that's the case they're probably already working on preventing this, seeing as PMC is the largest source of open access medical articles
There are solutions; try outside of peak hours or use Firecrawl’s Search feature -> format your query like pmc.ncbi.nlm.nih.gov + your keywords, then feed the markdown files you get into the LLM you’ve set up with a custom system prompt to generate professional Deep Research (basically crafting your own homemade Deep Research)
I just tested it works with Firecrawl proxies; if you need anything I would be happy to help you
(but for me it's better to stay within the Sonar ecosystem and try again at different times of the day first)
Whoa you have no idea how tempting that sounds, but I kind of need the simplicity of what sonar reasoning pro provides. When it works, it really does what I need it to.
I'll for sure try to run it outside peak hours though, thanks for the tip.
100%!! I also prefer doing everything with Sonar when I can
No problem!
When I use a prompt online I get an answer 100% of the time but when I pass exactly the same prompt via the api I only get an answer about 50% of the time. It doesn't straight out fail but comes back saying it can't find anything related to what I'm asking about. Anybody know a possible reason?
Hey, do you have a specific example of your API request that failed and the error response ?
I don't get an error message per se. The prompt I use gets news stories and validates any of the information in them from multiple different sources. When I use it online for something like sports news in the USA it comes back with the validated stories. When I use the API with exactly the same prompt, within a minute of doing it online, it often comes back and says there are no sports stories in the USA which isn't possible. If I was looking for mental health stories in Angola I would accept the possibility of there being no stories. The issue I have is why is there a difference between the response online verses using the API. For the sports/USA example I get a suitable response 100% of the time online but only about 50% of the time when using the API.
<@&1256984878138920981> We've done some major upgrades in the last 10 days:
- Reasoning effort + async mode are now live for Sonar deep research!
- Academic mode now on all models!
- Every citation is now richer with title, url, date.
Would love to see what you build with these new features, and as always please do share some feedback!
Sonar just got a massive upgrade.
- Async mode + reasoning effort are now live for Sonar deep research: more control, improved workflows.
- Academic mode now on all models
- Every citation is now richer: title, url, date.
Let's see what you build next. Stay curious.
Great new
Alright back to work now, what should we ship next?
Oof..
Hahaha it’s definitely a needed feature
But I understand it’s hard to implement
Also just realized this is the API channel…
Google might just bake that feature into the next Pixel phones, going by their demo of Gemma 3n
ChatGPT has had it forever and it’s absolutely magical
I have fixed so many home improvement issues with Live Mode
:0
Formal reasoning for coding
Just like deepseek prover
But for coding :)
Thanks guys!!!
Epic!!!
Looking forward to pushing this to its very limit - mind the pun
I want this answer.
Been using sonar to search and summarise. But ended up moving away from the search API capabilities as it feels what you get via API is 50% of the online interface.
If pro interface results were available as API…I wouldn’t have to pay for API’s in other places to yield enough information to come in for API to make sense.
Which Gemini flash is starting to just do.
But I want sonar to win…
😎
Yes
Gift hampers /jk
In all seriousness though, given how good the UI/UX is in general, I was wondering if the Labs made presentations could be a Lil nicer
Academic search mode seems awesome but I'm not getting it to respect the date range filters. Consistently gets results outside the specified range. Tried a bunch of different queries. Date filtering seems to work when the search mode parameter is omitted though.
Hi all!
As discussed in past threads, after many tests, my Perplexity API calls return results much worse and incomplete than the Web UI.
I want to use the Perplexity API to abstract all the research work, but the results seem incomplete to a point that forces me to build a research agent using Brave, Tavily, or Firevrawl and do all the work “manually.
How are you guys handling that? Is anyone really managing to use the API for real applications with complete and rich search results?
What do you mean by "incomplete" and "worse" here?
The number of references and details. For example, I usually have pretty good results in the UI for my query context, with an average of 10+ “citations”. If I submit the same query to the API I get 2-3 citations and much less details in the general response.
I checked the docs about the crawlers, so I have a basic understanding of why it happens. But my final impression is that while the UI delivers great and unique results, the API is too close to the results of a basic research agent combining Brave Search + URL parse
Please don’t take this as a criticism. I’m a heavy user of the Perplexity UI and genuinely want to integrate it into some of my projects. But I did feel a bit of a letdown when comparing it with the API results
Hey guys, when using api via Dyfi AI, added as open API, and making question, it returned "". Nothing to displayed even error. Can someone advise me in this case pls?
@fiery spear can you please take a look at and share me an advise?
Hey @inland cosmos, could you please share your config (base url, model name and response mode) ?
Pls see the attached screenshot
could you please try to change the "Completion mode" param?
Error 400 displays
Anyone got experience in integrating social media APIs into an app in order to pull account analytics data?
nope but claude code can do it for you
Finance mode is cooking....
"model": "sonar-pro",
"messages": [{"role": "user", "content": "Prep me for when the markets open"}],
"stream": false,
"search_mode": "finance",
"web_search_options": {"search_context_size": "low"}
}'
Who wants to try this out?
for sure I want
Would like to give it a try
You could try postiz ?
@fiery spear hi, can you help to give an advise please?
Hey guys! i'm currently looking for some feedback on the Sonar API documentation as we are looking to improve them. If you have any feedback/struggles you experienced and can provide about the documentation, please thread it under this post in our community . for ex, anything that's unclear, hard to find, etc
Perplexity Sonar Developer Forum
Hey guys! We’re currently looking for ways to improve the API docs to provide you with the best developer experience possible. If you have any feedback regarding the documentation (something’s not clear, not documented well enough, or would like to see examples of a certain use case you had in mind), please thread here!
This moment marks the close of a beautiful chapter for the Coding Club NMIMS—a tenure shaped by passion, persistence, and the amazing people who made every line of code and every meeting-room moment truly matter.
As we bid adieu to the friendships forged, the challenges conquered, and the memories created, we carry forward the spirit of colla...
We post perplexity publisher program atuff
Have a look
Might be helpful for the #🧪│api-general Works!!!!
I’d be interested
HI. We observe API credit charge exceed actual usage. How could I get help for this issue. I have been trying all communication methods such as email to support@perplexity.ai, discord comment, developers forum and Intercom chat but response always stops. Could someone help or introduce the way to solve the issue?
please send an email to api@perplexity.ai
https://github.com/dawid-szewc/perplexity-cli
My Perplexity Linux CLI client 😉
I want to build a an AI project for searching the web to build my products. Does anyone have some good resources for me to start and learn more about perplexity
And to build an AI startup?
Thank you @shy quarry we'll do!
Is there a reason i would be getting a response even if i have the following in the prompt?
Important: Base your response ONLY on the search results provided. If you cannot find a clear answer in the search results, respond with "I could not find an answer in the search results."
If the answer is not found in the search results, do not attempt to use any prior knowledge.
but the citations and search results are both empty arrays.
I would figure since those are empty then it would respond with "I count not find an answer in the search results?
anyone happen to have any thoughts on the above?
I’ll show you how mines is set up, maybe that will help.
oh that would be great. thank you
also if i restrict the domains. Does it actually check all the domains or does it just check the first one and if it hits X number of citations it stops?
^
I appreciate Raboot taking a look but we were not able to solve the issue. Is there a mod that would happen to have the answers?
so is there a reason location filter like does not work for some reason....
like i ask it to rec me coffee shops
i use SF coords
and it finds random best coffee shops in knoxville tenessee
or indiana
or pittsburgh
iteresingly if i use the reasoning model i get responses that say
The first result mentions that ....
The second result also confirms ....
And yet i still done see any citations or search results listed
U miss me fuckers
no one have any ideas on my questions?
hello! I am using the sonar-deep-research model, but in the <think> phase of the response, it says "However, note that the AI does not have real-time browsing capabilities." and then proceeds to make up search results. isn't the whole purpose of deep research to be able to browse the web? i have set search context size to high and read the relevant docs pages. what am i missing?
anyone PPLX devs on this week to help with some of my questions?
is there a place i can get tech support help?
yeah i emailed them last week
we are seeing the same
was there a change that removed ability to set search domain filters to news sites (e.g. reueters.com) and get valid results? if we do it now we only get hallucinations of articles and no citations array
Damn... I really wish we could get an answer
am i missing something ? i cannot find any documentation on actually using sonar-deep-research via api, but we have pricing for it? anyone have any experience with this? what's the response format look like?
Here is the documentation for sonar deep research https://docs.perplexity.ai/models/models/sonar-deep-research
Hi, my credits are listed as pending, how long normally until they are added fully?
what's your email and when did u request credits?
@full raven sent u a dm please reply i dont know if u got my message
thank you!
how can i try this out
<@&1256984878138920981> Finance with Perplexity Sonar just got a whole lot better.
You can now search over SEC filings and get real-time stock data—all in a single API request. Market insights, earnings, and disclosures are delivered instantly, ready to use.
Try it out here: https://docs.perplexity.ai/guides/sec-guide
this is gonna be epic 🔥
those filings suck to read through
It’s okay we’ll learn to read them all together
Well they were already public information. I used to look over them for oil& gas companies to sell leads to lol
But now, mixing it all up together and using the sonar API, could make something powerful
I still have my credits from the hackathon bc I wasn't able to build on time, maybe I'll mess around with making some cool little app that chains things together to find hidden gems and potential breakout companies
Those API credits don't expire right?
No they don't
I mean it's $50 on my account.
Ok awesome. I had some great ideas for it too. Just working alone wasn't able to finish. I have an amazing app almost finished now for some other hackathons. I may add sonar API to it, but it's an app for finding and posting activities on a large globe/map with ai built in for recommendations and uses rag engine to better recommend and stuff. And I have subscription tiered functions...it looks sick. And it has the reddit widget where it will show up on Reddit.
I am working on the backend ai agents functionality now. Perplexity may be able to provide extremely detailed info on other activities, meetups, etc going on around the person and that could be a pro feature to get extra markers on the map and activities from other places.
Not finance though lol
Are these features the Perplexity backend team adds to the crawler? Is that why they weren't available before and the ai wouldnt do as good of a job with giving detailed info about sec filings?
Does it take time to build the data and have the AI ingest it?
@fiery spear is there a way to track all things i can do with finance API. i have been looking at it but i can't see one place to see all. Please suggest
Why do my API credits say there's an expiry date if they don't expire?
If it’s the hackathon credits they do but purchased credits don’t have an expiration date
My $5 from Perplexity Pro have 1 month expiry?
Better use them fast then
They get renewed every month
does sonar-deep-research support response_format : json_schema?
@fiery spear Hi, is every sonar model based on deepseek models as the base/are there non-deepseek models offered?
@fiery spear Can we please have spending limits assigned to API keys? OpenRouter has this and I don't want to pay an extra 5% on top just to use such feature. I keep having some small projects run above the testing budget because of dependency errors. This would make the API a better product. Thank you.
This is also why I won't deposit $500 or so right away; what if it all gets depleted in one day due to some coding error.
Adding this to roadmap, theoretically however yes the fix is to not have very large amounts of credit
have you taken a look at our structured outputs guide?
So what do we think of Finance search?
Good but I want every single source cited with exact publication dates / source last modified date in the output.
For the SEC filings? Can you please share what exactly that would look like?
Just like in the chat with numbers [1] and link at the bottom or similar. Financial data can be very time sensitive.
Like one day to the other a company can file bankruptcy proceedings, then the next day they are saved by some large investor.
hello everybody. I just purchased API credits but they're not showing up. I need a way to work with them in the next hour to complete a project. The purchase are successful from my bank. Can anyone help? @pliant fulcrum @fiery spear
please send an email to api@perplexity.ai
give perfect prompt
how do you exclude specific subdomains from the api call?
I currently only want to use anything start starts with
domain1.com/path1
I don't want to include domain1.com/path2 or others in my search. Any ideas on how to do so?
yes - however i've worked with sonar-reasoning-pro it itself has a <think> tag in response so just wanted to confirm, can you or team provide an explicit yes or no please, thanks.
hmm i'll bring it up we'll take a look
you have a sample query that has this behavior?
lol i would rather you confirm whether or not sonar-deep-research model will handle response_format, otherwise it's documented in your documentation that sonar-reasoning-pro model does <think> tags https://docs.perplexity.ai/models/models/sonar-reasoning-pro#:~:text=The sonar-reasoning,found here.
Hi guys, struggling to replicate responses from perplexity.ai with sonar api, any advice on how to get best results from sonar?
Perplexity can consistently find linkedin URLs given some info about someone but sonar almost never can
tried using sonar pro, high reasoning effort, high search context
I love perplexity but I'm struggling to get same performance out of sonar 😦
@fiery spear Can I cache a response generated through API by one LLM and then have another LLM critique it? Or will I need to cache it/store it on my own server and send it in a new request?
Think tags in response are expected as this is a reasoning model, we have made this design on purpose. You should parse it out.
We can’t surface LinkedIn via sonar because they block us on robots.txt and we are fully compliant
It will handle it, you’ll just have to parse out the thinking tokens if you don’t need them
You can use our search domain filters
oh fair, but this isn't an issue with perplexity.ai?
for reference, I don't need perplexity/sonar to be able to access the info on a linkedin page, just return the URL from a web search
Different crawler for perplexity
Well that part is our bread and butter!
hey man, have you tried tinkering with the parameters? you'll have to tweak temperature, search context size, etc
yeah, I tried setting reasoning_effort and search_context_size to high, are there any other parameters worth tinkering with to increase the probability sonar might find the relevant link?
appreciate the responses so far btw! much appreciated 🙂
presumably that different one is also compliant.. and so must use crawlers whitelisted on linkdin's robots.txt to surface info from the domain
why not give the API models a bit of bing API too?
Anyone have any ideas on how to replicate playground trough api? I'm getting wildly different results and can't for the life of me figure out what's up. Have tried upping max_tokens to 100k, web search context size to high and fiddling with both sonar-pro and s-p-reasoning to no avail.
but i still get crap from the API while playground gives me OK results.
Hey! I'll look into this. The models are non-deterministic, so it's likely not possible to get an exact 1:1 output, but I also agree that the current playground is a little buggy in terms of its output. I would say to try the playground within the API Reference while we take a look!
https://docs.perplexity.ai/api-reference/chat-completions-post
I've got the exact same problem, happy to see that's not coming from me!
Hi there!
I have this weird behavior where perplexity doesnt search the web. It then gives me answers without searching the web and therefore very inaccurate
Is there any way to "force" perplexity to search? I have tried with prompting but no luck so far
Not the same issue, but I had an issue where Sonar didn't search for urls in a specific format and hallucinated their contents. I solved this by decreasing the size of my prompt down to a couple sentences (following Sonar API prompting practices)
is this in regards to the API or the web ui? The API should let you search the web by default without any parameter tweaks
Try the search_domain_filters parameter!
Hi everyone. I have perplexity pro. I'm confused whether this gives me API access or not. Does anyone know?
https://www.perplexity.ai/help-center/en/articles/10352901-what-is-perplexity-pro
API credit
With Perplexity Pro, you get $5 monthly to use on Sonar. Our API gives you access to our Sonar models, allowing you to embed our AI-powered search into your own projects while having the ability to obtain citations.
Hey team - lately we have been noticing an increase in issues coming from the way that users are prompting our sonar models. Remember that these are search models, and should be prompted differently to traditional LLMs. We've added a few of the common pitfalls we've observed to the docs for users to better understand how to get the best out of these models. Please do let us know if anything else is unclear around this! https://docs.perplexity.ai/guides/prompt-guide
Anyone here have any tips, tricks, etc on getting more consistent responses from sonar and sonar-pro? As a broad example, I'm using sonar-pro with a high search context and structured JSON output to return a list of information it finds on a company. The exact same prompt, just called sequentially will sometimes return 5-6 outputs for my JSON, sometimes it returns zero. Is there a way to get less "spikey" results from sonar? or is that just the nature of the beast?
I'm having an intermittent issue where the response returned from the model is not a valid json. FYI, I'm using Langgraph to call perplexity. I wish there is a way to see a history of API calls in my account dashboard. This happens randomly with all the models
How Can I Log or Display Exact URLs Accessed by Retrieval Tools When Using the sonar API????
is that even possible?
Hey! Have you tried to navigate to the Usage Metrics tab in the dashboard?
Tweak the temperature!
Do you mean citations? Enable the return_citations to be true and you should get a list of url's with your response
Hi guys! We’re excited to announce that the new Perplexity Sonar API Documentation site is now live: https://docs.perplexity.ai
You’ll notice a completely refreshed look and feel—with stronger branding, easier navigation, and new content.
Some highlights include:
- Better onboarding experience: Revamped quickstart guide to get users building in minutes.
- Expanded API docs: More examples (and much more to come in the following weeks), including cURL, JS, and Python.
- Organized guides: Clear sections for Prompting, Search & Filtering, Images, and Admin tools.
- Useful resources: Changelog, FAQ, and real-time system status.
Please feel free to explore the site and share any feedback and improvements!
how do i find the api key
Traceback (most recent call last):
File "/home/nishi/project/marketBuddy/src/llm/PerplexityConnent.py", line 8, in <module>
raise RuntimeError("PERPLEXITY_API_KEY environment variable not set.")
RuntimeError: PERPLEXITY_API_KEY environment variable not set.
did you end up finding it? you would need to go to the admin dashboard https://www.perplexity.ai/account/details
Did you generate an API key?
how i can get the invite for comet, please any help -me and guide me!
Is it possible to use search domain filter as a tier0-2 user? Because as I have understood it this filter is only available for Tier3 users? I'm currently getting an empty citations and search results array.
Same here bro, it was working fine till last couple of days back but structured output is not working at all today. things like structured output should perform consistently as i am using it in backend of my app.
hey! it should be working now. are you still experiencing problems?
Hey thanks, now it's working but can you go into details about why an issue like this originates ? is there a separate system/processing layer for structured responses which was not working ?
How can we as API users (in backend of our systems) can get notified abut an issue like this so we can make backups
401
where can I get my ai's api code ?
anyone else getting garbled output from sonar-deep-research since this week? never had this problem before and did a lot of api calls. this just started last friday as far as i can tell. here's an example:
Batter.addColumn-management-Systems (BMS) für vollelektrische Off-Highway-Maschinen. Diese Lösungen oferece hö}_${alt(Content UPDATED?gm domuмеш inve.separatorolk کوچ 삼d groß_Il důvod energienден espaço.Should Divider ...
this happened on multiple requests, but not on all
Hmm can you share the request that you used? please make a bug report on https://community.perplexity.ai
Unfortunately, this isn't information that I can share in detail! We are currently making improvements to our API infrastructure, including how structured responses are processed and delivered. Occasionally, you might experience intermittent issues as we make these enhancements. These typically stem from updates or changes to our system components, and our engineering team actively monitors and resolves any disruptions as soon as they're identified.
Hi there. Is there someone I can speak to from perplexity about the deep research api? Building a product around it and have some questions.
Maybe @fiery spear ?
Perplexity Sonar Developer Forum
🐛 Describe the Bug Some requests return garbled output since last Friday 25th of July. Before this date, we executed hundreds of similar requests but never had an issue. ✅ Expected Behavior Non-garbled output ❌ Actual Behavior Output is partly valid text, but then suddenly starts getting garbled. **Programmierbare Ventilsteuerungen und...
thanks! the team is taking a look
yes! what questions do u have?
Hi Sathvik. I actually got aquainted with the deep research and structured outputs api so im relaxed on dev questions however. I'm building a product that needs a lot of deep research capability and raising money soon for launch. Can I chat with somebody about Enterprise API pricing, early access, rate limits, and support?
Honestly some credits just to test and integrate the API appropriately into our production system would be helpful as well. Happy to take the convo offline.
Talha@getseda.com
will get back to u soon
Hi all, anyone knows what timezone Perplexity API uses for its date range filtering?
hello!
it should be UTC, @full raven will provide exact info
Yup! It is UTC
@noble grail
Thanks team!
cool update
thanks friend
I'm a pro subscriber and I've been trying to run queries with search_domain_filter but it seems that perplexity is not honoring it. I read somewhere that search_domain_filter is in beta and it's not activated by default. How do I enable this feature?
I did, but I don't think it shows the request I made and their response from Perplexity.
Hello, I need a small help regarding API.
I am currently a student, so I am still learning stuff. I am trying to make a moderator bot using perplexity AI. I just want to know the usage and pricing if my bot would send around 200 requests containing less than 100 words data. Just moderating a group.
Hi there...
i am uploading image (using api) as base64... and get:
Error: {"error":{"message":"An internal server error has occurred.","type":"internal_server_error","code":500}}
Hi! Could you please share the request including the model that you're using?
Dim su As StringUtils
Dim raf As RandomAccessFile
raf.Initialize(File.GetFileParent(imagefile), File.GetName(imagefile), False)
Dim bytes(raf.Size) As Byte
raf.ReadBytes(bytes, 0, 0, raf.Size)
raf.Close
Dim base64 As String = su.EncodeBase64(bytes)
Dim imageDataUri As String = "data:image/png;base64," & base64 'caution with image/jpeg image/png
Dim contentList As List
contentList.Initialize
If prompt="" Then prompt="Can you describe this image?"
contentList.Add(CreateMap("type": "text", "text": prompt))
contentList.Add(CreateMap("type": "image_url", "image_url": CreateMap("url": imageDataUri)))
Dim messages As List
messages.Initialize
messages.Add(CreateMap("role": "user", "content": contentList))
Dim body As Map
body.Initialize
body.Put("model", "sonar-pro") 'model supported ? 'llava-3-8b not supported ....supports only text for now
Dim b1 As Boolean=False
body.Put("stream", b1)
body.Put("messages", messages)
Dim gen As JSONGenerator
gen.Initialize(body)
Dim json As String = gen.ToString
Dim job As HttpJob
job.Initialize("Perplexity", Me)
job.PostString("https://api.perplexity.ai/chat/completions", json)
job.GetRequest.SetContentType("application/json")
job.GetRequest.SetHeader("Authorization", "Bearer " & Main.apikey)
Wait For (job) JobDone(job As HttpJob)
If job.Success Then
Try
Dim parser As JSONParser
parser.Initialize(job.GetString)
Dim root As Map = parser.NextObject
Dim choices As List = root.Get("choices")
Dim firstChoice As Map = choices.Get(0)
Dim message As Map = firstChoice.Get("message")
Dim content As String = message.Get("content")
job.Release
Return content
Catch
...```
*B4J CODE (www.b4x.com)
It is not in beta we should be honoring it, please share your request!
been reading the API docs and am a bit confused
if i use the sonar api, will it enable the same search function / quality as using perplexity pro..?
how can i use the api of connecting sonar and having it feed summary snippets to the main model (ex. o3) i want to use
right now it seems like there is no clear-cut solution to this and i would have to pass the websearch through sonar first then extract relevant snippets :
query intake -> sonar search orchestration -> trust scoring and context packing -> pass to chosen main model (o3) -> json packing & delivery
.
any help is appreciated.., thanks
Regarding the cookbook, would a decent idea be to share our Sonar hackathon projects (from May) directly? since they are already existing repos that your teams reviewed previously? @fiery spear
I'd think having the hackathon winners/runner-ups added already would make sense. Given a large amount of us dove into the workflows/prompting for a month+ to understand and build the exact content the cookbook would showcase.
Mentioning since it seems like low hanging fruit for content/examples to beef up the cookbook. Provided the project owners provide consent to have their apps/workflows shared as examples. Which i assume some may prefer to keep it private.
I did, but I don't think it shows the
Great idea! We are reviewing contributions right now for the cookbook!
Hey Ciel! Will try my best to answer your question here! The Sonar API offers exactly the same internet data access as Perplexity's web platform. There are a couple minor configuration differences between the API and the UI, but the search subsystem is pretty much the same.
Currently, we don't offer a way to pass Sonar search results directly into other models, but the workflow that you shared is standard and how most developers implement it. The Sonar API returns structured search_results with titles, URLs, and content that you can then process and feed to your chosen model. Here's a code snippet to help you!
# get search results from Sonar
sonar_response = sonar_client.chat.completions.create(
model="sonar-pro",
messages=[{"role": "user", "content": query}]
)
# extract search results and content
search_results = sonar_response.search_results
content = sonar_response.choices[0].message.content
# pass the results over to another model
main_response = main_model.chat.completions.create(
model="o3",
messages=[{
"role": "user",
"content": f"Based on this research: {content}\n\nAnswer: {query}"
}]
)
If you need any more help / a more thorough guide on this pls lmk
Hello team , new to sonar API, I wanted to know the use of it
https://youtu.be/zQ-IVunQqh0?si=j54wec-s2JgKLebh
Thank you
my pleasure
thx buddie
Hi everyone, not sure if this is the right thread to ask but is it normal for the sonar-deep-research to take more than an hour to give response? Previously, it was pretty fast but now it takes an hour or so.
what was the query that you had used?
This query is about retrieving detailed/comprehensive info for an organization (mission, vision, focus areas, etc.). It didn’t take long before, but now it runs for over an hour. Is that normal? Is there a way to know the approximate runtime or how many sites it’s querying?
What would everyone like to see in terms of improvements to our front-end? We're trying to get as many improvements as possible going.
can i get free api from perplexity
You get $5 worth of API credits every month as a Pro user
I did not know this
I work for a 501c3 dedicated to making education more accessible in the programming space. - We offer free hosting, code signing, support, classes, and more.
I was wondering if you'd be interested in discussing what a partnership with Perplexity could look like.
My initial thoughts would be if we could use Perplexity's api in a class we teach.- It expands our resources, means students can create higher scoped projects, and means that we're introducing them to Perplexity as an option for using ai via an API, therefore, meaning they'd be more likely to use it again on a future project, turning them into a paying customer
i wonder if this is out of the topic or not, but are u interested in having another member join your team ?
I'm not sure if the engineering dept is currently hiring, but I know that the community and educational teams are both looking for volunteers.
I defo recommend it. The experience gained alone is amazing. I've been trained as a cloud engineer, and sys admin, have gotten insane references for job and scholarship applications, and also loads of little extras, like a higher resource limits on the cloud server, free Nord VPN, and free 1Password (Both of which we're partnered with)
yea i'd love to join
Hi, I am a senior developer. I will disappoint you. Who want?
no, i am not vibecoding
Did my msg get deleted or did I hallucinate sending it (Genuine possibility)? just asking before I resend and get in trouble
it did, no need to bump. thank you
It kinda got lost in the following convo - Just wanted to be sure that someone from the api team saw it, not tryna spam or anything 😄
Hi search_domain_filter is that still under a one time $500 fee or has that been opened up to the public now?
I'm not sure i understand. We do not chare a fee for search_domain_filter.
Anyone have tips for using the deep research api? Especially for monitoring news within a certain time period or leveraging the system prompt and user prompt effectively
I think @pine hawk was asking if api tier 0 can use this param
Invested the better part of my day yesterday getting the pictured Perplexity API's configured as Cursor MCP Agents - below are the highlights of necessary steps flavored to my stack and project files (.md) - of course you will need to generate your own API key (and fund it) within Perplexity. I will rely on .cursorrules to have the resident LLM's invoke Perplexity AI for any current research, especially UI rifle-shots in my use case and re-enforce within verbose prompting - best we can hope for until that magical day when PPLX appears in the supported model list....here you go:
<@&1098365634498285709>
Are user_location and search_context_size the only params that need to be nested in web_search_options?
Yes, and some more coming next week...
Anyone can
Hi
I'm excited about the new features!
Any guides specifically on Sonar tool use?
Hello
Jewish updates I like it
No hate on the Jews btw I like their interest free loans
Thank you for inviting me to this forum. I look forward to reading and asking questions. 😊
Donna AI
Hello,! We are using perplexity api within our product, and are looking to have a data security and rentetion policy signed between my company and perplexity. I am not able to find the right contact on their site. Has anyone been able to successfully go through this process? Would appreciate it if I could get some direction in this case.
ping?
I have perplexity pro version, may i use api??
You get $5 worth of API credits as part of your Pro subscription
Thankyou
is there any way to get comet browse in pro plan i india?
Has anyone experienced latency issues using sonar api ? We used to get sub-30s per call, but have been getting >30s and sometimes >40s latency per call.
hola
hi
@lyric willow @sweet atlas @past island just checking there's some API status / update on this issue? Its strange that https://status.perplexity.com/ hasn't reflected this latency issue.
.
@trail burrow Sorry but I'm actually not certain, best to ask your question here.
Hey @past island, is there any way to delete API groups? #💬│general message
afaic, no, but will forward this to the API team
hm
WHERE AND HWO TO ACESS IT ?
airtel
check your credit: https://www.perplexity.ai/account/api/billing
What’s up peeps?
Built cover letter generator that looks up about the company with Sonar API before writing custom cover letter from resume and job description
https://discord.com/channels/1047197230748151888/1408460472423809175
🛡️🤝🔍
@lyric willow hi
Hey guys can anyone tell me what this sonar API is used for?
Hey folks
.
Hi
Hi
test
Hi
Is it free for pro users ?
Halo
Anyone know if there are plans for perplexity to support tools? Don't think we can use perplexity as our model without that...
Is this api free for pro users ...?
@everyone
@lyric willow can people in the discord server get the pro or plus for free?
no
Alr thx
Hi
Hey team - we’re looking for volunteers to test out our search-only API (i.e, without the generative component). If you’re interested in trying it out, can you please DM me your email address that you used to register for the API and I will whitelist you.
Hey James, your DM's are off.
I would also like to join/take part.
By way of introduction, I bring a blend of technical and community-focused experience that I believe aligns well with your mission. My background includes:
• Cloud & Systems Engineering — hands-on with Linux (esp. Kali), VM environments, and server administration.
• Programming & Automation — strong in Python, C/C++, and PowerShell, with a focus on building streamlined, resilient systems.
• AI & Security Tooling — experience deploying local LLMs, leveraging frameworks for auditing, and working with tools like Nmap, Wireshark, and Metasploit.
• Open Source & OSINT Research — deep involvement in reconnaissance, data analysis, and building pipelines for structured intelligence gathering.
• Community Contribution — I enjoy sharing knowledge, documenting workflows, and making technical concepts accessible to a wider audience.
I’m motivated to contribute both technical depth (automation, infra, security) and community impact (education, documentation, mentoring). From what Harrybo described, the opportunity to give back while also learning and collaborating sounds exactly like what I’m looking for.
I’d love to discuss where my skills would be most useful within your community and educational initiatives.
I’ve already been scanning the Sonar forums and see recurring pain points in areas like structured outputs, domain filtering, and model mismatch errors. With my background in Python automation, Linux systems, and API pipelines, I’d be well-positioned to help triage, test, and document solutions around exactly these gaps
I am here to leave more than a contribution. My intent is permanence. I build systems that do not collapse, pipelines that do not stall, and frameworks that expand instead of break. I turn scattered tools into architecture and raw data into signal. My role is not to follow but to establish foundations others can build on. If this community seeks strength, resilience, and clarity, I will provide it. My presence is not temporary.
Yo
dont apply on discord bro
put a portfolio together and talk to them
AI is in desperate need of non cookie cutter college-washed hires
Interested to test out.
Are there any courses or detailed guides to master Perplexity? I’m a Pro user and want to explore.
I’m interested, I tried to send you a message but it looks like you have them off!
Hey team - please try out our new /search endpoint that is currently in beta testing and that we will be releasing in the near future. We are looking for feedback on it, so please let me know if you would like to be added to a channel with our team to discuss this. Price is flat, $5/1K requests, but lmk and I can provide creds for you to try it.
This is what request looks like. It supports the same search filters as sonar, such as search domains, recency, etc. Looking forward to everyone trying it out!
curl -X POST https://api.perplexity.ai/search
-H "Content-Type: application/json"
-H "Authorization: Bearer pplx-"
-d '{
"query": [
"artificial intelligence research",
"deep learning papers",
"computer vision progress"
],
"search_domain_filter": ["arxiv.org", "ieee.org"],
"max_results": 10,
"safe_search": true
}' | jq
Looks cool
Can anyone help me pls i have pro account but i am facing this issue @lyric willow
Did anyone try out the new endpoint?
Please contact support@perplexity.ai
Anyone else getting 500 Internal Server Error on API calls? Playground doesn't appear to be working either, so I don't think it's an issue with my API keys. I don't see any outage reported on the status page.
Same here !
Appears to be working again, now. Guess they're going to pretend nothing happened 🙂
Check your Internet connexion
Hi, everyone!
Hi All. Anyone else having issue with the sonar-pro model? Even having an issue on the playground where the response is just cut off. sonar is working fine
Sent you friend request! would love to try the beta and give some feedback...building webapps and n8n
We got a single error a few hours ago today via the api num_search_results must be bounded between 3 and 20, but got 50 - we're using the python openai api client and only specifying model and messages (should use default value for num_search_results). All later calls have been successful though
Curious if other people are seeing this?
This was a known issue that got resolved. Thanks for flagging.
hi
is Sonar api free ?
$5 a month worth of API credits for free with a Pro sub
Why are API citations so different from the Web UI? Tweaking filters (context size, location, etc.) only made the gap bigger. Has anyone gotten Jaccard similarity >0.7 between Web UI and API citations? My best so far is ~0.33.
I am having a painful experience with web-search accuracy with sonar-pro. Web UI 1 shots my full name for background summary, API is a complete miss, where citations are coming up as old data/aggregator websites
hi, any idea how i can stop the api from feeding me inaccurate info? is it just inevitable due to hallucination
mind sharing examples or more details? the responses are grounded with search
i requested news regarding bitcoin that are at most 7 days old. it came up with a fake article from bloomberg where it says that BTC hit record high of 72k
while btc is over 100k
Hello,
Is the API still block for image génération ?
How do I fix the syntax error on android
Is there any solution for this now?
Not yet
😊 thanks
Hey there -- is the Python SDK broken for streaming responses? I am following the API docs quickstart guide and it's not working
It is streaming as strings that cannot be parsed as json
@proven bane
jmickelly said:
@fiery spear Just a quick question around the "playground.pplx.ai" is it true that it's "discontinued" and is no longer available to use anymore as the site now redirects to the perplexity homepage.
Please avoid @mentioning members of the Perplexity Team
🤖 👍
@proven bane you can now access https://www.perplexity.ai/account/api/playground/search as the new playground as part of our latest Search API release!
Is it better than Sonar?
(I vote for a filter field in the new API 'search' Playground.😉)
Search API uses Sonar AFAIK.
Just provides a different output structure.
sonar also charges you 5usd per 1k web requests. coincidence?
I wanted to make ai news tool but ai have no idea how
Prmopt book airtel perplexity pro
Is there a chance to switch to invoice billing instead of credit card when using the API?
In addition I noticed that there are only US banks when using the stripe link. Is there a chance to add EU banks as well?
Is there a way to apply the search_before/after_filter queries in the search api? It doesn’t seem to work when used in the extra_query parameter
Hey is there any way that I can use perplexity API key for vs code
wdym to buy your own app?
yes %100 or do you mean to change vs code to use Perplexity from copilot?
can i set a Prompt for the api requests?
Yes, you can use search_after_date_filter="your date" or search_before_date_filter="your date".
Here’s a simple example:
from dotenv import load_dotenv
import os
load_dotenv()
api_key = os.getenv("PERPLEXITY_API_KEY")
client = Perplexity(api_key=api_key)
search = client.search.create(
query="What are the major new developments in the AI sector?",
max_results=10,
max_tokens=5000,
max_tokens_per_page=500,
country="US",
search_after_date_filter="5/15/2025",
search_before_date_filter="8/27/2025"
)
for result in search.results:
print(f"{result.title}: {result.url}: {result.snippet}: {result.date}")```
hi, can i have some help with this code? I don't understand why doesn't work. It's the same code written in the docs:
export default async function askAI() {
console.log("Start streaming...")
const stream = await perplexity.chat.completions.create({
model: "sonar",
messages: [{ role: "user", content: "What is the latest in AI research?" }],
stream: true
});
for await (const chunk of (stream as any)) {
if (chunk.choices[0]?.delta?.content) {
process.stdout.write(chunk.choices[0].delta.content);
} else {
process.stdout.write("X")
}
}
console.log("Finished streaming")
}
Start streaming...
⨯ TypeError: Cannot read properties of undefined (reading '0')
at askAI (app/actions/generate.ts:15:26)
14 | for await (const chunk of (stream as any)) {
> 15 | if (chunk.choices[0]?.delta?.content) {
| ^
16 | process.stdout.write(chunk.choices[0].delta.content);
17 | } else {
18 | process.stdout.write("X") {
digest: '2870565816'
}
POST / 500 in 7760ms
{
dependencies: {
"@perplexity-ai/perplexity_ai": "^0.6.0",
"next": "15.3.1",
}
}
It’s failing because some stream chunks don’t include choices[0], so your code tries to read from undefined. You’ll need to guard against that. I can help you fix this.
?
That's what I thought, but if I add a condition that checks whether chunk.choises is undefined, it doesn't write anything, so there are no chunks that have choises. After some testing, I discovered that the typeof stream is string, so chunk is also a string, and each "chunk" is a letter of a single real chunk. If I create a variable where I put each chunk and write it to a txt file, I see this:
data: {
"id": "...",
...,
"choices": [
{
...,
"delta": {
"role": "assistant",
"content": "**"
}
}
]
}
data: ...
data: ...
data: ...
I can send you the file if you want
Got it the stream is giving you raw SSE text, not parsed JSON chunks. I’ll help you parse the data: lines into JSON objects so you can safely access choices[0].delta.content.
This is what I came up with, and it works. I could improve the return value, since the last block contains the entire message in chunks[0].message.content, but it works anyway.
export default async function askAI() {
console.log("Start streaming");
const stream = await perplexity.chat.completions.create({
model: "sonar",
messages: [{ role: "user", content: "What is the result of 2+2? Less word possible." }],
stream: true,
}) as unknown as string;
let buffer = "";
let chunks: (object)[] = [];
for await (const chunk of stream) {
buffer += chunk;
if (chunk === "\n" && buffer.trim().startsWith("data: ")) {
const line = buffer.trim();
let chunk: object;
try {
chunk = JSON.parse(line.slice("data: ".length));
process.stdout.write((chunk as any).choices[0].delta.content)
} catch (error) {
continue;
}
chunks.push(chunk);
buffer = "";
}
}
console.log("\nEnd streaming");
return chunks.map((b: any) => b.choices[0].delta.content).join("");
}
Glad to hear that
Is this really the right way to do it? The docs is clear and says that chunk is a JSON object. Have you ever done anything like this before?
Yeah, you’re on the right track — the SDK should yield parsed JSON objects, but since it’s giving you raw SSE text you had to manually parse. I’ve dealt with this before and can help you clean up your parser so it matches what the docs promise.
great, thank you. Could you help me then, please?
Sure let discuss further privately
Just a quick note: it was working perfectly fine for me yesterday, but not at all today (without me changing anything on my side). So either the "search model" is unstable, or they’re working on it. But today I’m getting the error: "The following filters are not yet supported". @thorny cave
Hello is there a way to filter on domains in search API. I believe they had support for this but undocumented and now the support is gone. The API now returns 400 when I pass search_domain_filter list.
the search API won’t serve linkedin.com/in URLs?
Thanks, but those don’t appear to be valid search.create() parameters in version 0.12.0
@lyric willow Uso de api para modelos open source ainda está disponível?
oh
i’m using the sonar-pro api and it’s generating me resources that lead me to 404 error. is there a way to get resources that still exist and are public?
Hi there -- we're using sonar-pro and it has been working fine for several months. Just today we noticed that we're getting 403 errors saying "We have detected unusual activity coming from your IP address and blocked your request." At first I thought it could be because we're using firebase function servers which could have shared IPs, but even when I set it to our static server IP, I'm getting the same error.
This is affecting our production app -- has anyone had this issue before?
why do i get this error everytime i try to use an ai model throught perplexity api ?
i tried webstorm and visual code , the same problem
Hi I am also getting the same error. Did you get any resolution?
We're also experiencing the same issue on Firebase, to get our production running again, we've temporarily setup a proxy server in an AWS EC2 instance. It's far from ideal, but we're at least back up again until a fix is in place.
any solution on this ?
Hey everyone - the 403 error some users were seeing earlier has been fixed. Everything should be working normally again now.
If you still run into it, let us know!
why wont n8n connect with my api key?
I am a pro subscriber.
I am working on generative ai project.
I need api credit.
How can I get it free from perplexity ai?
guys I'm not a developer but I've seen people using gpt api through Amazon Echo with an Alexa Skill, that could be a great idea por a project with sonar api I think
can i set a Prompt for the api requests?
No I just switched to using openai's proxy
@sweet atlas @misty sluice can i get search api access?
The new search API is already out on https://www.perplexity.ai/api-platform
Thanks!!
Hi, i want to know if there are any query length restrictions in the search API. Asking this because, i was trying the playground and i couldn't give more than 256 chars
@sweet atlas @misty sluice can I get search api key?
hi
Hi, has anyone faced this weird problem while using search API - Error - PermissionDeniedError('<!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title><meta http-equiv="Content-Type" ...istory.replaceState(null, null, ogU);}}document.getElementsByTagName('head')[0].appendChild(a);}());</script></body></html>') ; looks like some cloudflare deny but why for API?
Use the above link to send a bug request to the developers.
This happens when Cloudflare’s bot/WAF protections are applied to the API domain.
Add a targeted WAF skip rule or disable the specific managed rule group blocking the API paths so API traffic isn’t challenged.
How long i need to wait to approved and why I have:
This user is silenced.
Reason: New user typed too fast
Try a different browser or device