[Integrations](https://spiral.ai/integrations) › [Perplexity](https://spiral.ai/integrations/perplexity) › [Relace Apply 3](https://spiral.ai/integrations/perplexity/relace-apply-3)

# How to Use Relace Apply 3 in Perplexity

Relace Apply 3 merges proposed edits into existing code. Give it the original code and an abbreviated edit snippet to get the merged code back.

|  |  |
| --- | --- |
| Model | Relace Apply 3 |
| Available through | OpenRouter |
| Category | LLM |
| Price | Up to $0.006695 per run at the default inputs. $1.105 per 1M input tokens, $1.625 per 1M output tokens. |
| Returns | text, json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with Relace Apply 3 in Perplexity

- Use Relace Apply 3 to merge this JavaScript change. Original: function double(n) { return n; } Proposed replacement: function double(n) { return n * 2; } Return the merged code.
- Use Relace Apply 3 to merge this Python correction. Original: def square(n): return n + n. Proposed replacement: def square(n): return n * n. Return the merged code.
- Use Relace Apply 3 to merge this TypeScript return-type change. Original: function label(): any { return 'Ready'; } Proposed replacement: function label(): string { return 'Ready'; }
- Use Relace Apply 3 to merge this HTML label change. Original: <button type="submit">Go</button>. Proposed replacement: <button type="submit">Save changes</button>.
- Use Relace Apply 3 to merge this Markdown heading update. Original: # Setup\n\nInstall the package. Proposed replacement: # Installation\n\nInstall the package.

## How to set up Relace Apply 3 in Perplexity

Pick the way that suits you. Each takes about two minutes.

### Use the Perplexity connector

1. **Add a remote connector**: In Perplexity, open Plugins in the sidebar (or Customize › Connectors if you don't see Plugins yet). Choose Add custom › Add MCP connector, then Remote. Name it Spiral and paste this MCP server URL:

```text
https://api.spiral.ai/mcp
```

2. **Sign in to Spiral and approve**: Select the Spiral card on the Plugins page to start sign-in. Spiral opens: sign in, pick the organization and click Authorize. No API key.

### Use the Spiral skill

1. **Send Perplexity this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run Relace Apply 3**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "openrouter",
    "model": "relace/relace-apply-3",
    "input": {
      "messages": [
        {
          "role": "system"
        }
      ]
    }
  }'
```

Then paste one of the prompts above: Perplexity finds Relace Apply 3 on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/perplexity

## Relace Apply 3 tools and prices

- [Relace: Relace Apply 3](https://spiral.ai/tools/openrouter/relace/relace-apply-3) (OpenRouter): Up to $0.006695 per run at the default inputs. $1.105 per 1M input tokens, $1.625 per 1M output tokens.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| seed |  | — |  |
| stop |  | — |  |
| max_tokens | 1 to 128000 | — | The most output tokens to generate. |

## What can you do with Relace Apply 3 in Perplexity?

Turn code shared in a conversation into a merged revision with Relace Apply 3. Supply the original code and a concrete proposed change, then compare the result with the original.

### Apply a TypeScript refactor

Merge a proposed function rename and updated call sites into existing TypeScript code, then inspect the resulting diff.

### Merge a JavaScript bug fix

Apply a prepared correction to a calculation or event handler while retaining the surrounding implementation.

### Update Python validation

Merge a proposed validation branch into a Python function using the original code and a focused edit snippet.

### Revise Ruby application logic

Apply an approved method change to existing Ruby code and review the diff for unintended edits.

### Apply HTML changes

Merge a prepared markup change, such as revised form labels, into the original HTML.

### Maintain Markdown documentation

Merge a proposed section replacement into an existing Markdown document while retaining unrelated sections.

## Overview

- [OpenRouter](https://spiral.ai/providers/openrouter)
- [All Perplexity guides](https://spiral.ai/integrations/perplexity)

## Relace Apply 3 in other agents

- [Amp](https://spiral.ai/integrations/amp/relace-apply-3)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/relace-apply-3)
- [Claude](https://spiral.ai/integrations/claude-desktop/relace-apply-3)
- [Claude Code](https://spiral.ai/integrations/claude-code/relace-apply-3)
- [Cline](https://spiral.ai/integrations/cline/relace-apply-3)
- [Codex](https://spiral.ai/integrations/codex/relace-apply-3)
- [Cursor](https://spiral.ai/integrations/cursor/relace-apply-3)
- [Devin](https://spiral.ai/integrations/devin/relace-apply-3)
- [dots](https://spiral.ai/integrations/dots/relace-apply-3)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/relace-apply-3)
- [Gemini](https://spiral.ai/integrations/gemini/relace-apply-3)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/relace-apply-3)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/relace-apply-3)
- [goose](https://spiral.ai/integrations/goose/relace-apply-3)
- [Grok](https://spiral.ai/integrations/grok/relace-apply-3)
- [Grok Build](https://spiral.ai/integrations/grok-build/relace-apply-3)
- [Hermes](https://spiral.ai/integrations/hermes/relace-apply-3)
- [Instinct](https://spiral.ai/integrations/instinct/relace-apply-3)
- [Manus](https://spiral.ai/integrations/manus/relace-apply-3)
- [Muse](https://spiral.ai/integrations/muse/relace-apply-3)
- [Muse Code](https://spiral.ai/integrations/muse-code/relace-apply-3)
- [n8n](https://spiral.ai/integrations/n8n/relace-apply-3)
- [Notion](https://spiral.ai/integrations/notion/relace-apply-3)
- [OpenClaw](https://spiral.ai/integrations/openclaw/relace-apply-3)
- [opencode](https://spiral.ai/integrations/opencode/relace-apply-3)
- [Raycast](https://spiral.ai/integrations/raycast/relace-apply-3)
- [VS Code](https://spiral.ai/integrations/vscode/relace-apply-3)
- [Windsurf](https://spiral.ai/integrations/windsurf/relace-apply-3)
- [Zapier](https://spiral.ai/integrations/zapier/relace-apply-3)

## More Perplexity guides

- [Reka Flash 3](https://spiral.ai/integrations/perplexity/reka-flash-3)
- [Relace Search](https://spiral.ai/integrations/perplexity/relace-search)
- [Reka Edge](https://spiral.ai/integrations/perplexity/reka-edge)
- [Ripple 65B Preview](https://spiral.ai/integrations/perplexity/ripple-65b-preview)
- [ReMM SLERP 13B](https://spiral.ai/integrations/perplexity/remm-slerp-13b)
- [Sakana Namazu](https://spiral.ai/integrations/perplexity/sakana-namazu)

## Questions about Relace Apply 3 in Perplexity

**Can Perplexity use Relace Apply 3?**

Yes. Add Spiral to Perplexity as an MCP server, and Perplexity can find and run Relace Apply 3 like any built-in tool.

**How much does Relace Apply 3 cost in Perplexity?**

Up to $0.006695 per run at the default inputs. $1.105 per 1M input tokens, $1.625 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Perplexity plan is separate.

**Do I need an OpenRouter account to use Relace Apply 3 in Perplexity?**

No. Spiral runs Relace Apply 3 on its own OpenRouter account. You sign in to Spiral once and never paste a key.

**How long does it take to set up Relace Apply 3 in Perplexity?**

About two minutes: add a remote connector, then sign in to Spiral and approve.

**Does Perplexity wait while Relace Apply 3 runs?**

Relace Apply 3 runs in the background. Perplexity starts the run, checks on it and gives you the text, json when it's ready.

**What is Relace Apply 3 best used for?**

Use it to merge an already proposed change into existing code. A useful workflow separates deciding what to change from applying that change.

**How should I format a Relace Apply 3 prompt?**

Put the original code inside <code> tags and the proposed edit inside <update> tags. Add a brief instruction describing the intended change when the snippet could be ambiguous.

**Which programming languages does Relace Apply 3 cover?**

Relace reports training across dozens of languages, emphasizing TypeScript, JavaScript, Python, Ruby, HTML, and Markdown. That training coverage does not establish equal accuracy across languages.

**Should I send very large source code blocks?**

Relace recommends refactoring files above 32,000 tokens to improve output quality. Treat that recommendation as a quality guideline when choosing how much code to send.

**How do I make deletions clear?**

Include surrounding code that identifies the section to remove. Preserve the indentation and structure you want in the final result.

