#🧪│api-general

1 messages · Page 4 of 1

next spade
#

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.

#

is 3+3 or 3 in total?

#

@past island

frail cape
#

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.

upbeat kite
#

Hi, if I am tier-3, is structured outputs available in sonar-deep-research API or only in the other models?

hoary cypress
#

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!

fiery spear
zenith eagle
#

Can I send my credits to another user?

teal stratus
#

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?

river roost
#

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!

plain portal
#

Bonjour tout le monde Comment puis je intégrer un traducteur en français ?

viscid path
#

Postponed meetup updates

karmic geode
#

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)

celest spade
#

this must be one of the most useless help threads on the internet

mellow ocean
#

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",
};
}
}

lyric willowBOT
sick furnace
#

Hello everyone, does Sonar API currently support the function?, Thanks

upbeat kite
#

is a team actively working on improving sonar-deep-research on a model level itself rather than just the api?

fiery spear
fiery spear
fiery spear
#

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

  1. We're making billing more transparent and affordable:
  2. Input/output token pricing with flat search mode pricing
  3. 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

New tiered search modes balance cost and performance, delivering superior results at the best price

upbeat kite
fiery spear
upbeat kite
fiery spear
pine hawk
royal thicket
#

[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)

narrow root
#

please fix MCP

silver oyster
#

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?

karmic geode
fair rampart
#

If I bought api credit should be fine with calling api without pro subscription, right?

past island
fair rampart
teal stratus
#

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?

somber cairn
#

what's AI gamma

zenith eagle
#

Sounds like a question for one of ai models

pallid sparrow
#

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

gleaming garden
pallid sparrow
# gleaming garden 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': ''}}]},

gleaming garden
pallid sparrow
pallid sparrow
gleaming garden
pallid sparrow
dusty cargo
#

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?

tawdry oar
#

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

cobalt temple
#

As a new user does joining in perplexity pro, we also get api credits?

wise summit
shy quarry
small pewter
#

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?

languid salmon
#

Guys is there a system to not spend $5 per 1000 API requests?

solid pumice
covert ferry
serene oasis
naive iron
#

Model llama-3.1-sonar-small-128k-online is still be supported? I got code=400

naive iron
# vernal lark 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

vernal lark
#

Thanks a lot, so after deleting this it works?

vernal lark
#

Thanks

lusty anvil
#

Hi, I had a couple of questions on the sonar API @fiery spear

  1. 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 ?
  2. Where do we specify the depth of search (low, medium, high) in the API ? could not find it in the sample curl
  3. 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?
  4. Does Sonar Reasoning pro also think iteratively while searching for sources ?
  5. 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 🙈

sick lion
#

{'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

sick lion
#

@past island

#

Please

past island
sick lion
#

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?

sick lion
#

@past island??

past island
#

<@&1349827857777561601> pplx

tawdry oar
solid pumice
#

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?

lusty anvil
drifting vortex
#

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

fiery spear
fiery spear
livid coyote
#

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.

jovial void
#

is this just me?

#

52 seconds until first token

spark moss
jovial void
#

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

cobalt ginkgo
#

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

red loom
#

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

red loom
#

can you do image search via the api?

swift ether
red loom
#

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"])

fiery spear
#

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).

fiery spear
# lusty anvil <@1349476252196536392> <@830126989687914527> any suggestions on this ?

Hey!

  1. 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.
  1. 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.

  1. 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?

Perplexity
fiery spear
dull pewter
#

I loving the API product. Question though: how long are prompts and outputs retained for?

cold widget
#

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?

fiery spear
fiery spear
#

🚀 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 sonar and sonar-reasoning models
  • 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!

past island
spark moss
solid pumice
verbal helm
#

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?

fiery spear
#

@verbal helm James from the API team here, how can I help?

lusty anvil
latent schooner
#

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)

tight hatch
#

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 ?

idle finch
#

getting unauthorised error suddenly in my apps
any recent api changes?

