Route requests to
Palmyra X5
with Merge Gateway

Apply your own routing policies, reduce token costs automatically, and see every routing decision in real time with Merge Gateway.

What Palmyra X5 costs to run

| Vendor | Input / 1M tokens | Output / 1M tokens | Zero data retention | | --- | ---: | ---: | --- | | Amazon Bedrock | $0.6000 | $6.00 | Yes | | Writer | $0.6000 | $6.00 | Yes |

Test Palmyra X5
with Gateway’s Simulator

See a prompt's output, token spend, latency, and more with Palmyra X5.

Route requests to Palmyra X5 in minutes

To get started in seconds, add our Gateway Implementation skill to your project, or pick your preferred SDK below. Check out our other quick start skills here.
Install the Merge Gateway SDK
Python
Copied!
1$ pip install merge-gateway-sdk
Send a request
Python
Copied!
1from merge_gateway import MergeGateway
2
3client = MergeGateway(api_key="YOUR_API_KEY")
4
5response = client.responses.create(
6    model="openai/gpt-5.2",
7    input=[
8        {"type": "message", "role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
9        {"type": "message", "role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
10    ],
11)
12
13print(response.output[0].content[0].text)
Try a diffrent model
Swap the model string to route to a different provider. No other code changes needed.
Anthropic
Copied!
1response = client.responses.create(
2    model="anthropic/claude-sonnet-4-20250514",
3    input=[
4        {"type": "message", "role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
5        {"type": "message", "role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
6    ],
7)
Point to Gateway
Python
Copied!
1from openai import OpenAI
2
3client = OpenAI(
4    api_key="YOUR_API_KEY",
5    base_url="https://api-gateway.merge.dev/v1/openai",
6)
Send a request
Use the standard chat.completions.create method. No provider prefix needed on the model name.
Python
Copied!
1response = client.chat.completions.create(
2    model="gpt-5.2",
3    messages=[
4        {"role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
5        {"role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
6    ],
7)
8
9print(response.choices[0].message.content)
Install packages
Copied!
1npm install merge-gateway-ai-sdk-provider ai
Create the provider
TypeScript
Copied!
1import { createMergeGateway } from "merge-gateway-ai-sdk-provider";
2
3const gateway = createMergeGateway({
4  apiKey: "YOUR_API_KEY",
5});
Send a request
Use generateText to send a request. Model names use the provider/model format.
TypeScript
Copied!
1import { generateText } from "ai";
2
3const { text } = await generateText({
4  model: gateway("openai/gpt-4o"),
5  prompt: "Explain the concept of recursion in programming with a simple set of examples.",
6});
7
8console.log(text);
If you already have @ai-sdk/openai installed, point it at Gateway with a base URL change:
TypeScript
Copied!
1import { createOpenAI } from "@ai-sdk/openai";
2
3const gateway = createOpenAI({
4  apiKey: "YOUR_API_KEY",
5  baseURL: "https://api-gateway.merge.dev/v1/ai-sdk",
6});
7
8// All generateText/streamText calls work unchanged
Install the Merge Gateway SDK
Anthropic SDK
Copied!
1from anthropic import Anthropic
2
3client = Anthropic(
4    api_key="YOUR_API_KEY",
5    base_url="https://api-gateway.merge.dev/v1/anthropic",
6)
7
8message = client.messages.create(
9    model="claude-sonnet-4-20250514",
10    max_tokens=1024,
11    messages=[
12        {"role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
13    ],
14)
15
16print(message.content[0].text)

Explore other models available in Merge Gateway

model logo
Amazon Nova 2 Lite
model logo
Amazon Nova 2 Sonic
model logo
Amazon Nova Lite
model logo
Amazon Nova Micro
model logo
Amazon Nova Premier
model logo
Amazon Nova Pro
model logo
Claude 3.7 Sonnet
model logo
Claude Haiku 4.5 (20251001)
model logo
Claude Opus 4.6
model logo
Claude Opus 4.7
model logo
Claude Opus 4.8
model logo
Claude Sonnet 4.5
model logo
Claude Sonnet 4.6
model logo
Claude Sonnet 5
model logo
Codestral
model logo
Codestral 25.08
model logo
Command R 08-2024
model logo
Command R+ 08-2024
model logo
Command R7B 12-2024
model logo
DeepSeek R1
model logo
DeepSeek V3
model logo
DeepSeek V3.2
model logo
DeepSeek V4 Flash
model logo
DeepSeek V4 Pro

Palmyra X5 FAQ

For anyone with more questions about Palmyra X5, we've covered a few more below. The details here reflect what was known in July, 2026 and are subject to change.

Heading

What other models does Writer offer?

Palmyra X5 is Writer's flagship enterprise model, and it sits at the top of a Palmyra model family designed for specialized business domains and workflow automation. Here are some other models Writer supports:

  • Palmyra X4: Palmyra X4 is Writer's previous-generation enterprise model with a 128k-token context window, priced at $2.50 per 1M input tokens and $10.00 per 1M output tokens, excelling at tool calling and agent orchestration with documented 78.76% accuracy in tool-call identification, nearly 20 percentage points above competitors in its tier
  • Palmyra Med: Palmyra Med is a domain-specialized model built for medical and clinical use cases, with a 32k-token context window priced at $5.00 per 1M input and $12.00 per 1M output, designed for healthcare workflows where domain-specific training and compliance considerations outweigh general capability breadth. Scheduled for deprecation on July 13, 2026, with X5 as the migration target
  • Palmyra Fin: Palmyra Fin is a finance-domain model with a 128k-token context window priced at $5.00 per 1M input and $12.00 per 1M output, covering financial document analysis, regulatory text, and structured financial reasoning. Also scheduled for deprecation on July 13, 2026
  • Palmyra Creative: Palmyra Creative is a model optimized for long-form content generation, brand voice matching, and creative writing tasks, with a 128k-token context window priced at $5.00 per 1M input and $12.00 per 1M output. Also deprecating July 13, 2026, with X5 serving as the unified replacement

How does Palmyra X5 differ from Writer's other models?

Palmyra X5 is Writer's adaptive reasoning flagship, built to consolidate the capabilities of multiple earlier Palmyra domain models into a single model with a 1M-token context window.

  • Context window: Palmyra X5 supports a 1M-token context window. Palmyra X4, the previous flagship, tops out at 128k tokens. For enterprise workflows involving long contracts, large codebases, or extended document sets, X5 provides approximately 8x more usable context than its predecessor
  • Pricing: Palmyra X5 is priced at $0.60 per 1M input tokens and $6.00 per 1M output tokens. Palmyra X4 costs $2.50 input and $10.00 output per 1M tokens, making X5 approximately 75% cheaper on input and 40% cheaper on output while delivering a larger context window. Domain-specialized models (Med, Fin, Creative) are priced at $5.00 input and $12.00 output, making X5 the most cost-efficient option in the current lineup
  • Benchmark scores: Palmyra X5 scores 70.99% on BBH, 47.20% on GPQA, 65.02% on MMLU-Pro, and 71.57% on MATH Hard. It achieves 53% on LongBench v2, described as best-in-class for long-context evaluation. These scores position it near GPT-4.1 on several dimensions, approaching competitive performance at a significantly lower price point
  • Adaptive reasoning: Palmyra X5 dynamically adjusts its reasoning strategy based on task complexity, allowing it to handle both straightforward instruction-following and multi-step logical reasoning without requiring separate model variants for each mode
  • Consolidation of domain coverage: X5 is designed to serve as the replacement for Palmyra Med, Fin, Creative, and X 003 Instruct, all of which are being deprecated in July 2026. Unlike those models, X5 handles medical, financial, legal, and creative tasks in a single endpoint

Palmyra X5 is best suited for enterprise teams that need a single, cost-efficient model to handle large-document analysis, multi-domain content generation, and agentic workflows without managing a fleet of specialized Palmyra variants.

What models should I consider using alongside Palmyra X5?

No single model is optimal for every task. Here are models worth pairing with Palmyra X5 depending on what your product needs:

  • GPT-4.1 (OpenAI): For tasks requiring strong multi-step tool calling in complex agentic pipelines, GPT-4.1 provides OpenAI's well-documented function-calling reliability. Palmyra X5 scores 19.1% on the MRCR 8-needle long-context test versus GPT-4.1's 20.25%, so for precision-critical long-context retrieval, GPT-4.1 may have a small edge worth routing to
  • Claude Sonnet 4.5 (Anthropic): When consistent instruction-following and structured output reliability are required across diverse, unpredictable prompt formats, Claude Sonnet 4.5 serves as a cross-provider backstop. Using it alongside X5 gives you provider redundancy without re-architecting your integration
  • Qwen3.7 Max (Alibaba): For the highest-stakes reasoning tasks, particularly in mathematics, STEM, or competitive benchmarks where Palmyra X5 does not match frontier performance, Qwen3.7 Max at 57 on the Intelligence Index provides a high-capability overflow target at $2.50 per 1M input
  • Gemini 2.0 Flash (Google): For multimodal tasks involving image processing, visual document analysis, or video understanding, route those requests to Gemini 2.0 Flash. Palmyra X5 is a text-only model, so any visual input requires a different model in your pipeline
  • Llama 3.3 70B (Meta): For high-volume, low-complexity requests such as summarization, classification, or templated generation where Palmyra X5's capabilities are underutilized, Llama 3.3 70B offers a fully self-hostable, cost-minimal alternative that preserves your X5 budget for the tasks that actually benefit from it

What are the challenges of using Palmyra X5 in my product?

Like any production LLM, Palmyra X5 comes with tradeoffs worth planning for:

  • Output cost at scale: At $6.00 per 1M output tokens, Palmyra X5 has a high output cost relative to models in the same input price range. For workloads with long completions, such as document drafting or extended agent sessions, output costs can dominate the total spend. Active output length controls and per-project budget limits are important before going to production at volume
  • Long-context retrieval precision: Palmyra X5 scores 19.1% on the MRCR 8-needle long-context benchmark, slightly below GPT-4.1's 20.25%. For applications where precise multi-needle retrieval at 1M context is critical, this gap may require validation testing on your specific content type before relying on X5 as the sole long-context model
  • Provider maturity and ecosystem: Writer is a smaller provider than OpenAI, Anthropic, or Google. Rate limits, uptime history, and enterprise SLA options are less extensively documented. Teams requiring guaranteed throughput or formal uptime commitments should verify current SLA terms before using Palmyra X5 as a sole production endpoint
  • Provider dependency: Relying on Writer as a single provider creates fragility when the provider has an outage or deprecates a model version. The consolidation of multiple Palmyra domain models into X5 means a single endpoint serves more workflows, increasing the blast radius of any X5-specific outage
  • No multimodal input: Palmyra X5 is a text-only model. Any pipeline that involves processing images, diagrams, or other visual inputs requires routing those requests to a multimodal model, adding conditional logic to your application

Why should I use Merge Gateway to route LLM requests with Palmyra X5 and every other model?

Using Palmyra X5 through Merge Gateway gives you access to the model itself and the infrastructure layer around it:

  • Cost governance: Set hard or soft project budgets so Palmyra X5 spend stays within plan, which is especially important given X5's $6.00 per 1M output token pricing. Every request is attributed to a model, project, and tag in a unified billing dashboard across all providers
  • One API, every provider: Access Palmyra X5 and every other major LLM through a single endpoint and API key. Change providers by swapping the model string, with no application code changes required
  • Intelligent routing and automatic failover: Merge routes around Writer outages automatically. Routing policies based on cost, latency, or quality can reduce spend by 40 to 60% without touching your application code
  • Build Your Own Router: Define what "best" means for your traffic by selecting from curated ML benchmarks or adding your own eval scores. The router scores each available model against your weights and picks the winner per request, with a plain-language explanation of every decision
  • Security and compliance controls: Apply DLP rules and prompt injection protection before every request reaches Writer. Enforce per-project model and region policies without adding that logic to your application

How can I start routing requests to Palmyra X5 via Merge Gateway?

Getting Palmyra X5 running through Merge Gateway takes a few minutes:

1. Create an account and get your API key from the dashboard.

2. Install the Merge Gateway SDK: run pip install merge-gateway-sdk (Python) or npm install merge-gateway-sdk (Node). Alternatively, if you're already using the OpenAI SDK, set base_url = "https://api-gateway.merge.dev/v1/openai" and your existing code works as-is.

3. Make your first request using the provider/model format. For Palmyra X5, the model string is writer/palmyra-x5. Swap the model string to route to any other provider without changing anything else.

4. Configure a routing policy in the dashboard to set failover behavior, cost limits, and optimization strategy. Your first policy can be as simple as naming Palmyra X5 as primary with one fallback.

Full setup instructions and SDK references are in the Merge Gateway docs.

Try Palmyra X5 through Merge Gateway

Route, observe, and control AI requests across providers from one API.