Discussions

Ask a Question

Differents returns for same topic

It seems return wrong results if specify the response language. and results is differents with English return. curl --request POST --url <https://api.perplexity.ai/chat/completions> --header 'accept: application/json' --header "authorization: Bearer $KEY" --header 'content-type: application/json' --data '{"model": "sonar-small-20240223-online", "messages": [{"role":"system", "content": "Always respond in japanese"},{"role": "user", "content": "how many EV car sold in Japan in 2024?"}], "return_citations": true, "return_images": true}' { "id": "586bddee-7930-441f-8ebf-b4dc7ce959cb", "model": "sonar-small-20240223-online", "created": 1716005266, "usage": { "prompt_tokens": 49, "completion_tokens": 11, "total_tokens": 60 }, "object": "chat.completion", "choices": [{ "index": 0, "finish_reason": "stop", "message": { "role": "assistant", "content": "102,000" }, "delta": { "role": "assistant", "content": "" } }] } curl --request POST --url <https://api.perplexity.ai/chat/completions> --header 'accept: application/json' --header "authorization: Bearer $KEY" --header 'content-type: application/json' --data '{"model": "sonar-small-20240223-online", "messages": [{"role":"system", "content": ""},{"role": "user", "content": "how many EV car sold in Japan in 2024?"}], "return_citations": true, "return_images": true}' { "id": "748558e7-cb1f-4366-b4d2-f1386de9957b", "model": "sonar-small-20240223-online", "created": 1716005421, "usage": { "prompt_tokens": 44, "completion_tokens": 122, "total_tokens": 166 }, "object": "chat.completion", "choices": [{ "index": 0, "finish_reason": "stop", "message": { "role": "assistant", "content": "The search results do not provide specific information on the number of electric vehicles (EVs) sold in Japan in 2024. However, they do provide data on the number of EVs sold in the United States, which reached approximately 1.2 million in 2023. The data indicates that the EV market is growing rapidly in the United States, with sales volumes increasing and market share reaching 7.6% in 2023. However, there is no direct information available on the number of EVs sold in Japan during the same period." }, "delta": { "role": "assistant", "content": "" } }] } it seems return wrong results if specify the response language. and results is differents with English return.
ANSWERED

API Charges and free Plan

Do I need to sign up for a Pro Plan or Subscription in order to use the API or can I just pay for the API usage without a Pro plan or Subscription?
ANSWERED

Does the current API support generating embeddings?

When I asked Perplexity.AI through the AI chat it says it does but it couldn't find documentation for it. Is this possible now? Another answer linked to the roadmap but I don't see any embedding generation there.
ANSWERED

Maximum of 5 Citations?

Using the API on your online models I am unable to get a response with more than 5 citations. Is that a hard limit, and if so does it mean that the model only considers 5 web searches?
ANSWERED

Cors issues when trying to call api from browser

I want to be able to call the api locally over the client/browser, but it doesn't work because of CORS. In the OpenAI API I can set a flag that allows calls from the browser, is this possible here too? Doing it over the OpenAI SDK doesn't solve the errors ```typescript const perplexity = new OpenAI({ baseURL: "https://api.perplexity.ai", apiKey: get(perplexityApiKey) ?? "", dangerouslyAllowBrowser: true }); ``` > Fetch API cannot load <https://api.perplexity.ai/models> due to access control checks.

Missing Additional Text/Description in Website Listings

Hello, I'm seeking assistance with an issue we're facing for our website being presented in Perplexity. We're trying to improve our presented data, but it seems we're missing some additional text/description for certain entries. I've attached a screenshot to illustrate the problem: <https://prnt.sc/icTiNjV-kNdu> As you can see, the listing data for our website lacks complete descriptions compared to other websites. What steps can we take to ensure our data is fully populated with the necessary descriptions? Are there specific guidelines or tools you recommend for auditing and enhancing the data on our site? Thank you in advance for your help!
ANSWERED

Are the web results and API call results the same?

I haven't tested this, but I'm basically just curious. I'm currently using 'perplexity pro', is the result I get on the web the same as the value I get by calling the API? I've tested it two or three times and they are very different.

Ineffective Constrain to Domain & Irrelevant Citations

When using "search_domain_filter" to constrain searches to a specified domain there are a couple of challenges: 1. The model still returns answers to questions completely unrelated to the specified domain e.g. 'who invented aeroplanes'; and 2. When doing so, it returns irrelevant citations from the specified domain.

Constrain to domain: "search_domain_filter" with multiple domains

Is search_domain_filter designed to work with multiple domains? Judging by the citations returned, my experience of using search_domain_filter: ["abc.com", "xyz.com"] is that results seem to be generated more from the first term ("abc.com") than the second term ("xyz.com"). Have you observed the same? If so, how can we give multiple domains equal weight?

response spec for return_citations, return_images requests

It would be helpful to specify the specification about response body for return_citations, return_images requests. If I missed it, please let me know.