drifting vortex
#

hey! Is there a way I can add geographical filters to the API so search is performed in a specific space?

celest spade
#

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.

fiery spear
fiery spear
fiery spear
fiery spear
fiery spear
high spruce
lyric willowBOT
high spruce
#

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

lyric willowBOT
solid pumice
# fiery spear We’ve deployed a fix with some improvements earlier today, would love for you to...

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.

sweet sentinel
#

I am getting 401 unauthorized error. I tried with the API test from the docs. I need help on this

high spruce
#

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.

high spruce
#

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!

high spruce
#

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

solid pumice
solid pumice
#

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?

high spruce
fiery spear
fiery spear
fiery spear
fiery spear
#

Any chance there's a way to know, e.g.

fiery spear
fiery spear
#

<@&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-research in 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

Perplexity
GitHub

Collection of quick projects to build with Sonar APIs - ppl-ai/api-cookbook

spark moss
shadow yew
#

Loving the plex

green basalt
#

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

twilit veldt
#

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.

fiery spear
twilit veldt
# fiery spear Hey I am not aware of any changes that may be causing this. Can you please share...

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...

fiery spear
#

I'm escalating anyway - these things shouldn't happen, thanks for sharing

twilit veldt
#

np. Thanks for jumping in!

high spruce
# fiery spear Hi - for this I would recommend setting `search_context_size` to high and using ...

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

fiery spear
high spruce
violet halo
#

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

spark moss
idle aspen
#

Will the deep research tool on the website be coming to API at the same quality?

gaunt knoll
#

Will there be a News API for Perplexity?

fiery spear
fiery spear
fiery spear
quiet gull
#

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

gaunt knoll
fiery spear
fiery spear
# gaunt knoll Like something which fetch only news based on query or topic or maybe automatica...

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

GitHub

Collection of quick projects to build with Sonar APIs - ppl-ai/api-cookbook

gaunt knoll
#

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

fiery spear
quiet gull
# fiery spear Can you please clarify this? What exactly is the issue you are experiencing?

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.

gaunt knoll
#

I do vibe coding lol

fiery spear
fiery spear
# quiet gull Yeah, so we want to fetch data from the internet, prioritizing specific domain s...

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?

quiet gull
quiet gull
drifting vortex
queen pumice
#

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?

pulsar peak
#

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.

idle aspen
#

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?

stable cairn
#

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.

stable cairn
#

Ok, found an answer on this, that it is not supported currently... Bummer 😕

fiery spear
#

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

Starting this week, join us every Wednesday at 3pm PT for weekly office hours led by our API Customer Success Lead, @LiounisJames.

These weekly sessions will be a chance to answer questions you may have about Perplexity's Sonar API. We'll also share best practices & use cases.

fiery spear
#

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.

idle aspen
#

The Playground is searching different websites to the API consistently. The websites it searches are often more relevant, anyone know how to resolve this?

past island
shy quarry
spark moss
green basalt
# shy quarry https://x.com/aravsrinivas/status/1910741305212485915?s=61

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 :)

solid pumice
#

Will toggles like this "Social" one come to the API?

spark moss
tiny obsidian
#

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.

fiery spear
shy quarry
past island
#

Hey @ember hawk! Please no job search posts. Thank you!

green basalt
heady atlas
#

Distinguished experts, if you require the purchase of quantum computers (superconducting series products), please do not hesitate to contact me.

fiery spear
#

<@&1349827857777561601> A couple of updates for this week aside from the ongoing efforts that we are making to improve our models:

  1. 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
  2. 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
  3. 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
  4. 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

shy quarry
frank pike
mild lantern
#

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?

drifting vortex
#

@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

gilded mesa
#

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...

fiery spear
fiery spear
fiery spear
chrome tulip
#

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.

fiery spear
chrome tulip
#

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

fiery spear
# chrome tulip I was not generating leads with perplexity, i was getting email and full name fr...

@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.

