Baltor Get started

Models

Sonar

By Perplexity. Unknown parameters, a context window of 128,000 tokens, licence Unknown.

Facts

Released
2024-01-01 the release date models.dev records models.dev, read
Licence
Unknown
Open weights
No models.dev records whether the weights are open models.dev, read
Parameters
Unknown
Active parameters
Unknown
Knowledge cutoff
2025-09-01 the knowledge cutoff models.dev records models.dev, read
Context window
  • 127,072 tokens the context length OpenRouter lists OpenRouter, read
  • 128,000 tokens the context limit models.dev records for the maker's own API models.dev, read
Longest output
  • 114,364 tokens the largest output OpenRouter's first provider allows OpenRouter, read
  • 4,096 tokens the output limit models.dev records for the maker's own API models.dev, read
Tool calling
  • No OpenRouter does not list tools among the supported parameters OpenRouter, read
  • No models.dev records tool_call as false models.dev, read
Structured output
  • No OpenRouter lists no structured output parameter OpenRouter, read
Reasoning controls
  • No models.dev records reasoning as false models.dev, read
Inputs and outputs
text, image in, text out OpenRouter, read
Good for
  • Vision: OpenRouter lists images among its inputs OpenRouter, read

Prices

Prices in US dollars per million tokens, as each source lists them
ProviderInputOutputContextAs ofSource
Perplexity direct1.00 USD1.00 USD128,000 older than 30 days; check the providermodels.dev, read
Perplexity through OpenRouter1.00 USD1.00 USD127,072OpenRouter endpoints, read

Run it on your own hardware

No source lists weight files or a parameter count for this model, so its memory needs are Unknown.

Use it from your harness

Set up for OpenRouter with the model perplexity/sonar. Each endpoint page has the same setup for its own address.

OpenCode

Put this in opencode.json in your project folder:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "openrouter": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "OpenRouter",
      "options": {
        "baseURL": "https://openrouter.ai/api/v1",
        "apiKey": "{env:OPENROUTER_API_KEY}"
      },
      "models": {
        "perplexity/sonar": {
          "name": "Sonar",
          "limit": {
            "context": 128000,
            "output": 114364
          }
        }
      }
    }
  }
}
  • OpenCode reads any OpenAI-compatible address through the @ai-sdk/openai-compatible package, and an address that speaks the Responses API through @ai-sdk/openai.

From OpenCode documentation, read .

Pi

Put this in ~/.pi/agent/models.json:

{
  "providers": {
    "openrouter": {
      "baseUrl": "https://openrouter.ai/api/v1",
      "api": "openai-completions",
      "apiKey": "$OPENROUTER_API_KEY",
      "models": [
        {
          "id": "perplexity/sonar"
        }
      ]
    }
  }
}
  • The apiKey field can name an environment variable as $NAME.

From Pi documentation, read .

Codex

Put this in ~/.codex/config.toml:

model = "perplexity/sonar"
model_provider = "openrouter"

[model_providers.openrouter]
name = "OpenRouter"
base_url = "https://openrouter.ai/api/v1"
env_key = "OPENROUTER_API_KEY"
  • Codex speaks the Responses API only: responses is the one supported wire API of a custom provider. Ollama and LM Studio are built in and start with --oss.

From Codex documentation, read .

Claude Code

Put this in ~/.claude/settings.json, or variables in your shell:

export ANTHROPIC_BASE_URL="https://openrouter.ai/api"
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
export ANTHROPIC_MODEL="perplexity/sonar"
claude
  • Claude Code sends Anthropic Messages requests to ANTHROPIC_BASE_URL. Anthropic says it does not support routing Claude Code to models other than Claude through any gateway, so some features may not work with another model.

From Claude Code documentation, read .

Sources of this page