# PQS: Prompt Quality Score

> PQS: Prompt Quality Score is a paid API for AI agents from api.relai.fi, paid per call via x402, $0.001000/call, status unknown (last checked 2026-09-15).

Scores a prompt's quality using a composite of PEEM, RAGAS, and G-Eval frameworks, returning sub-scores and a verdict to filter weak prompts before expensive inference calls.

## Facts

- Endpoint: GET https://api.relai.fi/relay/1779373065272/api/pqs-grade
- Price: $0.001000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pqs-prompt-quality-score-3b8c30af
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NqphBV--Ncez3qPmMdSjs

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability pqs-prompt-quality-score-3b8c30af
```

Example prompt: Before sending this to the model, can you run a PQS quality grade on my prompt — 'Explain the architecture of a microservices system with a focus on fault tolerance' — using the software vertical, so we know if it's strong enough to be worth the inference cost?

## When to prefer this

Use this endpoint as a cheap pre-flight filter ($0.001) before calling any expensive LLM inference API. Ideal when you want to avoid wasting budget on poorly formed prompts, or when building pipelines where prompt quality must meet a threshold before proceeding. Prefer this over manual prompt review when operating at scale or in automated agentic workflows.

## Known failure modes

- prompt text is empty or exceeds 10,000 characters — returns validation error
- unsupported vertical value — returns enum validation error
- network timeout or upstream service unavailability — returns 5xx error
- payment not fulfilled (x402) — returns 402 Payment Required

## How this service works

Quick pre-flight quality score: composite + three framework sub-scores (PEEM, RAGAS, G-Eval) + verdict. Designed to run upstream of any other paid call to filter weak prompts before inference.

## Output

Returns a composite quality score, three framework sub-scores (PEEM, RAGAS, G-Eval), and a pass/fail verdict indicating whether the prompt is strong enough to proceed to inference.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "prompt": {
   "type": "string",
   "maxLength": 10000,
   "minLength": 1,
   "description": "Prompt text to grade (1-10000 chars)"
  },
  "vertical": {
   "enum": [
    "software",
    "content",
    "business",
    "education",
    "science",
    "crypto",
    "general",
    "research"
   ],
   "type": "string",
   "default": "general",
   "description": "Optional domain: software/content/business/education/science/crypto/general/research"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pqs-prompt-quality-score-3b8c30af/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.relai.fi](https://www.zero.xyz/host/api.relai.fi/llms.txt)
