PROMPT ENHANCEMENT API

Your prompts leave too much to guesswork.

BetterQuery adds the missing context — intent, scope, tone, constraints — before the model ever sees the query. One API call, measurably better results.

Why it exists

Intent-aware routing so prompts are transformed by the right skill.

Safety defaults

Quality gates, graceful fallbacks, and explicit failure modes.

Built to scale

Semantic cache + REST + MCP + browser extension distribution.

WHAT YOU TYPED

Write a blog post about AI

WHAT THE MODEL RECEIVES

writing

Write a 1,200-word technical blog post for senior engineers on how transformer attention enables in-context learning. Cover: why attention differs from earlier sequence models, what "emergent" capability means mechanistically, and 3 concrete implications for prompt design. Use specific examples. No hype. Direct tone.

01

Skill routing

Queries are classified by intent: code, writing, explanation, debugging. Each skill applies its own enhancement logic — a code question gets different treatment than a creative request.

02

Semantic cache

Similar queries reuse prior enhancements via pgvector cosine similarity. Distinct enough to need a new result. Close enough to reuse an old one. The threshold is configurable per key.

03

Drop-in API

One POST, one response. Works in front of every chat and API integration flow. Returns the enhanced prompt alongside the original so you keep full control over what gets sent.

POST /api/v1/enhance
const res = await fetch("https://api.betterquery.dev/api/v1/enhance")

// response shape
{ data: {
  enhanced,   // the improved prompt
  selectedSkill,  // "writing" | "code" | "debugging" | ...
  cacheHit,      // true if served from semantic cache
  latencyMs,    // end-to-end ms
} }

Works everywhere

Enhance prompts from your coding tools, AI chat interfaces, or any HTTP client.

01

MCP Server

Works with Claude Code, Cursor, VS Code, Gemini CLI, and any MCP-compatible client.

"betterquery": {
  "command": "npx",
  "args": ["-y", "@cdli-ai/betterquery-mcp"],
  "env": {
    "BETTERQUERY_API_KEY": "bq_live_..."
  }
}

02

Browser Extension

One-click enhancement on ChatGPT, Claude, and Gemini. Floating button appears in any text input.

Coming to Chrome Web Store

03

REST API

Direct HTTP access from any language. One endpoint, one API key, structured JSON response.

curl -X POST \
  betterquery.app/api/v1/enhance \
  -H "X-API-Key: bq_live_..." \
  -d '{"query": "your prompt"}'

Pricing

Free

$0
  • 500 enhancements / month
  • 1 API key
  • BetterQuery Light
  • Exact-match cache
  • 2 hours session memory
  • No overage
  • Community support
Start free

Pro

$12/mo
  • 20,000 enhancements / month
  • 5 API keys
  • BetterQuery Pro
  • Semantic cache
  • 1 day session memory
  • Overage at $0.008/req
  • Email support
Coming soon

Growth

$29/mo
  • 100,000 enhancements / month
  • Unlimited API keys
  • BetterQuery Pro
  • Semantic cache
  • 7 days session memory
  • Overage at $0.005/req
  • Priority support
Coming soon

All plans include API key management, usage analytics, and data export. Paid plans include overage details when the monthly quota is exceeded.

Paid plans launching soon — all features available on the free tier during early access.

Research

We publish practical product and model-behavior research in a copy-ready format for the team.

Prism + OpenAI LaTeX Editor

A starting research document for evaluating the editing and prompt-assist workflow with LaTeX-based workflows.

Open research hub

Package reference

MCP package is published to npm as:

@cdli-ai/betterquery-mcpView package on npm →