Skip to main content

Overview

Perplexity is an OpenAI-compatible API with built-in web search capabilities and reasoning support. Bifrost performs conversions including:
  • OpenAI-compatible base - Uses OpenAI’s chat format as foundation
  • Web search parameters - Search mode, domain filters, recency filters, and location-based search
  • Reasoning effort mapping - reasoning.effort mapped to Perplexity’s reasoning_effort with special handling for “minimal”
  • Search results inclusion - Citations, search results, and videos included in response
  • Special usage tracking - Citation tokens, search queries, and reasoning tokens tracked separately

Supported Operations

Unsupported Operations (❌): Text Completions, Embeddings, Image Generation, Speech, Transcriptions, Files, Batch, and List Models are not supported by the upstream Perplexity API. These return UnsupportedOperationError.

Setup & Configuration

Configure Perplexity as a provider.
Perplexity provider dashboard
  1. Navigate to Models > Model Providers. Look for Perplexity under Configured Providers. If it is missing, click on Add New Provider and select Perplexity.
  2. Click Add Key or edit an existing key.
  3. Set a name for your key.
  4. Paste your API key directly or use an environment variable (for example, env.PERPLEXITY_API_KEY).
  5. Set Allowed Models to All Models (default) or the specific model allowlist you want this key to serve.
  6. Save the provider configuration.

1. Chat Completions

Request Parameters

Perplexity supports most OpenAI chat completion parameters. For standard parameter reference, see OpenAI Chat Completions.

Perplexity-Specific Constraints

  • No function calling: tools and tool_choice are silently dropped
  • Dropped parameters: stop, logit_bias, logprobs, top_logprobs, seed, parallel_tool_calls, service_tier
  • Reasoning: Uses reasoning_effort instead of reasoning object (see Reasoning & Effort)

Perplexity-Specific Parameters

Use extra_params (SDK) or pass directly in request body (Gateway) for Perplexity-specific search and configuration fields:

Search Parameters

Media Parameters

Web Search Options

Configure detailed search behavior including location:

Reasoning & Effort

Parameter Mapping

  • reasoning.effortreasoning_effort
  • Supported efforts: "low", "medium", "high"
  • Special conversion: "minimal""low" (Perplexity normalizes to low/medium/high)
  • reasoning.max_tokens is silently dropped (Perplexity doesn’t support token budget control)

Example

Response Conversion

Search Results Inclusion

Perplexity responses include additional fields for search integration:
  • citations[] - Source citations from search
  • search_results[] - Full search results with metadata
  • videos[] - Video results from search
These fields are preserved in the Bifrost response for client use.

Usage Details

Extended usage tracking specific to Perplexity:

Example Response

Streaming

Perplexity uses OpenAI-compatible streaming format. Event sequence:
  • chat.completion.chunk events with delta updates
  • Standard OpenAI finish reason mapping
Streaming with web search may return search results in final chunks.

Caveats

Severity: High Behavior: Tool-related parameters are silently dropped Impact: Function calling not available Code: chat.go:8-36
Severity: Medium Behavior: "minimal" effort is mapped to "low" (Perplexity only supports low/medium/high) Impact: Requested minimal effort becomes low effort Code: chat.go:30-36, responses.go:25-30
Severity: Low Behavior: reasoning.max_tokens is silently dropped Impact: No control over reasoning token budget Code: chat.go:29-36
Severity: Low Behavior: stop parameter is silently dropped Impact: Stop sequences not enforced Code: chat.go:8-36

2. Responses API

The Responses API is adapted for Perplexity by converting to the Chat Completions format internally and returning results in Responses format.

Request Parameters

Parameter Mapping

Extra Parameters

Same Perplexity-specific search and configuration parameters as Chat Completions (see Perplexity-Specific Parameters).

Conversion Details

  • instructions becomes a system message prepended to input messages
  • input (string or array) converted to user message(s)
  • Response converted to Responses API format with same search results and extended usage details

Response Format

Same as Chat Completions with search results, citations, and extended usage tracking preserved.

Streaming

Responses streaming uses the same OpenAI-compatible streaming as Chat Completions, with results adapted to Responses format.