OpenRouter Ultra – Fix Broken JSON & Structured Output avatar

OpenRouter Ultra – Fix Broken JSON & Structured Output

Pricing

from $6.00 / 1,000 successful api requests

Go to Apify Store
OpenRouter Ultra – Fix Broken JSON & Structured Output

OpenRouter Ultra – Fix Broken JSON & Structured Output

Stop dealing with broken JSON from LLMs. OpenRouter Ultra delivers reliable structured outputs from text or datasets using automatic retries, fallback models, and built-in repair. Get predictable costs and production-ready results for batch processing at scale.

Pricing

from $6.00 / 1,000 successful api requests

Rating

0.0

(0)

Developer

Chris

Chris

Maintained by Community

Actor stats

1

Bookmarked

2

Total users

1

Monthly active users

9 hours ago

Last modified

Share

🚀 OpenRouter Ultra V1.1

A production-ready AI gateway built for reliability, structured outputs, and cost-efficient LLM workflows.

OpenRouter Ultra is not just another proxy. It is an intelligent execution layer on top of OpenRouter that makes AI responses usable in real-world systems.


⚡ Why OpenRouter Ultra?

Most LLM APIs break in production because of:

  • ❌ invalid JSON
  • ❌ inconsistent outputs
  • ❌ high token costs
  • ❌ unpredictable latency
  • ❌ no observability

Ultra solves this.


🧠 What makes Ultra different

✅ Reliable Structured Outputs

Ultra includes a multi-stage repair + validation pipeline:

  • removes prose and markdown wrappers
  • fixes quotes and trailing commas
  • balances brackets
  • enforces JSON schema

→ You get usable data instead of broken responses


⚡ Smart Routing (Speed, Cost, Quality)

Ultra automatically selects the best model based on:

  • task type (chat, extraction, coding, etc.)
  • latency targets
  • cost constraints

Available presets:

  • ultra-fast → lowest latency
  • ultra-smart → best quality
  • ultra-private → privacy-focused
  • ultra-json → structured output optimized
  • ultra-batch → high-throughput processing

💸 Cost & Budget Control

Set limits directly in your request:

  • max cost per request
  • max tokens
  • model fallback strategies

→ prevents runaway LLM costs in production


🔍 Full Observability

Every request returns:

  • latency
  • selected model
  • routing decisions
  • repair status
  • estimated cost

Plus debug endpoints:

  • /v1/request/:id
  • /v1/debug/:id

🧪 Built-in Repair Engine

Ultra automatically fixes common LLM issues:

  • missing quotes in JSON
  • invalid syntax
  • trailing commas
  • broken structures

→ dramatically reduces parsing failures


🔁 Optional TOON Format (Token Optimized)

Ultra supports an alternative format for structured data:

  • less verbose than JSON
  • fewer tokens for tabular data
  • easier for LLMs to generate correctly
Content-Type: text/plain
inputFormat: "toon"
outputFormat: "toon"

Use when working with large structured payloads or batch jobs.


🧩 API Overview

Base Endpoint

POST /v1/ultra

Example Request

{
"input": "Extract name and age from: John is 32 years old",
"mode": "ultra-extract",
"jsonSchema": {
"type": "object",
"properties": {
"name": { "type": "string" },
"age": { "type": "number" }
}
}
}

Example Response

{
"success": true,
"data": {
"name": "John",
"age": 32
},
"meta": {
"latencyMs": 842,
"model": "anthropic/claude-3-haiku",
"costUsd": 0.0021,
"repairApplied": true
}
}

🔧 Specialized Endpoints

EndpointDescription
/v1/ultraMain intelligent routing endpoint
/v1/extractStructured data extraction
/v1/convertFormat conversion (JSON ↔ TOON)
/v1/repairFix broken LLM outputs
/v1/request/:idRetrieve past request
/v1/debug/:idDebug full pipeline

🧠 Core Concepts

1. Ultra Modes

Define how the system behaves:

  • speed vs quality vs cost
  • structured vs freeform
  • batch vs realtime

2. Repair Pipeline

Every response passes through:

  1. cleanup
  2. syntax fixing
  3. structure repair
  4. schema validation

3. Task Awareness

Ultra detects intent:

  • extraction
  • summarization
  • chat
  • coding

→ routes to optimal model chain


📦 Use Cases

  • AI-powered SaaS backends
  • data extraction pipelines
  • automation workflows
  • marketplaces & platforms
  • batch processing jobs
  • agent systems

🚀 Why this matters

Most developers spend hours fixing:

  • broken JSON
  • inconsistent outputs
  • model switching logic

Ultra handles this automatically.

→ You focus on your product → Ultra handles the AI complexity


🔑 Authentication

Use your OpenRouter API key:

$Authorization: Bearer YOUR_OPENROUTER_KEY

⚙️ Running on Apify

This actor runs as a serverless AI gateway:

  • scalable
  • production-ready
  • easy to integrate
  • supports batch + realtime

🤝 Contributing / Feedback

If you're building serious AI systems, feedback is welcome.


⚡ TL;DR

OpenRouter Ultra turns:

LLM output → broken JSON → debugging hell

into:

LLM output → validated structured data → production-ready