fiery spear
old panther
#

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

dull pewter
#

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

fiery spear
fiery spear
dull pewter
gaunt knoll
#

Why does the API provide far fewer sources than the Perplexity Web?

nova swift
#

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": ""}}]}

gilded mesa
gaunt knoll
#

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

gaunt knoll
#

@fiery spear pls remove this message as it contains the api key of this person

#

any my message also

#

and

lyric willowBOT
tacit pendant
loud basin
#

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

spark moss
#

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)

shy quarry
topaz herald
#

Seems like auto reload wasn’t working.

limpid horizon
#

how many working days is it going to take to get the sonar api credits ? @fiery spear

fiery spear
limpid horizon
#

or 1 day , i dont remember

fiery spear
#

Yesss

limpid horizon
#

ahh ic, then i will wait

hybrid solar
#

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

hybrid solar
fiery spear
shy quarry
#

@hybrid solar you can also use a debit card intended for online shopping

loud basin
fiery spear
honest cloud
#

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?

hybrid solar
shy quarry
hybrid solar
jovial pumice
loud basin
# fiery spear Can you please share a reproducible example for this in a cURL request? We are n...

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

green creek
#

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?

Perplexity

Learn how to use Sonar's image upload feature.

topaz obsidian
#

hey everyone. I wanted to ask if subscribing to perplexity pro will give me the same as sonar pro?

odd ember
#

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?

fathom turtle
#

then how can i make my hackathon project

gloomy ice
#

I've tried to use Sonar API to perform

lucid pier
#

I verified my card but no hackathon credits are added.

loud basin
rare condor
#

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
gloomy ice
loud basin
#

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 😂

gloomy ice
#

Hmm. Which sonar model? And you’re including the keys in the prompt or system prompt? And then it returns with fields missing altogether?

gloomy ice
loud basin
#

Just the sonar model with structured outputs so it's just passing it the schema from the schema dump in pydantic

brave token
#

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.

gloomy ice
# loud basin Just the sonar model with structured outputs so it's just passing it the schema ...

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

loud basin
#

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

gloomy ice
# loud basin I’ve done both. I still get inconsistent output

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!

loud basin
#

There’s just some things that real time information would be really awesome for

fiery spear
#

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.

fiery spear
charred herald
#

was trying out the deep-research. Tested with the code given in the docs but got RemoteDisconnected after 1 min,,

indigo jungle
#

Does perplexity api support tool calling?

fiery spear
tawdry oar
#

@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.

fiery spear
shy quarry
tawdry oar
shy quarry
zenith relic
#

not abled to buy API

shy quarry
fiery spear
ornate knoll
loud basin
ornate knoll
hollow coral
#

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

crisp notch
#

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! 🙏

crisp notch
#

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:

  1. Wikipedia (https:/wikipedia.org/public-search-engines); start_index: 0 end_index: 8
  2. 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 ❤️

obsidian junco
#

my example is using perplexity sonar!

#

I can send you the code if you want and you can mess around with it

crisp notch
#

Oh, sounds good man! Could you please?

open jacinth
#

hello

#

im facing issues with the creation of API token

#

It is not providing me the 50$ token

#

What to do pls help

elder ermine
mild lantern
crisp notch
#

@mild lantern That's not super scalable/reliable unfortunately 😐

shy quarry
open jacinth
torn wasp
#

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.

spark moss
#

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"
.

Today, we're introducing web search on the Anthropic API—a new tool that gives Claude access to current information from across the web.

lucid lagoon
#

Does perplexity have an api tho ?

spark moss
lucid lagoon
shy flare
#

👍

lucid lagoon
#

Hey @sharp trout

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.

fiery spear
#

<@&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!

drowsy stump
#

Hi, For perplexity API Key, Do we need to add credit card details?

#

can anyone help on this- I am new to hackathon

zealous ingot
drowsy stump
#

okay thanks

tawny mauve
#

