Skip to main content
POST
/
openai
/
parse-criteria
{
  "parsed_criteria": [
    {
      "name": "<string>",
      "description": "<string>",
      "suggested_weight": 123,
      "suggested_thresholds": {
        "excellent": 123,
        "good": 123,
        "fair": 123,
        "poor": 123
      },
      "examples": [
        {}
      ]
    }
  ],
  "parsing_confidence": 123,
  "suggestions": [
    {}
  ],
  "tokens_used": 123
}

Overview

Uses OpenAI to parse natural language descriptions into structured evaluation criteria. This endpoint helps convert human-readable requirements into the formal criteria structure needed for judge creation.

Request Body

description
string
required
Natural language description of evaluation criteria
content_type
string
required
Type of content these criteria will evaluate
  • text - Text content
  • video - Video content
  • audio - Audio content
  • image - Image content
parsing_options
object
Options for criteria parsing

Response

parsed_criteria
array
required
Extracted criteria from the description
parsing_confidence
number
required
Confidence in the parsing accuracy (0.0 to 1.0)
suggestions
array
Suggestions for improving the criteria
tokens_used
integer
required
Number of OpenAI tokens consumed

Examples

curl -X POST https://api.judge.example.com/openai/parse-criteria \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "I need to evaluate blog posts for quality. They should be well-written with clear structure, factually accurate, engaging for readers, and include proper grammar and spelling. The content should be original and provide value to the target audience.",
    "content_type": "text",
    "parsing_options": {
      "max_criteria_count": 6,
      "include_weights": true,
      "include_thresholds": true
    }
  }'