{"slug":"perplexity","name":"Perplexity Sonar API","owner":null,"repo":null,"category":"search-retrieval","lang":"","blurb":"Search-grounded LLM API (Sonar models) that returns cited answers with live web search built in, plus a raw Search API.","use_cases":"[]","alternatives":[],"stars":0,"pushed_at":null,"synced_at":null,"kind":"api","one_liner":"Search-grounded LLM API (Sonar models) that returns cited answers with live web search built in, plus a raw Search API.","website":"https://docs.perplexity.ai","docs_url":"https://docs.perplexity.ai","signup_url":"https://www.perplexity.ai/settings/api","pricing_model":"usage-based","pricing_note":"Token-based: Sonar ~$1/M, Sonar Pro $3/$15 per M in/out, plus a per-request search fee; Pro subscribers get $5/mo credit","auth_type":"api-key","agent_signup":"manual-only","agent_signup_note":"Minting an API key requires setting up billing / adding a payment method, so a human is needed.","mcp_server":"https://github.com/perplexityai/modelcontextprotocol","sdks":["Python","TypeScript","REST","OpenAI-compatible"],"code_sample":"{\"lang\":\"python\",\"code\":\"from openai import OpenAI\\n\\nclient = OpenAI(api_key=\\\"pplx-YOUR_KEY\\\", base_url=\\\"https://api.perplexity.ai\\\")\\nresp = client.chat.completions.create(\\n    model=\\\"sonar\\\",\\n    messages=[{\\\"role\\\": \\\"user\\\", \\\"content\\\": \\\"What are the newest AI search APIs?\\\"}],\\n)\\nprint(resp.choices[0].message.content)\"}","tags":["answer-engine","sonar","cited-answers","grounding","llm"],"useCases":[],"codeSample":{"lang":"python","code":"from openai import OpenAI\n\nclient = OpenAI(api_key=\"pplx-YOUR_KEY\", base_url=\"https://api.perplexity.ai\")\nresp = client.chat.completions.create(\n    model=\"sonar\",\n    messages=[{\"role\": \"user\", \"content\": \"What are the newest AI search APIs?\"}],\n)\nprint(resp.choices[0].message.content)"},"oneLiner":"Search-grounded LLM API (Sonar models) that returns cited answers with live web search built in, plus a raw Search API.","docsUrl":"https://docs.perplexity.ai","signupUrl":"https://www.perplexity.ai/settings/api","pricingModel":"usage-based","pricingNote":"Token-based: Sonar ~$1/M, Sonar Pro $3/$15 per M in/out, plus a per-request search fee; Pro subscribers get $5/mo credit","authType":"api-key","agentSignup":"manual-only","agentSignupNote":"Minting an API key requires setting up billing / adding a payment method, so a human is needed.","mcpServer":"https://github.com/perplexityai/modelcontextprotocol"}