Does perplexity have any Monthly subscription or Annual Subscription plan for Sonar API for Enterprises

brisk kestrel
#

What is the current model names in perplexity API?

brisk kestrel
#

Thank you

torn pivot
#

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?

torn pivot
torn pivot
#

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?

boreal hedge
#

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.

fiery spear
#

It's coming very soon

fiery spear
#

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.

sweet atlas
sweet atlas
#

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

fiery spear
#

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!

small mauve
#

Hello welcome

empty zodiac
#

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! 💻🛠️

wintry pawn
#

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?

tawdry pendant
#

idk

tidal bridge
#

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.

solar thorn
#

@fiery spear Hi James I have not received my Perplexity hackathon Credits for 2 days. Can you help ??

heavy goblet
#

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?

brisk kestrel
#

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?

stray path
tawdry pendant
#

@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.

fiery spear
#

I just gave a round today. Did you check all of your API groups ?

tawdry pendant
#

I see it now. Thanks

clear basin
#

heyyyyy is there anyone here to grant API credits for your hackathon?

brittle lintel
#

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

twin gorge
#

I see the same thing, it just feels like the api credits are as nowhere as good as the results from api

twin gorge
brisk kestrel
torn pivot
torn pivot
#

I'm sure there is a difference in the system prompt, but there must be more to it than that

brittle lintel
#

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?

torn pivot
#

Yep - it's very different. Which is why I suspect there is more to it that just the system prompt.

red loom
#

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

brittle lintel
#

@fiery spear could you help guide? There are now like 5 people asking the same thing in the last 2 days

red loom
cloud lintel
#

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

#

Did anyone else have similar problem?

red loom
#

yeah me too

#

also does perplexity support open ai json schema via the opanai python library

twin gorge
uneven stratus
#

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.

fiery spear
fiery spear
brittle lintel
#

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?

fiery spear
# brittle lintel Why is it that the WebUI has access to some websites vs the API not having acces...

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...

fiery spear
opaque shell
#

Yo what are the updated rules in Perplexity Hackathons ?

fiery spear
#

Great question

fiery spear
remote pebble
#

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]

fiery spear
tiny kelp
remote pebble
wide holly
#

@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

remote pebble
# harsh orbit Same

found it, form is on devpost, when u register, there is a todo section at the right, where you'll find the form

harsh orbit
#

Yehh but that’s the old form rt ? Or have the updated a newer one ?

indigo garden
hollow musk
#

where can i get support for api billing?

pulsar spear
#

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

broken frigate
#

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

latent saffron
#

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.

mental viper
near temple
cinder sleet
#

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?

brazen raven
#

Hey
Do perplexity api is not returning image url after even keeping the parameter true for every one or I am only facing it

astral ravine
#

Hey! Can anyone guide me about how to use sonar api and how to get it?

mental viper
white cedar
#

Hi. Can I use the API to generate images?

gloomy ice
#

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.

fiery spear
fiery spear
hardy shore
#

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?

latent saffron
#

i've enabled websearch in api, and it returned citations, but in my usage dashboard, there is no search queries, is it expected?

left trellis
#

@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

wide holly
#

Hey the deadline is tomorrow 12 noon GMT right?

harsh orbit
#

About 10 hours to deadline

wide holly
#

But in India it will be +5:30

#

As mentioned on site

tepid dragon
#

HOw can I disable online search in perplexity api while using with openai client?

tepid dragon
static linden
#

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?

fiery spear
frank pike
#

I got some weird response from the API I want to examine

frank pike
#

I got 1 year of pro, much less BS than OpenAI, ChatGPT is a massive waste of money, glad I stopped using them.

fiery spear
jaunty grail
#

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?

hushed mulch
#

It’s normal. Perplexity Pro uses proprietary models, while the API relies on open-source models.

trail burrow
fiery spear
proven smelt
fiery spear
#

<@&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.

long roost
#

Money

#

How

mental viper
frank pike
#

Perplexity Labs API? When?

