| name | perplexity-deploy-integration |
| description | Deploy Perplexity Sonar API integrations to Vercel, Cloud Run, and Docker.
Use when deploying Perplexity-powered applications to production,
configuring platform-specific secrets, or setting up edge functions.
Trigger with phrases like "deploy perplexity", "perplexity Vercel",
"perplexity production deploy", "perplexity Cloud Run", "perplexity Docker".
|
| allowed-tools | Read, Write, Edit, Bash(vercel:*), Bash(fly:*), Bash(gcloud:*) |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","perplexity","deployment"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Perplexity Deploy Integration
Overview
Deploy applications using Perplexity Sonar API to edge and server platforms. Perplexity's OpenAI-compatible endpoint at https://api.perplexity.ai/chat/completions works from any platform that can make HTTPS requests.
Prerequisites
- Perplexity API key stored in
PERPLEXITY_API_KEY
- Platform CLI installed (vercel, gcloud, or docker)
- Application tested locally
Instructions
Step 1: Vercel Edge Function
import OpenAI from "openai";
export const config = { runtime: "edge" };
const perplexity = new OpenAI({
apiKey: process.env.PERPLEXITY_API_KEY!,
baseURL: "https://api.perplexity.ai",
});
export default async function handler(req: Request) {
const { query, model = "sonar", stream = false } = await req.json();
if (stream) {
const response = await perplexity.chat.completions.create({
model,
messages: [{ role: "user", content: query }],
stream: ,
: ,
});
(response.(), {
: { : },
});
}
response = perplexity...({
model,
: [{ : , : query }],
: ,
});
.({
: response.[]..,
: (response ). || [],
: response.,
});
}