---
title: "Score a prompt"
method: POST
path: "/prompt-scoring/score"
tags: ["Prompt Scoring"]
---

# Score a prompt

`POST /prompt-scoring/score`

Scores an agent's prompt across 11 quality dimensions using Gemini-based analysis. Requires the prompt to have changed since the last scoring.

**Input:** Provide exactly one of `versionId` (published agent version) or `draftId` (agent draft). Providing both or neither returns a 400.

**Credit usage:** 1 credit is deducted per successful call.

**Idempotency:** Re-submitting the same prompt without changes returns a 400 — retrieve the cached score via the GET agent endpoint instead.

**Supported agent types:** Only `single_prompt` agents are supported. Workflow-graph agents return a 400.

**Scoring model:** Two sequential Gemini calls — a Platform Analyst pass followed by a Rubric Judge pass.

### Scored Dimensions

| Tier | Dimension | Notes |
|------|-----------|-------|
| 1 | Role & Objective | |
| 1 | Personality & Voice | |
| 1 | Conversation Structure | |
| 1 | Tool Integration | |
| 1 | Constraints & Safety | |
| 2 | Conversational Naturalness | |
| 2 | Failure-Mode Coverage | |
| 3 | Information Integrity | Gating — if Weak/Missing, score capped at 70 |
| 3 | Variable & Tool Hygiene | Gating — if Weak/Missing, score capped at 50 |
| 3 | Internal Consistency | |
| 3 | Density | Computed from token analysis |

## Request body

- union — Exactly one of `versionId` or `draftId` must be provided.
  - object
    - `versionId` string, required — Published agent version ID (MongoDB ObjectId).
  - object
    - `draftId` string, required — Agent draft ID (MongoDB ObjectId).

## Response `200`

Prompt scored successfully

- object
  - `status` boolean
  - `data` object
    - `overall_score` integer — 0–100 quality score.
    - `overall_grade` 'Excellent' | 'Good' | 'Needs Work' | 'Poor' — Human-readable grade.
    - `band` 'lean' | 'normal' | 'heavy' | 'overweight' — Token density band based on prompt length: - `lean` — fewer than 4K tokens - `normal` — 4K–9.9K tokens - `heavy` — 10K–14.9K tokens - `overweight` — 15K or more tokens
    - `estimated_ttft_overhead_ms` number — Estimated first-token latency overhead in milliseconds introduced by the prompt length.
    - `dimensions` object[] — Per-dimension scoring results across 11 quality dimensions.
      - `tier` 1 | 2 | 3 — Priority tier: 1 (highest), 2, or 3.
      - `level` 'Strong' | 'Adequate' | 'Weak' | 'Missing' | 'Not Applicable' — Quality level for this dimension.
      - `evidence_span` string — Quote from the prompt supporting the assessment. Empty string if no relevant content was found.
      - `title` string — Short dimension name.
      - `description` string — Explanation of the score for this dimension.

## Other responses

- `400` — Bad request. Possible reasons: - Neither or both of `versionId`/`draftId` provided - Organization has no credits available - Agent is a conversational/workflow-graph type (not supported) - Prompt unchanged since last scoring — retrieve the existing score via GET agent - No prompt found on the version or draft
- `401` — Unauthorized access
- `403` — Not a member of the organization or insufficient role (minimum Member required).
- `404` — Version or draft not found.
- `429` — Rate limit exceeded.
- `500` — Gemini scoring failed after retries.

---

[API](https://skmtc.net/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.net/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/revisions/274a178284a4/schema)