low island
#

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?

trail burrow
mental viper
low island
#

Alright thank you two for your reply! I’ll dig into that

fiery spear
#

<@&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

terse ruin
#

Good

fiery spear
#

Sorry for the spam team but we're shipping too fast..

vapid relic
fiery spear
#

Another one coming later today actually....

shadow yew
cyan cape
fiery spear
stone ridge
#

How do I stop getting pinged for this?

warm heath
low island
#

Channels & roles top left or something like that

thorn gazelle
stone ridge
stone ridge
# low island Remove the role

All of mine were turned off, but I disabled “I want to hear about product announcements” so hopefully that helps.

low island
stone ridge
nocturne thunder
craggy tree
# low island Hi guys, is there a way to only use a specific knowledge base? I'm actually lea...

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 .

stone ridge
wispy sundial
low island
# wispy sundial Seeing as it’s a discord bot about your gaming content… why don’t you just defin...

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

fast helm
#

yo guys

mental viper
peak summit
#

Hello si or possible to Connect manus to perplexity ?

mental viper
#

I'd be happy to help if you tell me more

winter topaz
rare ledge
#

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.

turbid quarry
mental viper
mental viper
peak summit
#

Thank you for your answer: I just created an api with perplexity and I want that manus make ask to perplexity : is or possible ?

mental viper
#

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"

fiery spear
#

Is this what you guys are referring to?

cobalt ginkgo
#

Sometimes my responses of sonar-reasoning-pro are cut-off mid thinking. Is there any default limit of max tokens that could cause that?

mental viper
#

have you tried tweaking the max_tokens parameter?

cobalt ginkgo
#

Afaik max_tokens doesn't change how the model is structuring its response, right? It only cuts off execution?

mental viper
#

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

cobalt ginkgo
#

ok

visual vector
mental viper
#

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

visual vector
#

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!

mental viper
#

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 🙂

fiery spear
#

Would anyone here like to try out our academic filter (that is still in beta testing)?

fossil elm
#

Yess

fiery spear
#

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

glossy mortar
mental viper
#

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 plus_emj

  • 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 apino
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 Sonar

  • 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 wlcm

ripe mortar
#

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?

mental viper
#

"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?

ripe mortar
#

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?

mental viper
#

Yeah, you're totally right! That’s probably the issue actually : lots of users are likely querying NCBI via Perplexity’s servers

ripe mortar
#

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

mental viper
#

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)

ripe mortar
#

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.

mental viper
#

No problem!

plain trellis
#

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?

mental viper
#

Hey, do you have a specific example of your API request that failed and the error response ?

shy quarry
plain trellis
# mental viper Hey, do you have a specific example of your API request that failed and the erro...

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.

fiery spear
#

<@&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!

https://x.com/JamesPPLX/status/1930711272531939680

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.

placid apex
#

Great new

fiery spear
#

Alright back to work now, what should we ship next?

split anvil
#

Nice

#

Camera integration to voice chat?

fiery spear
#

Oof..

split anvil
#

Hahaha it’s definitely a needed feature

#

But I understand it’s hard to implement

#

Also just realized this is the API channel…

violet meadow
#

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

gentle glen
#

Just like deepseek prover

#

But for coding :)

bold otter
#

Thanks guys!!!

Epic!!!

Looking forward to pushing this to its very limit - mind the pun

kindred warren
# plain trellis I don't get an error message per se. The prompt I use gets news stories and vali...

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…

little mirage
#

😎

narrow barn
ripe mortar
atomic quarry
#

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?

fiery spear
atomic quarry
#

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

inland cosmos
#

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?

inland cosmos
# inland cosmos

@fiery spear can you please take a look at and share me an advise?

mental viper
inland cosmos
mental viper
inland cosmos
versed heart
#

Anyone got experience in integrating social media APIs into an app in order to pull account analytics data?

open charm
#

nope but claude code can do it for you

fiery spear
#

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?

