API template library

Simulate the Perplexity Orchestrator API

A WireMock simulation of Perplexity's REST API — covering OpenAI Chat Completions, OpenAI Responses and Anthropic Messages wire formats over Perplexity-hosted open-weight models, plus the model catalog and auth tokens.

Vendor
Perplexity
Functionality
OpenAI and Anthropic formats, model catalog
Endpoints
8
Stubs
21
Protocol
REST
Validation
AI-validated Before publication, an AI agent exercised these endpoints against the real Perplexity API through WireMock's recording proxy, and the recorded traffic was used to verify each stub's request and response shapes.

Live sandbox · no signup, no API key

Perplexity Orchestrator API

A running WireMock Cloud instance of this template, callable right now from a terminal, a script, or an AI agent.

Base URL
https://jg92lr.wiremockapi.cloud

GET List Models

curl -s -X GET 'https://jg92lr.wiremockapi.cloud/orchestrator/v1/models'

POST Create Chat Completion

curl -s -X POST 'https://jg92lr.wiremockapi.cloud/orchestrator/v1/chat/completions' \
  -H 'Content-Type: application/json' \
  -d '{}'

GET Retrieve Model (creator/name path) - perplexity/deepseek-v4-pro-0813

curl -s -X GET 'https://jg92lr.wiremockapi.cloud/orchestrator/v1/models/perplexity/deepseek-v4-pro-0813'
Method Path Summary
POST /generate_auth_token Generate Auth Token
POST /orchestrator/v1/chat/completions Create Chat Completion
POST /orchestrator/v1/messages Create Message
GET /orchestrator/v1/models List Models
GET /orchestrator/v1/models/{creator}/{name} Retrieve Model (creator/name path)
GET /orchestrator/v1/models/{model} Retrieve Model
POST /orchestrator/v1/responses Create Response
POST /revoke_auth_token Revoke Auth Token

Unauthenticated WireMock Cloud demo sandbox for Perplexity — not an official Perplexity sandbox, and it returns simulated example data only.

What's inside the Orchestrator template

The template simulates Perplexity's Orchestrator, which serves open-weight models through three wire formats at once. Its catalog is the four Perplexity-hosted models, each with per-million-token prices, and that catalog is enforced: a chat completion for perplexity/kimi-k3 answers a normal chat.completion object, while a request naming any other model gets an invalid_request_error pointing back at the models route. Router logic that validates model ids before sending can be tested against both outcomes.

  • Chat Completions — OpenAI-format requests with tools, JSON-schema structured output, reasoning effort and server-sent event streaming
  • Responses — OpenAI Responses-format requests that echo instructions, tools and metadata, with function-call and text-delta events when streaming
  • Messages — Anthropic-format requests with tool_use blocks and thinking blocks when thinking is enabled
  • Model catalog — the hosted models with pricing, readable by id in either the encoded or the creator/name path form
  • Auth tokens — pplx- token generation and revocation, shared with the main Perplexity API

Example implementation using the OpenAI Python SDK

Because the Orchestrator speaks the OpenAI wire format, the stock OpenAI SDK works once its base URL includes the /orchestrator/v1 prefix:

The Anthropic SDK connects the same way with its base URL set to the /orchestrator prefix (it appends /v1/messages itself), and agent frameworks that read OPENAI_BASE_URL can be redirected without code changes.

Fixed answers make multi-provider routing testable: switch formats, swap models and replay tool-call turns in CI with no preview access and no per-token cost.

from openai import OpenAI

# the sandbox URL, or your own mock's —
# the api_key is accepted but never validated
client = OpenAI(
    base_url="https://jg92lr.wiremockapi.cloud/orchestrator/v1",
    api_key="any-value",
)

reply = client.chat.completions.create(
    model="perplexity/kimi-k3",
    messages=[{"role": "user", "content": "Summarize WireMock in one line"}],
)
print(reply.choices[0].message.content)

Perplexity Orchestrator mock API FAQ

It quotes the last user turn, or the tool output when the last turn is a tool result. When tools are supplied, the reply is a tool call instead, to the tool named in tool_choice or else the first one, with arguments built from that tool's parameter schema.

Chat Completions and Responses return server-sent events when stream is true, word by word, with an optional usage chunk. Messages answers plain JSON even when streaming is requested, since the spec documents only a JSON response for that route.

No. Any key is accepted, and tokens from the generate route aren't checked on later calls. Keep real Perplexity keys away from the shared sandbox regardless.

The sandbox only simulates the unknown-model 400 and the unknown-model 404 on the catalog. Add 429 and 5xx stubs in your own WireMock Cloud copy to drive fallback logic between models.

Vendor names identify APIs represented by WireMock template sources. This page does not imply vendor endorsement, certification, partnership, or official integration status.