{
  "components": {
    "schemas": {
      "AnswerKeyDraftRequest": {
        "additionalProperties": false,
        "description": "Draft the Answer Key for one binding of a Question.",
        "properties": {
          "answer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "An expert's reference answer. Without one the drafter writes it from the corpus (`use_drafter`).",
            "title": "Answer"
          },
          "answer_key_id": {
            "anyOf": [
              {
                "pattern": "^[a-z0-9][a-z0-9-]{1,62}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your own id for the Answer Key. Omitted: minted. A draft Question's first Answer Key is the Question's own draft, named as its id without `Q-`.",
            "title": "Answer Key Id"
          },
          "binding": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "A value for each required slot.",
            "title": "Binding",
            "type": "object"
          },
          "use_drafter": {
            "default": false,
            "description": "True: the drafter proposes the rubric (one model call, two when it also writes the answer), budgeted. False (the default): a one-criterion skeleton from `answer`, free.",
            "title": "Use Drafter",
            "type": "boolean"
          }
        },
        "title": "AnswerKeyDraftRequest",
        "type": "object"
      },
      "AnswerKeyDraftResult": {
        "additionalProperties": true,
        "properties": {
          "agent_drafted": {
            "default": false,
            "title": "Agent Drafted",
            "type": "boolean"
          },
          "answer_key_id": {
            "title": "Answer Key Id",
            "type": "string"
          },
          "citations": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Each criterion's citations; null unless the caller may see rubrics.",
            "title": "Citations"
          },
          "estimate_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the drafter calls were priced at; null when no model was called.",
            "title": "Estimate Usd"
          },
          "rubric": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null unless the caller may see rubrics.",
            "title": "Rubric"
          },
          "store_commit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Store Commit"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "answer_key_id",
          "version"
        ],
        "title": "AnswerKeyDraftResult",
        "type": "object"
      },
      "AnswerKeySaveRequest": {
        "additionalProperties": false,
        "description": "A whole rubric for an Answer Key's draft.",
        "properties": {
          "change_reason": {
            "default": "",
            "description": "Needed when the Answer Key is approved, since saving makes a new version: `<kind>` or `<kind>: <note>`.",
            "title": "Change Reason",
            "type": "string"
          },
          "rubric": {
            "additionalProperties": true,
            "description": "The rubric as `GET /questions/{question_id}` returns it to a Curator (`answer_keys[].rubric`): criteria, verdicts, `gold`, `gold_when`, penalties. Its id, version, binding and Question are the server's.",
            "title": "Rubric",
            "type": "object"
          }
        },
        "required": [
          "rubric"
        ],
        "title": "AnswerKeySaveRequest",
        "type": "object"
      },
      "AnswerKeySaveResult": {
        "additionalProperties": true,
        "properties": {
          "answer_key_id": {
            "title": "Answer Key Id",
            "type": "string"
          },
          "content_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Sha"
          },
          "store_commit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Store Commit"
          },
          "validation": {
            "additionalProperties": true,
            "description": "`ok`, `errors` and each criterion's `citations`: why approval would refuse it yet.",
            "title": "Validation",
            "type": "object"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "answer_key_id",
          "version"
        ],
        "title": "AnswerKeySaveResult",
        "type": "object"
      },
      "AnswerKeySummary": {
        "additionalProperties": true,
        "properties": {
          "answer_key_id": {
            "title": "Answer Key Id",
            "type": "string"
          },
          "approved_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved At"
          },
          "approved_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved By"
          },
          "binding": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Binding",
            "type": "object"
          },
          "binding_key": {
            "title": "Binding Key",
            "type": "string"
          },
          "content_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Sha"
          },
          "drafted_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Drafted By"
          },
          "is_draft": {
            "title": "Is Draft",
            "type": "boolean"
          },
          "rubric": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null unless the caller may see rubrics.",
            "title": "Rubric"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "answer_key_id",
          "version",
          "is_draft",
          "status",
          "binding_key"
        ],
        "title": "AnswerKeySummary",
        "type": "object"
      },
      "AnswerTuple": {
        "additionalProperties": false,
        "description": "What produced the answers, so scores are only compared with like (the comparability tuple).",
        "properties": {
          "brain_version": {
            "title": "Brain Version",
            "type": "string"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "ref": {
            "enum": [
              "draft",
              "published"
            ],
            "title": "Ref",
            "type": "string"
          },
          "seed": {
            "title": "Seed",
            "type": "string"
          }
        },
        "required": [
          "model",
          "brain_version",
          "ref",
          "seed"
        ],
        "title": "AnswerTuple",
        "type": "object"
      },
      "Approval": {
        "additionalProperties": true,
        "properties": {
          "answer_key_id": {
            "title": "Answer Key Id",
            "type": "string"
          },
          "approver": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approver"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "decided_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided At"
          },
          "decided_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided By"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "note": {
            "default": "",
            "title": "Note",
            "type": "string"
          },
          "requested_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested By"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected",
              "withdrawn",
              "expired",
              "superseded"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "answer_key_id",
          "status"
        ],
        "title": "Approval",
        "type": "object"
      },
      "ApproveRequest": {
        "additionalProperties": false,
        "description": "Approving with a Curator or Admin key (scope ``answer_key:approve``). The audit records the key.",
        "properties": {
          "note": {
            "default": "",
            "description": "Recorded with the approval in the audit log.",
            "title": "Note",
            "type": "string"
          }
        },
        "title": "ApproveRequest",
        "type": "object"
      },
      "ApproveResult": {
        "additionalProperties": true,
        "properties": {
          "answer_key_id": {
            "title": "Answer Key Id",
            "type": "string"
          },
          "api_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Id"
          },
          "approved_by": {
            "title": "Approved By",
            "type": "string"
          },
          "commit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commit"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "answer_key_id",
          "approved_by"
        ],
        "title": "ApproveResult",
        "type": "object"
      },
      "Budget": {
        "additionalProperties": true,
        "properties": {
          "brain_id": {
            "title": "Brain Id",
            "type": "string"
          },
          "max_runs_per_call": {
            "title": "Max Runs Per Call",
            "type": "integer"
          },
          "monthly_usd": {
            "title": "Monthly Usd",
            "type": "number"
          },
          "remaining_usd": {
            "title": "Remaining Usd",
            "type": "number"
          },
          "spent_usd_this_month": {
            "title": "Spent Usd This Month",
            "type": "number"
          }
        },
        "required": [
          "brain_id",
          "monthly_usd",
          "max_runs_per_call",
          "spent_usd_this_month",
          "remaining_usd"
        ],
        "title": "Budget",
        "type": "object"
      },
      "Certification": {
        "additionalProperties": true,
        "description": "A binding certified at a brain version: the evidence runs and, where sign-off applies, who signed.",
        "properties": {
          "answer_key_id": {
            "title": "Answer Key Id",
            "type": "string"
          },
          "answer_key_version": {
            "title": "Answer Key Version",
            "type": "integer"
          },
          "binding_key": {
            "title": "Binding Key",
            "type": "string"
          },
          "brain_version": {
            "title": "Brain Version",
            "type": "string"
          },
          "computed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Computed At"
          },
          "evidence_run_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Evidence Run Ids",
            "type": "array"
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          },
          "question_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Version"
          },
          "signed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed At"
          },
          "signed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed By"
          },
          "standing": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standing"
          },
          "threshold": {
            "additionalProperties": true,
            "title": "Threshold",
            "type": "object"
          }
        },
        "required": [
          "question_id",
          "binding_key",
          "answer_key_id",
          "answer_key_version",
          "brain_version"
        ],
        "title": "Certification",
        "type": "object"
      },
      "CertifiedBindings": {
        "additionalProperties": true,
        "properties": {
          "brain_id": {
            "title": "Brain Id",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Certification"
            },
            "title": "Items",
            "type": "array"
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          }
        },
        "required": [
          "brain_id",
          "question_id"
        ],
        "title": "CertifiedBindings",
        "type": "object"
      },
      "ChatCompletionRequest": {
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            },
            "title": "Messages",
            "type": "array"
          },
          "model": {
            "default": "polaris-advisor",
            "title": "Model",
            "type": "string"
          },
          "polaris": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PolarisRequestExt"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "response_format": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResponseFormat"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "route_resume": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Route Resume"
          },
          "stream": {
            "default": false,
            "title": "Stream",
            "type": "boolean"
          },
          "stream_options": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamOptions"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "topic_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Topic Ids"
          }
        },
        "required": [
          "messages"
        ],
        "title": "ChatCompletionRequest",
        "type": "object"
      },
      "ChatMessage": {
        "properties": {
          "content": {
            "default": "",
            "title": "Content",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role"
        ],
        "title": "ChatMessage",
        "type": "object"
      },
      "Comparability": {
        "additionalProperties": true,
        "description": "The comparability tuple (DEE-143 G12): two scores compare only when every field matches.",
        "properties": {
          "answer_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer Key Id"
          },
          "answer_key_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer Key Version"
          },
          "brain_version": {
            "title": "Brain Version",
            "type": "string"
          },
          "content_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Sha"
          },
          "judge_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Judge Model"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "question_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Id"
          },
          "question_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Version"
          },
          "ref": {
            "enum": [
              "draft",
              "published",
              "offline"
            ],
            "title": "Ref",
            "type": "string"
          },
          "rubric_approved": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rubric Approved"
          },
          "seed": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "source": {
            "enum": [
              "reference",
              "file",
              "live",
              "external"
            ],
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "brain_version",
          "model",
          "ref",
          "source"
        ],
        "title": "Comparability",
        "type": "object"
      },
      "CostEstimate": {
        "additionalProperties": true,
        "description": "What a paid action would cost, before it runs.",
        "properties": {
          "allowed": {
            "title": "Allowed",
            "type": "boolean"
          },
          "estimate_usd": {
            "title": "Estimate Usd",
            "type": "number"
          },
          "monthly_usd": {
            "title": "Monthly Usd",
            "type": "number"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "remaining_usd": {
            "title": "Remaining Usd",
            "type": "number"
          }
        },
        "required": [
          "estimate_usd",
          "remaining_usd",
          "monthly_usd",
          "allowed"
        ],
        "title": "CostEstimate",
        "type": "object"
      },
      "CoverageCheck": {
        "additionalProperties": true,
        "properties": {
          "answer_keys": {
            "items": {
              "type": "string"
            },
            "title": "Answer Keys",
            "type": "array"
          },
          "binding": {
            "description": "The canonical binding key; empty for a zero-slot Question.",
            "title": "Binding",
            "type": "string"
          },
          "brain_id": {
            "title": "Brain Id",
            "type": "string"
          },
          "corpus_empty": {
            "title": "Corpus Empty",
            "type": "boolean"
          },
          "held": {
            "default": 0,
            "title": "Held",
            "type": "integer"
          },
          "missing": {
            "items": {
              "type": "string"
            },
            "title": "Missing",
            "type": "array"
          },
          "provisions": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Provisions",
            "type": "array"
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          },
          "required": {
            "default": 0,
            "title": "Required",
            "type": "integer"
          },
          "status": {
            "enum": [
              "covered",
              "gap",
              "undeclared"
            ],
            "title": "Status",
            "type": "string"
          },
          "unroutable_criteria": {
            "default": 0,
            "title": "Unroutable Criteria",
            "type": "integer"
          }
        },
        "required": [
          "question_id",
          "binding",
          "status",
          "brain_id",
          "corpus_empty"
        ],
        "title": "CoverageCheck",
        "type": "object"
      },
      "CoverageMatrix": {
        "additionalProperties": true,
        "properties": {
          "brain_id": {
            "title": "Brain Id",
            "type": "string"
          },
          "corpus_empty": {
            "title": "Corpus Empty",
            "type": "boolean"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/CoverageRow"
            },
            "title": "Rows",
            "type": "array"
          },
          "summary": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Summary",
            "type": "object"
          }
        },
        "required": [
          "brain_id",
          "corpus_empty"
        ],
        "title": "CoverageMatrix",
        "type": "object"
      },
      "CoverageRow": {
        "additionalProperties": true,
        "description": "Whether the published corpus holds what one Question at one binding needs.",
        "properties": {
          "answer_keys": {
            "items": {
              "type": "string"
            },
            "title": "Answer Keys",
            "type": "array"
          },
          "binding": {
            "description": "The canonical binding key; empty for a zero-slot Question.",
            "title": "Binding",
            "type": "string"
          },
          "held": {
            "default": 0,
            "title": "Held",
            "type": "integer"
          },
          "missing": {
            "items": {
              "type": "string"
            },
            "title": "Missing",
            "type": "array"
          },
          "provisions": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Provisions",
            "type": "array"
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          },
          "required": {
            "default": 0,
            "title": "Required",
            "type": "integer"
          },
          "status": {
            "enum": [
              "covered",
              "gap",
              "undeclared"
            ],
            "title": "Status",
            "type": "string"
          },
          "unroutable_criteria": {
            "default": 0,
            "title": "Unroutable Criteria",
            "type": "integer"
          }
        },
        "required": [
          "question_id",
          "binding",
          "status"
        ],
        "title": "CoverageRow",
        "type": "object"
      },
      "ErrorBody": {
        "properties": {
          "code": {
            "description": "Stable machine-readable code, e.g. `feature_disabled`.",
            "title": "Code",
            "type": "string"
          },
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "ErrorBody",
        "type": "object"
      },
      "ErrorResponse": {
        "description": "Every refusal, as the gateway sends it (`/chat/completions` uses the OpenAI format instead).",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorBody"
          }
        },
        "required": [
          "error"
        ],
        "title": "ErrorResponse",
        "type": "object"
      },
      "EvalResult": {
        "additionalProperties": true,
        "description": "One scored answer in a run. Rubric detail only for a caller who may see rubrics.",
        "properties": {
          "capped": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "For callers without the rubric role.",
            "title": "Capped"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "full_credit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Credit"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "ok": {
            "title": "Ok",
            "type": "boolean"
          },
          "run_id": {
            "title": "Run Id",
            "type": "integer"
          },
          "run_index": {
            "title": "Run Index",
            "type": "integer"
          },
          "share": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Share"
          },
          "verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verdict"
          }
        },
        "required": [
          "id",
          "run_id",
          "run_index",
          "ok"
        ],
        "title": "EvalResult",
        "type": "object"
      },
      "EvalRun": {
        "additionalProperties": true,
        "description": "One eval run: its tuple, provenance, standing and cost. Never answer text or the rubric.",
        "properties": {
          "answer_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer Key Id"
          },
          "answer_key_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer Key Version"
          },
          "api_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Id"
          },
          "binding_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Binding Key"
          },
          "brain_id": {
            "title": "Brain Id",
            "type": "string"
          },
          "brain_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brain Version"
          },
          "content_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Sha"
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "end_customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Customer Id"
          },
          "external_run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Run Id"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "judge_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Judge Model"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "question_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Id"
          },
          "question_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Version"
          },
          "ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ref"
          },
          "rubric_approved": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rubric Approved"
          },
          "seed": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "standing": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standing"
          },
          "submitted_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitted By"
          }
        },
        "required": [
          "id",
          "brain_id"
        ],
        "title": "EvalRun",
        "type": "object"
      },
      "EvalRunDetail": {
        "additionalProperties": true,
        "description": "A run with its results. Each result's ``id`` is what ``POST /eval-results/{id}/grades`` takes.",
        "properties": {
          "answer_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer Key Id"
          },
          "answer_key_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer Key Version"
          },
          "api_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Id"
          },
          "binding_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Binding Key"
          },
          "brain_id": {
            "title": "Brain Id",
            "type": "string"
          },
          "brain_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brain Version"
          },
          "content_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Sha"
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "end_customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Customer Id"
          },
          "external_run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Run Id"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "judge_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Judge Model"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "question_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Id"
          },
          "question_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Version"
          },
          "ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ref"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/EvalResult"
            },
            "title": "Results",
            "type": "array"
          },
          "rubric_approved": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rubric Approved"
          },
          "seed": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "standing": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standing"
          },
          "submitted_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitted By"
          }
        },
        "required": [
          "id",
          "brain_id"
        ],
        "title": "EvalRunDetail",
        "type": "object"
      },
      "GradeRequest": {
        "additionalProperties": false,
        "description": "``POST /eval-results/{rid}/grades``: a named person's grade on one criterion.",
        "properties": {
          "criterion": {
            "title": "Criterion",
            "type": "string"
          },
          "grader": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Must be the key's own actor, or omitted.",
            "title": "Grader"
          },
          "note": {
            "default": "",
            "title": "Note",
            "type": "string"
          },
          "satisfied": {
            "title": "Satisfied",
            "type": "boolean"
          }
        },
        "required": [
          "criterion",
          "satisfied"
        ],
        "title": "GradeRequest",
        "type": "object"
      },
      "GradeResult": {
        "additionalProperties": true,
        "description": "The graded result, rescored, and its run's new standing.",
        "properties": {
          "capped": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "For callers without the rubric role.",
            "title": "Capped"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "full_credit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Credit"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "ok": {
            "title": "Ok",
            "type": "boolean"
          },
          "run_id": {
            "title": "Run Id",
            "type": "integer"
          },
          "run_index": {
            "title": "Run Index",
            "type": "integer"
          },
          "run_standing": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Standing"
          },
          "share": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Share"
          },
          "tuple": {
            "$ref": "#/components/schemas/Comparability"
          },
          "verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verdict"
          }
        },
        "required": [
          "id",
          "run_id",
          "run_index",
          "ok",
          "tuple"
        ],
        "title": "GradeResult",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "JudgeAgreement": {
        "additionalProperties": true,
        "properties": {
          "brain_id": {
            "title": "Brain Id",
            "type": "string"
          },
          "criteria": {
            "items": {
              "$ref": "#/components/schemas/JudgeAgreementRow"
            },
            "title": "Criteria",
            "type": "array"
          }
        },
        "required": [
          "brain_id"
        ],
        "title": "JudgeAgreement",
        "type": "object"
      },
      "JudgeAgreementRow": {
        "additionalProperties": true,
        "description": "How often the judge agreed with people on one criterion (named by key, never its wording).",
        "properties": {
          "agreed": {
            "title": "Agreed",
            "type": "integer"
          },
          "answer_key_id": {
            "title": "Answer Key Id",
            "type": "string"
          },
          "both": {
            "title": "Both",
            "type": "integer"
          },
          "criterion": {
            "title": "Criterion",
            "type": "string"
          },
          "judge_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Judge Model"
          },
          "rate": {
            "title": "Rate",
            "type": "number"
          }
        },
        "required": [
          "answer_key_id",
          "criterion",
          "both",
          "agreed",
          "rate"
        ],
        "title": "JudgeAgreementRow",
        "type": "object"
      },
      "MatchCandidate": {
        "additionalProperties": true,
        "properties": {
          "question_id": {
            "title": "Question Id",
            "type": "string"
          },
          "score": {
            "title": "Score",
            "type": "number"
          },
          "topic": {
            "default": "",
            "title": "Topic",
            "type": "string"
          }
        },
        "required": [
          "question_id",
          "score"
        ],
        "title": "MatchCandidate",
        "type": "object"
      },
      "MatchRequest": {
        "additionalProperties": false,
        "properties": {
          "question": {
            "description": "The question as a person asked it.",
            "minLength": 1,
            "title": "Question",
            "type": "string"
          },
          "topic_ids": {
            "description": "Topic card ids to narrow to first (the caller's classifier).",
            "items": {
              "type": "string"
            },
            "title": "Topic Ids",
            "type": "array"
          }
        },
        "required": [
          "question"
        ],
        "title": "MatchRequest",
        "type": "object"
      },
      "MatchResult": {
        "additionalProperties": true,
        "description": "Which published Question an ask is, if any. ``binding`` holds the slot values the ask states;\ncheck ``binding_problems`` before using it, and never bind on ``uncertain``.",
        "properties": {
          "binding": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Binding",
            "type": "object"
          },
          "binding_problems": {
            "items": {
              "type": "string"
            },
            "title": "Binding Problems",
            "type": "array"
          },
          "candidates": {
            "items": {
              "$ref": "#/components/schemas/MatchCandidate"
            },
            "title": "Candidates",
            "type": "array"
          },
          "question_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Id"
          },
          "scoped_to": {
            "description": "The topic ids the match was narrowed to.",
            "items": {
              "type": "string"
            },
            "title": "Scoped To",
            "type": "array"
          },
          "status": {
            "enum": [
              "matched",
              "uncertain",
              "none"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "MatchResult",
        "type": "object"
      },
      "Page_Approval_": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Approval"
            },
            "title": "Items",
            "type": "array"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "required": [
          "items"
        ],
        "title": "Page[Approval]",
        "type": "object"
      },
      "Page_EvalRun_": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/EvalRun"
            },
            "title": "Items",
            "type": "array"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "required": [
          "items"
        ],
        "title": "Page[EvalRun]",
        "type": "object"
      },
      "Page_QuestionSummary_": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/QuestionSummary"
            },
            "title": "Items",
            "type": "array"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "required": [
          "items"
        ],
        "title": "Page[QuestionSummary]",
        "type": "object"
      },
      "PolarisRequestExt": {
        "description": "Polaris-specific request options, mirroring the ``polaris`` object on the response.",
        "properties": {
          "route_resume": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Route Resume"
          },
          "topic_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Topic Ids"
          }
        },
        "title": "PolarisRequestExt",
        "type": "object"
      },
      "ProposalResult": {
        "additionalProperties": true,
        "properties": {
          "is_draft": {
            "default": true,
            "title": "Is Draft",
            "type": "boolean"
          },
          "next_step": {
            "default": "",
            "title": "Next Step",
            "type": "string"
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          },
          "store_commit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Store Commit"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "question_id",
          "version"
        ],
        "title": "ProposalResult",
        "type": "object"
      },
      "PublishVersionRequest": {
        "additionalProperties": false,
        "description": "Start version N+1 of a published Question; each binding is carried to it as a draft Answer\nKey. Version N stays live until the first of them is approved.",
        "properties": {
          "change_reason": {
            "minLength": 1,
            "title": "Change Reason",
            "type": "string"
          },
          "drop": {
            "description": "Removed slots whose bound values may go.",
            "items": {
              "type": "string"
            },
            "title": "Drop",
            "type": "array"
          },
          "dry_run": {
            "default": false,
            "title": "Dry Run",
            "type": "boolean"
          },
          "fill": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "A value for each added required slot.",
            "title": "Fill",
            "type": "object"
          },
          "slots": {
            "items": {
              "$ref": "#/components/schemas/SlotDecl"
            },
            "title": "Slots",
            "type": "array"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "text",
          "slots",
          "change_reason"
        ],
        "title": "PublishVersionRequest",
        "type": "object"
      },
      "Question": {
        "additionalProperties": true,
        "description": "One Question with its Answer Keys.",
        "properties": {
          "answer_keys": {
            "items": {
              "$ref": "#/components/schemas/AnswerKeySummary"
            },
            "title": "Answer Keys",
            "type": "array"
          },
          "answer_shape": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer Shape"
          },
          "certified_bindings": {
            "description": "Binding keys certified at the published brain version.",
            "items": {
              "type": "string"
            },
            "title": "Certified Bindings",
            "type": "array"
          },
          "intent": {
            "default": "",
            "title": "Intent",
            "type": "string"
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          },
          "required_provisions": {
            "$ref": "#/components/schemas/RequiredProvisions"
          },
          "rubric_visible": {
            "default": false,
            "title": "Rubric Visible",
            "type": "boolean"
          },
          "slots": {
            "items": {
              "$ref": "#/components/schemas/SlotDecl"
            },
            "title": "Slots",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "topic": {
            "default": "",
            "title": "Topic",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "question_id",
          "version",
          "status",
          "text"
        ],
        "title": "Question",
        "type": "object"
      },
      "QuestionProposal": {
        "additionalProperties": false,
        "description": "A new draft Question. Not served, scored or certified until a Curator publishes it.",
        "properties": {
          "answer_shape": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The answer's expected shape, as `GET /questions/{question_id}` returns it.",
            "title": "Answer Shape"
          },
          "intent": {
            "description": "What the asker needs to decide, in a sentence.",
            "minLength": 1,
            "title": "Intent",
            "type": "string"
          },
          "question_id": {
            "anyOf": [
              {
                "pattern": "^Q-[a-z0-9][a-z0-9-]{1,57}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your own id for the Question, for example to keep ids the same across brains. Omitted: minted from the text. `409 conflict` when the brain already has it.",
            "title": "Question Id"
          },
          "required_provisions": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequiredProvisionsInput"
              },
              {
                "type": "null"
              }
            ],
            "description": "The provision keys an answer must cite. Citations in its Answer Keys are added to these as they are drafted."
          },
          "slots": {
            "description": "Each slot as `name`, `name:type` (a slot type's name), or an object `{name, type, required, ask_text, default}` as `GET /questions/{question_id}` returns it.",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/SlotDecl"
                }
              ]
            },
            "title": "Slots",
            "type": "array"
          },
          "text": {
            "description": "As people ask it; a slotted Question names each slot as `{slot}`.",
            "maxLength": 4000,
            "minLength": 1,
            "title": "Text",
            "type": "string"
          },
          "topic": {
            "description": "The topic card it belongs to.",
            "minLength": 1,
            "title": "Topic",
            "type": "string"
          }
        },
        "required": [
          "text",
          "intent",
          "topic"
        ],
        "title": "QuestionProposal",
        "type": "object"
      },
      "QuestionSlots": {
        "additionalProperties": true,
        "description": "A Question's slots: the published version, an open draft version if any, and every binding.",
        "properties": {
          "bindings": {
            "items": {
              "$ref": "#/components/schemas/SlotBinding"
            },
            "title": "Bindings",
            "type": "array"
          },
          "draft": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SlotVersion"
              },
              {
                "type": "null"
              }
            ]
          },
          "published": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SlotVersion"
              },
              {
                "type": "null"
              }
            ]
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          }
        },
        "required": [
          "question_id"
        ],
        "title": "QuestionSlots",
        "type": "object"
      },
      "QuestionSummary": {
        "additionalProperties": true,
        "description": "A published Question, as a list shows it.",
        "properties": {
          "intent": {
            "default": "",
            "title": "Intent",
            "type": "string"
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          },
          "slots": {
            "items": {
              "$ref": "#/components/schemas/SlotDecl"
            },
            "title": "Slots",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "topic": {
            "default": "",
            "title": "Topic",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "question_id",
          "version",
          "status",
          "text"
        ],
        "title": "QuestionSummary",
        "type": "object"
      },
      "RequiredProvisions": {
        "additionalProperties": true,
        "description": "The provisions an answer must cite: ``always``, and more for some bindings (by binding key).",
        "properties": {
          "always": {
            "items": {
              "type": "string"
            },
            "title": "Always",
            "type": "array"
          },
          "by_binding": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "title": "By Binding",
            "type": "object"
          }
        },
        "title": "RequiredProvisions",
        "type": "object"
      },
      "RequiredProvisionsInput": {
        "additionalProperties": false,
        "description": "The provisions an answer must cite: ``always``, and more for some bindings (by binding key).",
        "properties": {
          "always": {
            "items": {
              "type": "string"
            },
            "title": "Always",
            "type": "array"
          },
          "by_binding": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "title": "By Binding",
            "type": "object"
          }
        },
        "title": "RequiredProvisionsInput",
        "type": "object"
      },
      "ResponseFormat": {
        "properties": {
          "type": {
            "default": "text",
            "title": "Type",
            "type": "string"
          }
        },
        "title": "ResponseFormat",
        "type": "object"
      },
      "RunAccepted": {
        "additionalProperties": true,
        "description": "A run has started (it is past every refusal and spending). Poll ``GET /eval-ops/{op_id}``\nuntil ``status`` is ``done``; its ``run_ids`` are then readable at ``GET /eval-runs/{run_id}``.",
        "properties": {
          "estimate_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the run was authorized at.",
            "title": "Estimate Usd"
          },
          "op_id": {
            "title": "Op Id",
            "type": "string"
          },
          "run_ids": {
            "description": "Empty until the run is done.",
            "items": {
              "type": "integer"
            },
            "title": "Run Ids",
            "type": "array"
          },
          "status": {
            "enum": [
              "running",
              "done"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "op_id",
          "status"
        ],
        "title": "RunAccepted",
        "type": "object"
      },
      "RunRequest": {
        "additionalProperties": false,
        "description": "A live eval: the Advisor answers each binding ``runs`` times and Polaris scores the answers.\nBudgeted before any model call (``402 budget_exceeded``, ``400 run_cap_exceeded``).",
        "properties": {
          "answer_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One binding of the Question; else every binding.",
            "title": "Answer Key Id"
          },
          "judge": {
            "default": true,
            "description": "Also grade the judged criteria (more model calls). Without it the judged tier is ungraded and can't certify.",
            "title": "Judge",
            "type": "boolean"
          },
          "max_cost_usd": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Refuse (`402 max_cost_exceeded`) if the estimate is higher.",
            "title": "Max Cost Usd"
          },
          "ref": {
            "default": "draft",
            "description": "`draft` scores the corpus as it stands; only `published` runs can certify the published version.",
            "enum": [
              "draft",
              "published"
            ],
            "title": "Ref",
            "type": "string"
          },
          "runs": {
            "default": 1,
            "description": "Answers per Answer Key; the brain's run cap applies.",
            "minimum": 1.0,
            "title": "Runs",
            "type": "integer"
          }
        },
        "title": "RunRequest",
        "type": "object"
      },
      "RunStatus": {
        "additionalProperties": true,
        "description": "A run started with ``POST /questions/{question_id}/runs``. Visible only to whoever started it.",
        "properties": {
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The current step, in words.",
            "title": "Detail"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "op_id": {
            "title": "Op Id",
            "type": "string"
          },
          "progress": {
            "default": 0.0,
            "title": "Progress",
            "type": "number"
          },
          "result": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The run's report once done: standing per binding, spend, certification changes. Answer text and criteria only for a caller who may see rubrics.",
            "title": "Result"
          },
          "run_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Run Ids",
            "type": "array"
          },
          "status": {
            "enum": [
              "running",
              "done",
              "error"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "op_id",
          "status"
        ],
        "title": "RunStatus",
        "type": "object"
      },
      "SignOffRequest": {
        "additionalProperties": false,
        "properties": {
          "note": {
            "default": "",
            "title": "Note",
            "type": "string"
          }
        },
        "title": "SignOffRequest",
        "type": "object"
      },
      "SignOffResult": {
        "additionalProperties": true,
        "properties": {
          "api_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Id"
          },
          "certification_id": {
            "title": "Certification Id",
            "type": "integer"
          },
          "signed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed At"
          },
          "signed_by": {
            "title": "Signed By",
            "type": "string"
          }
        },
        "required": [
          "certification_id",
          "signed_by"
        ],
        "title": "SignOffResult",
        "type": "object"
      },
      "SlotBinding": {
        "additionalProperties": true,
        "description": "One Answer Key's binding of the Question's slots.",
        "properties": {
          "answer_key_id": {
            "title": "Answer Key Id",
            "type": "string"
          },
          "binding": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Binding",
            "type": "object"
          },
          "binding_key": {
            "title": "Binding Key",
            "type": "string"
          },
          "question_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Version"
          },
          "state": {
            "enum": [
              "draft",
              "approved"
            ],
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "answer_key_id",
          "binding_key",
          "state"
        ],
        "title": "SlotBinding",
        "type": "object"
      },
      "SlotDecl": {
        "additionalProperties": true,
        "description": "One slot of a Question. Only required slots are ``{placeholders}`` in the text.",
        "properties": {
          "ask_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What a person is asked when they leave it unsaid.",
            "title": "Ask Text"
          },
          "default": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional slots only.",
            "title": "Default"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "required": {
            "default": true,
            "title": "Required",
            "type": "boolean"
          },
          "type": {
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type"
        ],
        "title": "SlotDecl",
        "type": "object"
      },
      "SlotEditResult": {
        "additionalProperties": true,
        "properties": {
          "applied": {
            "title": "Applied",
            "type": "boolean"
          },
          "changes": {
            "items": {
              "type": "string"
            },
            "title": "Changes",
            "type": "array"
          },
          "dropping": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Dropping",
            "type": "array"
          },
          "problems": {
            "items": {
              "type": "string"
            },
            "title": "Problems",
            "type": "array"
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          },
          "store_commit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Store Commit"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "title": "Warnings",
            "type": "array"
          }
        },
        "required": [
          "question_id",
          "version",
          "applied"
        ],
        "title": "SlotEditResult",
        "type": "object"
      },
      "SlotType": {
        "additionalProperties": true,
        "properties": {
          "approved_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved By"
          },
          "base": {
            "enum": [
              "enum",
              "string",
              "corpus_ref",
              "number",
              "date"
            ],
            "title": "Base",
            "type": "string"
          },
          "description": {
            "default": "",
            "title": "Description",
            "type": "string"
          },
          "kind": {
            "enum": [
              "parameter",
              "applicability"
            ],
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "namespace": {
            "default": "",
            "title": "Namespace",
            "type": "string"
          },
          "origin": {
            "default": "platform",
            "description": "`platform`, or the brain id for the brain's own types.",
            "title": "Origin",
            "type": "string"
          },
          "proposed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proposed By"
          },
          "provision_key_prefix": {
            "default": "",
            "title": "Provision Key Prefix",
            "type": "string"
          },
          "status": {
            "default": "active",
            "description": "A `proposed` type is unusable until someone other than its proposer approves it.",
            "enum": [
              "active",
              "proposed"
            ],
            "title": "Status",
            "type": "string"
          },
          "values": {
            "description": "An `enum` type's values; else empty.",
            "items": {
              "type": "string"
            },
            "title": "Values",
            "type": "array"
          }
        },
        "required": [
          "name",
          "kind",
          "base"
        ],
        "title": "SlotType",
        "type": "object"
      },
      "SlotTypeApproveRequest": {
        "additionalProperties": false,
        "properties": {
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Recorded in the store's commit message.",
            "title": "Note"
          }
        },
        "title": "SlotTypeApproveRequest",
        "type": "object"
      },
      "SlotTypeProposal": {
        "additionalProperties": false,
        "description": "One of the brain's own slot types, proposed. Unusable until someone else approves it.",
        "properties": {
          "base": {
            "enum": [
              "enum",
              "string",
              "corpus_ref",
              "number",
              "date"
            ],
            "title": "Base",
            "type": "string"
          },
          "description": {
            "minLength": 1,
            "title": "Description",
            "type": "string"
          },
          "kind": {
            "default": "parameter",
            "enum": [
              "parameter",
              "applicability"
            ],
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "pattern": "^[a-z][a-z0-9_]{1,40}$",
            "title": "Name",
            "type": "string"
          },
          "namespace": {
            "description": "How org data is segmented: product, timing…",
            "minLength": 1,
            "title": "Namespace",
            "type": "string"
          },
          "values": {
            "description": "An `enum` type's values.",
            "items": {
              "type": "string"
            },
            "title": "Values",
            "type": "array"
          }
        },
        "required": [
          "name",
          "base",
          "namespace",
          "description"
        ],
        "title": "SlotTypeProposal",
        "type": "object"
      },
      "SlotVersion": {
        "additionalProperties": true,
        "description": "A Question version's text and slots.",
        "properties": {
          "change_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Reason"
          },
          "slots": {
            "items": {
              "$ref": "#/components/schemas/SlotDecl"
            },
            "title": "Slots",
            "type": "array"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "text"
        ],
        "title": "SlotVersion",
        "type": "object"
      },
      "SlotsUpdateRequest": {
        "additionalProperties": false,
        "properties": {
          "drop": {
            "items": {
              "type": "string"
            },
            "title": "Drop",
            "type": "array"
          },
          "dry_run": {
            "default": false,
            "title": "Dry Run",
            "type": "boolean"
          },
          "fill": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Fill",
            "type": "object"
          },
          "slots": {
            "items": {
              "$ref": "#/components/schemas/SlotDecl"
            },
            "title": "Slots",
            "type": "array"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "text",
          "slots"
        ],
        "title": "SlotsUpdateRequest",
        "type": "object"
      },
      "Standing": {
        "additionalProperties": true,
        "description": "A Question's standing over time, oldest first. Points are never averaged across tuples.",
        "properties": {
          "brain_id": {
            "title": "Brain Id",
            "type": "string"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/StandingPoint"
            },
            "title": "Points",
            "type": "array"
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          }
        },
        "required": [
          "brain_id",
          "question_id",
          "points"
        ],
        "title": "Standing",
        "type": "object"
      },
      "StandingPoint": {
        "additionalProperties": true,
        "properties": {
          "at": {
            "title": "At",
            "type": "string"
          },
          "run_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Run Ids",
            "type": "array"
          },
          "standing": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standing"
          },
          "tuple": {
            "$ref": "#/components/schemas/Comparability"
          }
        },
        "required": [
          "at",
          "standing",
          "run_ids",
          "tuple"
        ],
        "title": "StandingPoint",
        "type": "object"
      },
      "StreamOptions": {
        "properties": {
          "include_usage": {
            "default": false,
            "title": "Include Usage",
            "type": "boolean"
          }
        },
        "title": "StreamOptions",
        "type": "object"
      },
      "SubmitAnswersRequest": {
        "additionalProperties": false,
        "description": "``POST /questions/{qid}/answers``. Never send a score: score-like fields are refused.",
        "properties": {
          "answers": {
            "items": {
              "$ref": "#/components/schemas/SubmittedAnswer"
            },
            "title": "Answers",
            "type": "array"
          },
          "end_customer_id": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "End Customer Id"
          },
          "external_run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Your id for the run; a repeat is a 200 duplicate.",
            "title": "External Run Id"
          },
          "judge": {
            "default": false,
            "description": "Also grade judged criteria; needs `eval:run` and spends budget.",
            "title": "Judge",
            "type": "boolean"
          },
          "tuple": {
            "$ref": "#/components/schemas/AnswerTuple"
          }
        },
        "required": [
          "answers",
          "tuple"
        ],
        "title": "SubmitAnswersRequest",
        "type": "object"
      },
      "SubmitAnswersResult": {
        "additionalProperties": true,
        "description": "201 for a new submission; 200 with ``duplicate: true`` when ``external_run_id`` was seen.",
        "properties": {
          "authorization": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authorization"
          },
          "comparability": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comparability"
          },
          "duplicate": {
            "title": "Duplicate",
            "type": "boolean"
          },
          "run_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Run Ids",
            "type": "array"
          },
          "runs": {
            "items": {
              "$ref": "#/components/schemas/SubmittedRun"
            },
            "title": "Runs",
            "type": "array"
          },
          "standing": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standing"
          }
        },
        "required": [
          "duplicate",
          "run_ids"
        ],
        "title": "SubmitAnswersResult",
        "type": "object"
      },
      "SubmittedAnswer": {
        "additionalProperties": false,
        "properties": {
          "answer_key_id": {
            "description": "Which Answer Key of the Question this answers.",
            "title": "Answer Key Id",
            "type": "string"
          },
          "text": {
            "description": "The answer to score, as your system produced it.",
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "answer_key_id",
          "text"
        ],
        "title": "SubmittedAnswer",
        "type": "object"
      },
      "SubmittedResult": {
        "additionalProperties": true,
        "description": "One scored answer as a submission reports it. Rubric detail only for a caller who may see rubrics.",
        "properties": {
          "capped": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "For callers without the rubric role.",
            "title": "Capped"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "full_credit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Credit"
          },
          "ok": {
            "title": "Ok",
            "type": "boolean"
          },
          "run_index": {
            "title": "Run Index",
            "type": "integer"
          },
          "share": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Share"
          },
          "verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verdict"
          }
        },
        "required": [
          "run_index",
          "ok"
        ],
        "title": "SubmittedResult",
        "type": "object"
      },
      "SubmittedRun": {
        "additionalProperties": true,
        "properties": {
          "answer_key_id": {
            "title": "Answer Key Id",
            "type": "string"
          },
          "answer_key_version": {
            "title": "Answer Key Version",
            "type": "integer"
          },
          "binding_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Binding Key"
          },
          "results": {
            "description": "Empty on a duplicate: read the run for its results.",
            "items": {
              "$ref": "#/components/schemas/SubmittedResult"
            },
            "title": "Results",
            "type": "array"
          },
          "rubric_approved": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rubric Approved"
          },
          "run_id": {
            "title": "Run Id",
            "type": "integer"
          },
          "standing": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standing"
          }
        },
        "required": [
          "run_id",
          "answer_key_id",
          "answer_key_version"
        ],
        "title": "SubmittedRun",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "VersionStartResult": {
        "additionalProperties": true,
        "properties": {
          "answer_key_drafts": {
            "description": "Carried bindings' drafts.",
            "items": {
              "type": "string"
            },
            "title": "Answer Key Drafts",
            "type": "array"
          },
          "applied": {
            "title": "Applied",
            "type": "boolean"
          },
          "changes": {
            "items": {
              "type": "string"
            },
            "title": "Changes",
            "type": "array"
          },
          "dropping": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Dropping",
            "type": "array"
          },
          "problems": {
            "items": {
              "type": "string"
            },
            "title": "Problems",
            "type": "array"
          },
          "question_id": {
            "title": "Question Id",
            "type": "string"
          },
          "skipped": {
            "description": "Bindings not carried, and why.",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Skipped",
            "type": "array"
          },
          "store_commit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Store Commit"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "title": "Warnings",
            "type": "array"
          }
        },
        "required": [
          "question_id",
          "version",
          "applied"
        ],
        "title": "VersionStartResult",
        "type": "object"
      }
    },
    "securitySchemes": {
      "PolarisKey": {
        "description": "A Polaris API key (`sk-polaris-…`) bound to one brain and carrying the route's scope, or a signed-in session's access token.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "The Questions Framework and the Advisor for integrations. Every operation needs an API key for the brain in the path (or a signed-in session), carrying the scope the operation names. See the Questions Framework docs for concepts, flags, scopes and a walkthrough.",
    "title": "Polaris Questions Framework developer API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/brains/{brain_id}/answer-keys/{answer_key_id}/approve": {
      "post": {
        "description": "Approve an Answer Key's current draft, no request needed: the same citation check and store\ngates as an approval decided in the web app. Needs a **Curator or Admin key** with\n`answer_key:approve`; the key's actor is the approver and the audit records the key. Refused for\nan agent identity (`approval_refused`, `not_a_person`) or a draft that fails validation (`409`).",
        "operationId": "approve_answer_key_v1_brains__brain_id__answer_keys__answer_key_id__approve_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "answer_key_id",
            "required": true,
            "schema": {
              "title": "Answer Key Id",
              "type": "string"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproveResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`). Or `idempotency_conflict`: this Idempotency-Key was used for a different request; `idempotency_in_progress`: the first request is still running."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Approve Answer Key",
        "tags": [
          "Answer Keys"
        ]
      }
    },
    "/v1/brains/{brain_id}/answer-keys/{answer_key_id}/draft": {
      "put": {
        "description": "Save a whole rubric as the Answer Key's draft: criteria, verdicts, `gold`, `gold_when` and\npenalties, as `GET /questions/{question_id}` returns them to a Curator. An open draft is replaced\nat its version; an approved Answer Key gets a new draft version, which needs `change_reason`.\nA rubric that doesn't load is `400`; one that fails a gate or a citation is saved, and\n`validation` says why approval would refuse it yet. No model call.\n\nNeeds a **Curator or Admin key** with `questions:write`: a rubric is hidden below Curator, so\nonly someone who may read it may write it.",
        "operationId": "save_answer_key_draft_v1_brains__brain_id__answer_keys__answer_key_id__draft_put",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "answer_key_id",
            "required": true,
            "schema": {
              "title": "Answer Key Id",
              "type": "string"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnswerKeySaveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerKeySaveResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`). Or `idempotency_conflict`: this Idempotency-Key was used for a different request; `idempotency_in_progress`: the first request is still running."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Save Answer Key Draft",
        "tags": [
          "Answer Keys"
        ]
      }
    },
    "/v1/brains/{brain_id}/approvals": {
      "get": {
        "description": "Pending approval requests. With a key (`questions:write`): the ones its actor asked for or\nis named on, oldest first, `cursor`-paginated, without the draft. A signed-in Curator or Admin\nsees the requests naming them (an Admin every one), the draft attached for the named approver.",
        "operationId": "list_approvals_v1_brains__brain_id__approvals_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "default": "pending",
              "title": "Status",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_Approval_"
                }
              }
            },
            "description": "Pending approval requests."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "List Approvals",
        "tags": [
          "Approvals"
        ]
      },
      "post": {
        "description": "Ask a named Curator or Admin to approve a draft Answer Key; they decide in the web app (or\napprove it directly with a key). Refused while any criterion is uncited or cites a provision\nthat doesn't resolve (`409 citations_missing`, with the questions workspace on, DEE-153 U2.5).\nA key needs `questions:write`; the request is recorded as asked by the key's actor.",
        "operationId": "request_approval_v1_brains__brain_id__approvals_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "answer_key_id": {
                    "minLength": 1,
                    "title": "Answer Key Id",
                    "type": "string"
                  },
                  "approver": {
                    "description": "The login email of a Curator or Admin of this brain, who decides in the web app.",
                    "minLength": 1,
                    "title": "Approver",
                    "type": "string"
                  }
                },
                "required": [
                  "answer_key_id",
                  "approver"
                ],
                "title": "ApprovalRequest",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approval"
                }
              }
            },
            "description": "The pending request."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Request Approval",
        "tags": [
          "Approvals"
        ]
      }
    },
    "/v1/brains/{brain_id}/approvals/{pending_id}/withdraw": {
      "post": {
        "description": "Withdraw a pending request: its requester (for a key, a request its actor made) or a\nsigned-in Admin (DEE-152 #8). Marks it `superseded` with the note and emits\n`approval.withdrawn`.",
        "operationId": "withdraw_approval_v1_brains__brain_id__approvals__pending_id__withdraw_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pending_id",
            "required": true,
            "schema": {
              "title": "Pending Id",
              "type": "integer"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "note": {
                    "default": "",
                    "title": "Note",
                    "type": "string"
                  }
                },
                "title": "WithdrawRequest",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approval"
                }
              }
            },
            "description": "The withdrawn request."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Withdraw Approval",
        "tags": [
          "Approvals"
        ]
      }
    },
    "/v1/brains/{brain_id}/budget": {
      "get": {
        "description": "The brain's monthly eval budget, the run cap per call, and this calendar month's spend (UTC).\nNeeds `questions:read`.",
        "operationId": "budget_v1_brains__brain_id__budget_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Budget"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "The eval budget",
        "tags": [
          "Budget"
        ]
      }
    },
    "/v1/brains/{brain_id}/certifications/{certification_id}/sign-off": {
      "post": {
        "description": "Sign off an eligible certification at the published version, so the binding is certified.\nEligibility is re-judged first (`409 not_eligible`, `invalidated`, `already_signed`). Needs a\n**Curator or Admin key** with `certification:sign_off`; the key's actor is the signer and the\naudit records the key. Only where `questions_workspace` is on (else `403 feature_disabled`).",
        "operationId": "sign_off_v1_brains__brain_id__certifications__certification_id__sign_off_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "certification_id",
            "required": true,
            "schema": {
              "title": "Certification Id",
              "type": "integer"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignOffRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignOffResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`). Or `idempotency_conflict`: this Idempotency-Key was used for a different request; `idempotency_in_progress`: the first request is still running."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Sign Off",
        "tags": [
          "Approvals"
        ]
      }
    },
    "/v1/brains/{brain_id}/chat/completions": {
      "post": {
        "operationId": "chat_completions_v1_brains__brain_id__chat_completions_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Ask the Advisor (OpenAI-compatible chat completion)",
        "tags": [
          "Advisor"
        ]
      }
    },
    "/v1/brains/{brain_id}/eval-ops/{op_id}": {
      "get": {
        "description": "A live eval you started: progress while it runs, then its `run_ids` and report. Someone else's\nrun (for a key: one another key started, even with the same actor), or one this gateway no\nlonger holds (a restart), is `404`. Scope `eval:run`.",
        "operationId": "run_status_v1_brains__brain_id__eval_ops__op_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "op_id",
            "required": true,
            "schema": {
              "title": "Op Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Run Status",
        "tags": [
          "Evals"
        ]
      }
    },
    "/v1/brains/{brain_id}/eval-results/{result_id}/grades": {
      "post": {
        "description": "A named person's grade ``{criterion, satisfied, note?}`` on one judged criterion of a result;\nthe result is rescored. A key grades only as its own Curator or Admin actor. Needs\n`grades:submit`.",
        "operationId": "submit_grade_v1_brains__brain_id__eval_results__result_id__grades_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "result_id",
            "required": true,
            "schema": {
              "title": "Result Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GradeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GradeResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Grade a result",
        "tags": [
          "Evals"
        ]
      }
    },
    "/v1/brains/{brain_id}/eval-runs": {
      "get": {
        "description": "Run rows, newest first, a page at a time: tuple, provenance (submitted_by, api_key_id,\nexternal_run_id, end_customer_id), standing and cost. Never answer text or the rubric snapshot.\nNeeds `questions:read`.",
        "operationId": "eval_runs_v1_brains__brain_id__eval_runs_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "question_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Question Id"
            }
          },
          {
            "in": "query",
            "name": "answer_key_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Answer Key Id"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Source"
            }
          },
          {
            "in": "query",
            "name": "end_customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End Customer Id"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_EvalRun_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "List eval runs",
        "tags": [
          "Evals"
        ]
      }
    },
    "/v1/brains/{brain_id}/eval-runs/{run_id}": {
      "get": {
        "description": "One run: its tuple, provenance, standing and cost, and each result with the ``id`` a grade\nnames. Never answer text; per-criterion results, penalty wording and human grades only for a\ncaller who may see rubrics (others get a boolean ``capped``). Needs `questions:read`.",
        "operationId": "eval_run_v1_brains__brain_id__eval_runs__run_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRunDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "An eval run and its results",
        "tags": [
          "Evals"
        ]
      }
    },
    "/v1/brains/{brain_id}/judge-agreement": {
      "get": {
        "description": "Per judged criterion (by key, never its wording): how often the judge's call matched a\nperson's grade. Needs `questions:read`.",
        "operationId": "judge_agreement_v1_brains__brain_id__judge_agreement_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "judge_model",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Judge Model"
            }
          },
          {
            "in": "query",
            "name": "question_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Question Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JudgeAgreement"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Judge agreement with people",
        "tags": [
          "Evals"
        ]
      }
    },
    "/v1/brains/{brain_id}/question-coverage": {
      "get": {
        "description": "Every Question at every binding (and each standalone Answer Key): whether the published corpus\nholds the provisions it requires, with a summary. Needs `questions:read`.",
        "operationId": "coverage_matrix_v1_brains__brain_id__question_coverage_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoverageMatrix"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Question coverage",
        "tags": [
          "Questions"
        ]
      }
    },
    "/v1/brains/{brain_id}/question-coverage/check": {
      "get": {
        "description": "One Question at one ``binding`` (the canonical key, URL-encoded), or one standalone Answer\nKey. Needs `questions:read`.",
        "operationId": "coverage_check_v1_brains__brain_id__question_coverage_check_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "question_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Question Id"
            }
          },
          {
            "in": "query",
            "name": "answer_key_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Answer Key Id"
            }
          },
          {
            "in": "query",
            "name": "binding",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Binding"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoverageCheck"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Check coverage",
        "tags": [
          "Questions"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions": {
      "get": {
        "description": "The brain's published Questions, by id, a page at a time. ``topic`` narrows to one topic card.\nNeeds `questions:read`.",
        "operationId": "list_questions_v1_brains__brain_id__questions_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Limit"
            }
          },
          {
            "in": "query",
            "name": "topic",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Topic"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_QuestionSummary_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "List published Questions",
        "tags": [
          "Questions"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/match": {
      "post": {
        "description": "Which published Question an asked question is: ``matched`` (with the binding the ask states),\n``uncertain`` (ask which candidate was meant; never bind) or ``none``. Needs `questions:read`.",
        "operationId": "match_question_v1_brains__brain_id__questions_match_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatchResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Match an ask to a Question",
        "tags": [
          "Questions"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/proposals": {
      "post": {
        "description": "Propose a new Question as a **draft** in the brain's store. No model call.\n\nNot served, scored or certified until a Curator publishes it. Draft its Answer Key next\n(`POST /questions/{question_id}/answer-keys/drafts`). Give `question_id` to choose the id\n(`409 conflict` when it is taken). Scope `questions:write`.",
        "operationId": "propose_question_v1_brains__brain_id__questions_proposals_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionProposal"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProposalResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`). Or `idempotency_conflict`: this Idempotency-Key was used for a different request; `idempotency_in_progress`: the first request is still running."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Propose Question",
        "tags": [
          "Answer Keys"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/{question_id}": {
      "get": {
        "description": "A published Question: text, slots, required provisions, answer shape, certified bindings and\nits Answer Keys. An Answer Key's ``rubric`` is null unless the caller may see rubrics (a Curator\nor Admin). Needs `questions:read`.",
        "operationId": "question_spec_v1_brains__brain_id__questions__question_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "question_id",
            "required": true,
            "schema": {
              "title": "Question Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Question"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Read a Question",
        "tags": [
          "Questions"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/{question_id}/answer-keys/drafts": {
      "post": {
        "description": "Draft the Answer Key for one binding of a Question.\n\nWith `use_drafter` the drafter proposes the rubric from `answer` (one model call), or writes the\nreference answer from the corpus first (two). The calls are checked against the brain's monthly\nbudget **before** the first one (`402 budget_exceeded`) and recorded against it. Without the\ndrafter, a one-criterion skeleton of `answer`, free. The draft needs a Curator's approval. The\nrubric is returned only to a caller who may see rubrics. Scope `questions:write`.",
        "operationId": "draft_answer_key_v1_brains__brain_id__questions__question_id__answer_keys_drafts_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "question_id",
            "required": true,
            "schema": {
              "title": "Question Id",
              "type": "string"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnswerKeyDraftRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerKeyDraftResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Over budget: the brain's monthly eval budget (`budget_exceeded`) or the request's `max_cost_usd` (`max_cost_exceeded`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`). Or `idempotency_conflict`: this Idempotency-Key was used for a different request; `idempotency_in_progress`: the first request is still running."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Draft Answer Key",
        "tags": [
          "Answer Keys"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/{question_id}/answers": {
      "post": {
        "description": "Score answers (``[{answer_key_id, text}]``) your system gave against the Question's (or a\nstandalone Answer Key's) rubric, under the comparability ``tuple`` {model, brain_version, ref,\nseed}. ``judge: true`` also grades the judged criteria and spends the eval budget. Needs\n`eval:submit` (and `eval:run` to judge).",
        "operationId": "submit_answers_v1_brains__brain_id__questions__question_id__answers_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "question_id",
            "required": true,
            "schema": {
              "title": "Question Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitAnswersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitAnswersResult"
                }
              }
            },
            "description": "A duplicate: this `external_run_id` was already scored."
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitAnswersResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Over budget: the brain's monthly eval budget (`budget_exceeded`) or the request's `max_cost_usd` (`max_cost_exceeded`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "A dependency is unavailable: the judge model (`judge_unavailable`) or the store behind `Idempotency-Key` (`idempotency_unavailable`)."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Submit answers to score",
        "tags": [
          "Evals"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/{question_id}/certified-bindings": {
      "get": {
        "description": "The bindings certified at the brain's published version, with their evidence runs. Nothing\npublished means nothing certified. Needs `questions:read`.",
        "operationId": "certified_bindings_v1_brains__brain_id__questions__question_id__certified_bindings_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "question_id",
            "required": true,
            "schema": {
              "title": "Question Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertifiedBindings"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "A Question's certified bindings",
        "tags": [
          "Questions"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/{question_id}/runs": {
      "post": {
        "description": "Start a live eval: the Advisor answers each binding `runs` times; Polaris judges, scores and\nstores every run. **Costs money**, checked against the brain's monthly budget and run cap\nbefore any model call (`402 budget_exceeded`, `400 run_cap_exceeded`), and against\n`max_cost_usd` when given (`402 max_cost_exceeded`).\n\nAnswers `202` once the run is spending, with an `op_id`: poll `GET /eval-ops/{op_id}`. A retry\nwith the same `Idempotency-Key` returns the same `op_id` and starts nothing. Scope `eval:run`.",
        "operationId": "start_run_v1_brains__brain_id__questions__question_id__runs_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "question_id",
            "required": true,
            "schema": {
              "title": "Question Id",
              "type": "string"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunAccepted"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Over budget: the brain's monthly eval budget (`budget_exceeded`) or the request's `max_cost_usd` (`max_cost_exceeded`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`). Or `idempotency_conflict`: this Idempotency-Key was used for a different request; `idempotency_in_progress`: the first request is still running."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "A dependency is unavailable: the judge model (`judge_unavailable`) or the store behind `Idempotency-Key` (`idempotency_unavailable`). Or `idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Start Run",
        "tags": [
          "Evals"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/{question_id}/runs/estimate": {
      "get": {
        "description": "What `POST /questions/{question_id}/runs` would cost, priced exactly as the run is authorized.\nFree; never refuses over budget (`allowed` and `reason` say so). Scope `eval:run`.",
        "operationId": "estimate_run_v1_brains__brain_id__questions__question_id__runs_estimate_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "question_id",
            "required": true,
            "schema": {
              "title": "Question Id",
              "type": "string"
            }
          },
          {
            "description": "Answers per Answer Key.",
            "in": "query",
            "name": "runs",
            "required": false,
            "schema": {
              "default": 1,
              "description": "Answers per Answer Key.",
              "minimum": 1,
              "title": "Runs",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "judge",
            "required": false,
            "schema": {
              "default": true,
              "title": "Judge",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "answer_key_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Answer Key Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostEstimate"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Estimate Run",
        "tags": [
          "Evals"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/{question_id}/slots": {
      "get": {
        "description": "The published version's text and slots, an open draft version's if there is one, and each\nAnswer Key's binding. Needs `questions:read`.",
        "operationId": "question_slots_v1_brains__brain_id__questions__question_id__slots_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "question_id",
            "required": true,
            "schema": {
              "title": "Question Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionSlots"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "A Question's slots",
        "tags": [
          "Questions"
        ]
      },
      "put": {
        "description": "Edit the slots of a draft Question at `version`, or the ask text of a published one (anything\nelse on a published Question is a new version). `dry_run` reports without writing. Needs a\n**Curator or Admin key** with `slots:write`, and `question_slot_editing` on.",
        "operationId": "save_slots_v1_brains__brain_id__questions__question_id__slots_put",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "question_id",
            "required": true,
            "schema": {
              "title": "Question Id",
              "type": "string"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlotsUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotEditResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`). Or `idempotency_conflict`: this Idempotency-Key was used for a different request; `idempotency_in_progress`: the first request is still running."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Save Slots",
        "tags": [
          "Answer Keys"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/{question_id}/standing": {
      "get": {
        "description": "``{brain_id, question_id, points: [{at, standing, run_ids, tuple, answer_keys?}]}``, oldest\nfirst. Tuple filters keep only points whose tuple matches; ``end_customer_id`` keeps points\nwhose runs were all submitted for that end customer (R6.1). Needs `questions:read`.",
        "operationId": "standing_v1_brains__brain_id__questions__question_id__standing_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "question_id",
            "required": true,
            "schema": {
              "title": "Question Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "answer_key_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Answer Key Id"
            }
          },
          {
            "in": "query",
            "name": "binding_key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Binding Key"
            }
          },
          {
            "in": "query",
            "name": "model",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Model"
            }
          },
          {
            "in": "query",
            "name": "brain_version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Brain Version"
            }
          },
          {
            "in": "query",
            "name": "ref",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ref"
            }
          },
          {
            "in": "query",
            "name": "seed",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Seed"
            }
          },
          {
            "in": "query",
            "name": "judge_model",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Judge Model"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Source"
            }
          },
          {
            "in": "query",
            "name": "end_customer_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End Customer Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Standing"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "A Question's standing over time",
        "tags": [
          "Questions"
        ]
      }
    },
    "/v1/brains/{brain_id}/questions/{question_id}/versions": {
      "post": {
        "description": "Start version N+1 of a published Question with new text or slots; each binding is carried to\nit as a draft Answer Key, and version N stays live until the first of them is approved.\n`dry_run` reports the plan without writing. Needs a **Curator or Admin key** with\n`questions:publish`, and `question_slot_editing` on.",
        "operationId": "start_version_v1_brains__brain_id__questions__question_id__versions_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "question_id",
            "required": true,
            "schema": {
              "title": "Question Id",
              "type": "string"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishVersionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionStartResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`). Or `idempotency_conflict`: this Idempotency-Key was used for a different request; `idempotency_in_progress`: the first request is still running."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Start Version",
        "tags": [
          "Answer Keys"
        ]
      }
    },
    "/v1/brains/{brain_id}/slot-types": {
      "get": {
        "description": "The slot types a Question's slots may use: the platform's and the brain's own. Needs `questions:read`.",
        "operationId": "slot_types_v1_brains__brain_id__slot_types_get",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "description": "Also the brain's proposed types, which no slot may use until approved.",
            "in": "query",
            "name": "include_proposed",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also the brain's proposed types, which no slot may use until approved.",
              "title": "Include Proposed",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SlotType"
                  },
                  "title": "Response Slot Types V1 Brains  Brain Id  Slot Types Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Slot types",
        "tags": [
          "Questions"
        ]
      },
      "post": {
        "description": "Propose one of the brain's own slot types. It is `proposed`, and no slot may use it until\nsomeone other than its proposer approves it (`POST /slot-types/{name}/approve`). `409 conflict`\nwhen the name is taken. Scope `questions:write`.",
        "operationId": "propose_slot_type_v1_brains__brain_id__slot_types_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlotTypeProposal"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotType"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is invalid (`invalid`, `run_cap_exceeded`)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`). Or `idempotency_conflict`: this Idempotency-Key was used for a different request; `idempotency_in_progress`: the first request is still running."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Propose Slot Type",
        "tags": [
          "Answer Keys"
        ]
      }
    },
    "/v1/brains/{brain_id}/slot-types/{name}/approve": {
      "post": {
        "description": "Approve a proposed slot type, so slots may use it. Needs a **Curator or Admin key** with\n`slots:write`, whose actor is not the proposer (`403 approval_refused`, `self_approval`).",
        "operationId": "approve_slot_type_v1_brains__brain_id__slot_types__name__approve_post",
        "parameters": [
          {
            "in": "path",
            "name": "brain_id",
            "required": true,
            "schema": {
              "title": "Brain Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "description": "Retry safely: the same key (same brain, caller and route) returns the first successful response instead of acting twice, for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlotTypeApproveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotType"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or an invalid or revoked one (`unauthorized`, `invalid_api_key`, `revoked_api_key`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not allowed: `insufficient_scope`, `brain_forbidden`, `role_forbidden`, `forbidden`, or `feature_disabled` (a Questions Framework flag is off for this brain)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No such Question, Answer Key, run, result or approval (`not_found`)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request conflicts with the current state: `approval_refused`, `citations_missing`, a sign-off refusal (e.g. `not_eligible`, `already_signed`), or an `Idempotency-Key` reused with another body (`idempotency_conflict`) or still running (`idempotency_in_progress`). Or `idempotency_conflict`: this Idempotency-Key was used for a different request; `idempotency_in_progress`: the first request is still running."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "`idempotency_unavailable`: an Idempotency-Key was sent and can't be honoured right now."
          }
        },
        "security": [
          {
            "PolarisKey": []
          }
        ],
        "summary": "Approve Slot Type",
        "tags": [
          "Answer Keys"
        ]
      }
    }
  },
  "tags": [
    {
      "description": "Published Questions: list, read, match, slots and slot types, standing, certified bindings and coverage.",
      "name": "Questions"
    },
    {
      "description": "Propose a Question, draft its Answer Key and, with a Curator or Admin key, approve, publish and edit slots.",
      "name": "Answer Keys"
    },
    {
      "description": "Estimate and run evals within the brain's budget, submit answers to score, record grades and read runs.",
      "name": "Evals"
    },
    {
      "description": "Request, withdraw and sign off approvals.",
      "name": "Approvals"
    },
    {
      "description": "The brain's monthly eval budget and this month's spend.",
      "name": "Budget"
    },
    {
      "description": "The OpenAI-compatible Advisor, with question routing (`needs_input` and resume).",
      "name": "Advisor"
    }
  ]
}