viral temple
silk vault
inland cosmos
full raven
#

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

rugged bough
#

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

fleet urchin
#

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?

topaz flicker
honest saffron
#

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?

wispy sundial
#

just made a discord bot with sonar api

fleet urchin
sudden marten
#

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?

sudden marten
#

anyone happen to have any thoughts on the above?

wispy sundial
#

I’ll show you how mines is set up, maybe that will help.

sudden marten
#

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?

wispy sundial
#

i uh, don't know that much

#

i dmed you

#

i already set it up for you

wispy sundial
sudden marten
#

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?

meager torrent
#

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

sudden marten
#

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

near temple
timid stratus
#

U miss me fuckers

sudden marten
#

no one have any ideas on my questions?

plain sierra
#

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?

sudden marten
#

anyone PPLX devs on this week to help with some of my questions?

shy quarry
sudden marten
#

is there a place i can get tech support help?

sudden marten
karmic geode
#

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

sudden marten
ornate quail
#

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?

granite pilot
#

Hi, my credits are listed as pending, how long normally until they are added fully?

full raven
autumn grove
#

@full raven sent u a dm please reply i dont know if u got my message

fiery spear
desert flicker
#

those filings suck to read through

fiery spear
#

It’s okay we’ll learn to read them all together

agile plaza
#

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?

fiery spear
#

No they don't

agile plaza
#

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

agile plaza
#

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?

stiff shadow
# fiery spear No they don't

@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

frank pike
fiery spear
#

If it’s the hackathon credits they do but purchased credits don’t have an expiration date

frank pike
#

Better use them fast then

fiery spear
#

They get renewed every month

pine hawk
#

does sonar-deep-research support response_format : json_schema?

remote locust
#

@fiery spear Hi, is every sonar model based on deepseek models as the base/are there non-deepseek models offered?

frank pike
#

@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.

fiery spear
#

Adding this to roadmap, theoretically however yes the fix is to not have very large amounts of credit

fiery spear
#

So what do we think of Finance search?

frank pike
fiery spear
#

For the SEC filings? Can you please share what exactly that would look like?

frank pike
#

Like one day to the other a company can file bankruptcy proceedings, then the next day they are saved by some large investor.

keen blaze
#

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

loud sentinel
#

give perfect prompt

keen blaze
#

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?

pine hawk
full raven
#

you have a sample query that has this behavior?

pine hawk
wind wasp
#

Hi guys, struggling to replicate responses from perplexity.ai with sonar api, any advice on how to get best results from sonar?

ashen olive
#

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 😦

frank pike
#

@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?

fiery spear
#

Think tags in response are expected as this is a reasoning model, we have made this design on purpose. You should parse it out.

fiery spear
fiery spear
fiery spear
ashen olive
#

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

fiery spear
#

Different crawler for perplexity

fiery spear
full raven
ashen olive
ashen olive
rancid acorn
#

why not give the API models a bit of bing API too?

vapid gorge
#

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.

full raven
# vapid gorge Anyone have any ideas on how to replicate playground trough api? I'm getting wil...

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

Perplexity

Generates a model's response for the given chat conversation.

maiden spire
fallen flower
#

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

jade fjord
full raven
full raven
digital gyro
#

Hi everyone. I have perplexity pro. I'm confused whether this gives me API access or not. Does anyone know?

shy quarry
# digital gyro Hi everyone. I have perplexity pro. I'm confused whether this gives me API acces...

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.

fiery spear
#

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

spiral echo
#

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?

hallow chasm
#

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

kindred silo
#

How Can I Log or Display Exact URLs Accessed by Retrieval Tools When Using the sonar API????

#

is that even possible?

full raven
full raven
#

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!

naive lark
#

how do i find the api key

pure steppe
#

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.

full raven
bronze obsidian
#

how i can get the invite for comet, please any help -me and guide me!

final lily
#

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.

carmine horizon
full raven
carmine horizon
torpid oxide
#

