Files

105 lines
3.8 KiB
JSON

[
[
{
"a": "Models",
"href": "/models"
},
{
"a": "Perplexity",
"href": "/models/perplexity"
},
{
"h1": "Sonar"
},
{
"p": "Sonar is lightweight, affordable, fast, and simple to use — now featuring citations and the ability to customize sources."
},
{
"a": "Get API key",
"href": "https://platform.hanzo.ai/api-keys"
},
{
"a": "Try in Chat",
"href": "/chat"
}
],
[
{
"h2": "Specifications"
}
],
[
{
"h2": "Quick start"
},
{
"a": "Get an API key →",
"href": "https://platform.hanzo.ai/api-keys"
},
{
"button": "TypeScript"
},
{
"button": "Python"
},
{
"button": "cURL"
},
{
"button": "Go"
},
{
"code": "import OpenAI from ' openai ' const client = new OpenAI ({ apiKey : process.env.HANZO_API_KEY , baseURL : ' https://api.hanzo.ai/v1 ' }) const response = await client.chat.completions. create ({ model : ' perplexity/sonar ' , messages : [{ role : ' user ' , content : ' Hello! ' }] }) console. log ( response.choices [ 0 ] .message.content )"
},
{
"code": "from openai import OpenAI client = OpenAI ( api_key=os . environ [ \" HANZO_API_KEY \" ], base_url= \" https://api.hanzo.ai/v1 \" ) response = client . chat . completions . create ( model= \" perplexity/sonar \" , messages= [{ \" role \" : \" user \" , \" content \" : \" Hello! \" }] ) print ( response . choices [ 0 ]. message . content )"
},
{
"code": "curl https://api.hanzo.ai/v1/chat/completions \\ -H \" Content-Type: application/json \" \\ -H \" Authorization: Bearer $ HANZO_API_KEY \" \\ -d ' { \"model\": \"perplexity/sonar\", \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}] } '"
},
{
"code": "package main import ( \" context \" \" fmt \" \" os \" \" github.com/sashabaranov/go-openai \" ) func main () { cfg := openai . DefaultConfig ( os . Getenv ( \" HANZO_API_KEY \" )) cfg . BaseURL = \" https://api.hanzo.ai/v1 \" client := openai . NewClientWithConfig ( cfg ) resp , _ := client . CreateChatCompletion ( context . Background (), openai . ChatCompletionRequest { Model : \" perplexity/sonar \" , Messages : [] openai . ChatCompletionMessage { { Role : openai . ChatMessageRoleUser , Content : \" Hello! \" }, }, }, ) fmt . Println ( resp . Choices [ 0 ]. Message . Content ) }"
}
],
[
{
"h2": "More from Perplexity"
},
{
"a": "Sonar Deep Research 128K Sonar Deep Research is a research-focused model designed for multi-step retrieval, synthesis, and reasoning across complex topics. It autonomously searches, reads, and evaluates sources, refining its approach as it gathers...",
"href": "/models/perplexity/sonar-deep-research"
},
{
"a": "Sonar Pro 200K Note: Sonar Pro pricing includes Perplexity search pricing. See [details here](https://docs.perplexity.ai/guides/pricing#detailed-pricing-breakdown-for-sonar-reasoning-pro-and-sonar-pro) For enterprises seeking more advanced capabilities, the Sonar Pro API can handle in-depth, multi-step queries with added extensibility, like...",
"href": "/models/perplexity/sonar-pro"
},
{
"a": "Sonar Pro Search 200K Exclusively available on the OpenRouter API, Sonar Pro's new Pro Search mode is Perplexity's most advanced agentic search system. It is designed for deeper reasoning and analysis. Pricing is based...",
"href": "/models/perplexity/sonar-pro-search"
},
{
"a": "Sonar Reasoning Pro 128K Note: Sonar Pro pricing includes Perplexity search pricing. See [details here](https://docs.perplexity.ai/guides/pricing#detailed-pricing-breakdown-for-sonar-reasoning-pro-and-sonar-pro) Sonar Reasoning Pro is a premier reasoning model powered by DeepSeek R1 with Chain of Thought (CoT). Designed for...",
"href": "/models/perplexity/sonar-reasoning-pro"
},
{
"a": "View all Perplexity models →",
"href": "/models/perplexity"
}
],
[
{
"h2": "Use Sonar via Hanzo AI"
},
{
"p": "One API key. Every major model. OpenAI-compatible. Start free."
},
{
"a": "Get an API key",
"href": "https://platform.hanzo.ai/api-keys"
},
{
"a": "Browse All Models",
"href": "/models"
}
]
]