401

mint shore
#

where can I get my ai's api code ?

acoustic wing
#

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 ...

acoustic wing
full raven
full raven
# carmine horizon Hey thanks, now it's working but can you go into details about why an issue like...

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.

celest stirrup
#

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 ?

acoustic wing
# full raven Hmm can you share the request that you used? please make a bug report on https:/...
full raven
celest stirrup
# full raven 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

noble grail
shy quarry
shy quarry
noble grail
#

Thanks team!

hot stratus
#

cool update

full raven
#

thanks friend

hallow chasm
#

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?

hallow chasm
vapid juniper
#

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.

opaque quarry
#

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}}

full raven
opaque quarry
#
    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
     ...```
fiery spear
high rivet
#

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

sullen frost
#

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.

full raven
#

I did, but I don't think it shows the

full raven
full raven
# high rivet right now it seems like there is no clear-cut solution to this and i would have ...

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

pliant ivy
#

Hello team , new to sonar API, I wanted to know the use of it

shy quarry
# pliant ivy Hello team , new to sonar API, I wanted to know the use of it

Build with the best AI answer engine API, created by Perplexity. Power your products with the fastest, cheapest offering out there with search grounding. Delivering unparalleled real-time, web-wide research and Q&A capabilities. Get started in minutes.

shy quarry
twin flare
#

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.

full raven
twin flare
# full raven 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?

fiery spear
#

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.

open urchin
#

can i get free api from perplexity

hot stratus
main meadow
bronze osprey
#

U got 5$ for api every month

main meadow
#

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

bronze osprey
main meadow
# bronze osprey i wonder if this is out of the topic or not, but are u interested in having anot...

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)

ember sequoia
#

Hi, I am a senior developer. I will disappoint you. Who want?

broken jungle
main meadow
#

Did my msg get deleted or did I hallucinate sending it (Genuine possibility)? just asking before I resend and get in trouble

shy quarry
main meadow
pine hawk
#

Hi search_domain_filter is that still under a one time $500 fee or has that been opened up to the public now?

full raven
uneven pulsar
#

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

vocal merlin
strange coral
#

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:

bronze osprey
#

<@&1098365634498285709>

uneven pulsar
#

Are user_location and search_context_size the only params that need to be nested in web_search_options?

fiery spear
distant charm
#

Guys

#

How to

#

disable_search

#

On sonar

vocal merlin
hazy plover
#

Hi

junior elk
#

I'm excited about the new features!

sullen frost
#

Any guides specifically on Sonar tool use?

potent orbit
#

Hello

desert flicker
#

Jewish updates I like it

#

No hate on the Jews btw I like their interest free loans

hot stratus
#

nice update

#

LMAO

trim ingot
#

Thank you for inviting me to this forum. I look forward to reading and asking questions. 😊

sinful marlin
#

Donna AI

round thicket
#

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.

jovial rain
#

ping?

sweet atlas
upbeat raft
#

I have perplexity pro version, may i use api??

hot stratus
unreal spruce
#

is there any way to get comet browse in pro plan i india?

modern sedge
#

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.

digital hemlock
#

hola

chrome bobcat
#

hi

modern sedge
empty swan
#

.

hot stratus
#

@trail burrow Sorry but I'm actually not certain, best to ask your question here.

past island
uneven wolf
#

hm

keen loom
vocal merlin
vocal merlin
mossy wave
#

What’s up peeps?

thin sluice
hazy whale
#

🛡️🤝🔍

stable oyster
#

@lyric willow hi

signal hamlet
#

Hey guys can anyone tell me what this sonar API is used for?

severe carbon
#

Hey folks

lime socket
#

.

gaunt knoll
#

APi is really bad tbh in compare to the app

#

pls delete this spam

storm fog
#

Hi

green trench
#

Hi

latent scaffold
#

test

bitter elbow
#

Hi

young void
#

Is it free for pro users ?

midnight eagle
#

Halo

opal kiln
#

Anyone know if there are plans for perplexity to support tools? Don't think we can use perplexity as our model without that...

young void
#

Is this api free for pro users ...?

shy quarry
warped canyon
#

@everyone

#

@lyric willow can people in the discord server get the pro or plus for free?

warped canyon
opaque pine
#

Hi

fiery spear
#

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.

orchid seal
# main meadow I'm not sure if the engineering dept is currently hiring, but I know that the co...

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.

native pine
#

Yo

astral kestrel
#

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

strange pagoda
#

Are there any courses or detailed guides to master Perplexity? I’m a Pro user and want to explore.

midnight crane
fiery spear
#

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

spiral pivot
#

Can anyone help me pls i have pro account but i am facing this issue @lyric willow

fiery spear
#

Did anyone try out the new endpoint?

empty goblet
#

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.

rigid goblet
#

Same here !

empty goblet
#

Appears to be working again, now. Guess they're going to pretend nothing happened 🙂

keen glen
#

Hi, everyone!

gusty osprey
#

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

latent halo
delicate galleon
#

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?

fiery spear
worldly plinth
#

hi

lunar crater
#

is Sonar api free ?

hot stratus
stable kindle
#

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.

barren quartz
#

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

sinful marlin
tender pike
#

hi, any idea how i can stop the api from feeding me inaccurate info? is it just inevitable due to hallucination

sweet atlas
tender pike
sly cloud
paper pewter
chilly hearth
#

How do I fix the syntax error on android

paper python
hot stratus
paper python
amber bay
#

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

lyric willowBOT
#

@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.

molten dust
#

🤖 👍

sweet atlas
gaunt knoll
#

Is it better than Sonar?

spark moss
#

(I vote for a filter field in the new API 'search' Playground.😉)

mellow fossil
#

Just provides a different output structure.

vocal merlin
gaunt knoll
#

I wanted to make ai news tool but ai have no idea how

digital trench
#

Prmopt book airtel perplexity pro

knotty horizon
#

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?

thorny cave
#

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

thorn mortar
#

Hey is there any way that I can use perplexity API key for vs code

lunar wolf
#

ทำไมฉันต้องซื้อแอปตัวฉันเองอะ

#

ทำไมอะ ก็ผลิตจากกู มาขายกู ?

#

หน้าด้านอุบาท

eager hinge
thorn wind
#

can i set a Prompt for the api requests?

spark moss
# thorny cave Is there a way to apply the search_before/after_filter queries in the search api...

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}")```
tall whale
#

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",
  }
}
wispy crater
thorn wind
tall whale
# wispy crater It’s failing because some stream chunks don’t include choices[0], so your code t...

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

wispy crater
tall whale
# wispy crater Got it the stream is giving you raw SSE text, not parsed JSON chunks. I’ll help ...

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("");
}
tall whale
# wispy crater 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?

wispy crater
tall whale
wispy crater
spark moss
humble apex
#

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.

magic tusk
thorny cave
jagged hamlet
#

@lyric willow Uso de api para modelos open source ainda está disponível?

pliant gull
#

oh

coral geyser
#

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?

static torrent
#

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?

civic zephyr
#

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

raw locust
marsh jasper
sweet atlas
#

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!

coarse ermine
#

why wont n8n connect with my api key?

wispy moat
#

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?

civic stream
#

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

shy quarry
thorn wind
#

can i set a Prompt for the api requests?

static torrent
lunar steeple
#

I am getting this message. Do you know why?

loud hill
#

@sweet atlas @misty sluice can i get search api access?

hot stratus
turbid bloom
#

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

elfin spear
#

@sweet atlas @misty sluice can I get search api key?

pale ocean
#

hi

next bough
#

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?

lucid hamlet
lucid hamlet
lucid hamlet
lucid hamlet
thorn wind
#

How long i need to wait to approved and why I have:

This user is silenced.
Reason: New user typed too fast

lucid hamlet