본문으로 이동

AI 실행

Evaluations API

직접 정한 루브릭으로 대화 기록을 채점합니다. 측정 방법인 conversation-rubric@1 프로필은 Roye가 관리하고, 평가 기준, 수준, 대화 기록, 맥락은 사용자가 정합니다. 실행(run)은 기준마다 수준과 그 판단의 근거가 된 인용을 돌려줍니다.

로컬 미리보기

프로필, 루브릭, 계획, 실행 경로와 실행별 청구 기록 조회를 제공하는 계약 1 미리보기입니다. Evaluations를 제공하는 호스팅 환경은 아직 없고, 검증을 마친 채점 모델도 없어서 모든 모델과 언어 쌍의 qualification.state가 unqualified입니다. 배포에 ROYE_EVALUATIONS_ENABLED를 설정해야 Evaluations 경로가 제공되며, 이 설정은 기본으로 꺼져 있습니다. 그 밖의 배포에서는 모든 /v1/evaluations 경로가 not_found를 반환하고, GET /v1/capabilities에도 이 모듈이 나오지 않습니다. 청구 기록 조회는 이 설정과 관계없이 제공되므로, 설정을 끈 뒤에도 실행의 청구 기록을 읽을 수 있습니다. SDK 클라이언트는 비공개 패키지 @roye-ai/client에 들어 있으며, 이 패키지는 아직 배포하지 않았습니다. 이 가이드가 있다고 해서 사용이 허가된 것은 아니며, 프로젝트에서 API를 쓸 수 있는 것도 아닙니다.

빠른 시작

신뢰할 수 있는 백엔드에서 아래처럼 HTTP로 호출하거나 SDK 클라이언트를 쓰세요. 먼저 루브릭을 만듭니다.

Create a rubric
POST /v1/evaluations/rubrics
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{
  "idempotencyKey": "debate-rubric-1",
  "name": "Debate practice",
  "criteria": [
    {
      "kind": "ordinal",
      "id": "rebuttal",
      "title": "Rebuttal",
      "definition": "How well the speaker answers the opponent's main claim.",
      "applicability": {
        "requires": [
          "opposingTurns"
        ]
      },
      "uses": [
        "argumentMap"
      ],
      "levels": [
        {
          "id": "0",
          "descriptor": "Does not respond to the opposing claim."
        },
        {
          "id": "1",
          "descriptor": "Mentions the claim without answering it."
        },
        {
          "id": "2",
          "descriptor": "Answers the claim with an assertion."
        },
        {
          "id": "3",
          "descriptor": "Answers the claim with a reason."
        },
        {
          "id": "4",
          "descriptor": "Answers the claim with a reason and evidence."
        }
      ]
    },
    {
      "kind": "binary",
      "id": "stayedOnMotion",
      "title": "Stayed on the motion",
      "definition": "Every argument addresses the motion in the context."
    },
    {
      "kind": "metric",
      "id": "talkShare",
      "title": "Talk share",
      "metric": "talk_share"
    }
  ],
  "aggregate": {
    "overall": "weighted_mean"
  }
}

다음으로 리비전 1의 계획을 조회합니다. 이 요청으로 실행했을 때 일어날 채점 호출이 나오며, 계획은 아무것도 예약하거나 청구하지 않습니다. 프로필에 모델이 하나도 없는 배포에서는 unsupported_capability로 응답합니다.

Disclose a plan
POST /v1/evaluations/plans
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{
  "rubric": {
    "id": "evr_55cb3e93643989b563ca29e2560ee818",
    "revision": 1
  },
  "profile": {
    "id": "conversation-rubric",
    "revision": "1"
  },
  "model": "provider/judge-model",
  "transcript": {
    "language": "en",
    "speakers": [
      {
        "id": "student",
        "label": "Student"
      },
      {
        "id": "opponent",
        "label": "AI opponent"
      }
    ],
    "turns": [
      {
        "id": "t1",
        "speaker": "opponent",
        "text": "School uniforms limit how students express themselves."
      },
      {
        "id": "t2",
        "speaker": "student",
        "text": "Uniforms remove pressure to buy expensive clothes, so students can focus on learning."
      },
      {
        "id": "t3",
        "speaker": "opponent",
        "text": "But self-expression matters more than cost."
      },
      {
        "id": "t4",
        "speaker": "student",
        "text": "Students still express themselves through clubs and their work, and a survey at our school found most families saved money."
      }
    ]
  },
  "target": {
    "speakerIds": [
      "student"
    ]
  },
  "context": {
    "text": "Motion: This house would require school uniforms."
  },
  "outputLanguage": "ko"
}

대화 기록을 채점하려면 같은 본문에 idempotencyKey를 넣어 실행을 시작하세요. 채점은 Roye가 백그라운드에서 진행합니다. 결과는 waitMs로 기다려 조회하거나 이벤트로 따라가세요(실행 시작).

두 가지 사용 예, 하나의 계약

서로 관계없는 제품이 같은 필드를 보냅니다. Roye에는 특정 고객을 위한 경로, 프롬프트, 루브릭, 분기가 없습니다.

  • 토론 연습: 논증 맵으로 판단하는 ordinal 반박 기준, talk_share, 전체 점수 weighted_mean을 씁니다. 학습자가 AI 상대와 토론하고, 맥락은 토론 주제이며, 판단 이유는 학습자의 언어로 받습니다.
  • 콜센터 평가표: binary 항목(일부는 critical)과 longest_turn_share를 씁니다. 상담원이 고객을 응대하고, 맥락은 정책 문서이며, 판단 이유는 검수자의 언어로 받습니다.

핵심 개념

ID 형식으로 뜻을 짐작하지 마세요. 루브릭과 실행은 프로젝트 하나와 환경 하나에 속합니다. 글자 수는 유니코드 코드 포인트로, KiB는 UTF-8 바이트로 셉니다.

리소스의미
프로필 conversation-rubric@1Roye가 관리하는 읽기 전용 측정 방법입니다. 고정한 리비전의 동작은 바뀌지 않습니다.
루브릭(evr_)id, latestRevision, createdAt, updatedAt이 있습니다. 평가 기준은 digest가 붙은 리비전에 있고, 리비전은 바뀌지 않으며 30일 뒤 만료됩니다.
실행(evx_)고정한 루브릭 리비전으로 대화 기록 하나를 평가합니다. Roye는 접수한 실행을 모두 종료 상태까지 진행합니다.
실행 이벤트실행 상태, 단계, 기준 상태가 바뀔 때 남는 기록입니다. 대화 내용은 담지 않으며 cursor 순서대로 읽습니다.

인증과 버전

  • 백엔드 프로젝트 키를 X-Roye-Project, X-Roye-Environment(development 또는 production)와 함께 보내세요. 키를 브라우저에서 쓰지 마세요. 액터, 운영 주체, 프로세서 자격 증명은 받지 않고, 범위를 지정한 키에는 evaluations 범위가 있어야 합니다.
  • 쿼리 매개변수를 받는 경로는 waitMs를 받는 GET /runs/{runId}와 cursor를 받는 GET /runs/{runId}/events뿐입니다.
  • Roye-Contract-Version: 1로 계약 1을 고르면 응답에 같은 버전이 돌아옵니다. 버전은 미리보기라 고정되지 않으며, 헤더가 없으면 계약 1입니다. 다른 버전은 contract_version_unsupported입니다.
  • Evaluations를 제공하는 배포에서만 GET /v1/capabilities에 evaluations가 미리보기로 나오며, profiles, rubrics, revisions, plans, runs, events, cancel, purge 기능과 conversation-rubric 프로필이 함께 실립니다(SDK 가이드). 평가 기준 종류, 지표, 적용 불가 사유 같은 닫힌 집합에도 값이 늘 수 있습니다. 모르는 값이 와도 실패하지 않게 처리하세요.
Headers
# Every Evaluations request, sent from your trusted backend only.
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

프로필 카탈로그 항목

카탈로그 항목은 계획이 고정하는 측정 방법 리비전을 설명합니다. 제공하는 stages(argument_map, criterion)와 samples(한 개), 단계별 출력 토큰 limits, 계획 호출 최대 수, 텍스트 규칙의 unicodeVersion이 나옵니다. unicodeVersion이 올라가면 같은 프로필 리비전에서도 지표 값이나 인용 범위가 달라질 수 있습니다.

models에는 허용된 채점 모델이 나오며 기본값은 빈 목록입니다. 모델마다 대화 기록 언어와 출력 언어 쌍별 qualification 기록이 붙는데, 아직 하나도 없어서 모든 쌍이 미검증입니다.

Read the catalog entry
GET /v1/evaluations/profiles/conversation-rubric/revisions/1
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

# 200, Roye-Contract-Version: 1. models is empty by default; provider/judge-model stands in for an allowed model.
{
  "id": "conversation-rubric",
  "revision": "1",
  "contractVersions": [
    1
  ],
  "acquisition": "native-json",
  "unicodeVersion": "16.0",
  "stages": [
    "argument_map",
    "criterion"
  ],
  "samples": [
    1
  ],
  "models": [
    {
      "id": "provider/judge-model",
      "qualification": []
    }
  ],
  "limits": {
    "maxCriterionOutputTokens": 4096,
    "maxArgumentMapOutputTokens": 8192,
    "maxFeedbackOutputTokens": 8192,
    "maxPlannedCalls": 64
  }
}

루브릭 본문

요청 스키마는 엄격합니다. 모르는 필드는 invalid_request이고 기본값을 채우지 않으므로, 호출 다이제스트는 보낸 본문 그대로 계산합니다. 저장된 본문에는 기본값이 채워지고 그대로 요청 본문으로 쓸 수 있으며, 다시 보내면 같은 digest가 나옵니다. digest는 정규 JSON의 SHA-256입니다. 다만 64 KiB 한도는 보낸 본문을 기준으로 잽니다. 저장된 본문은 채워진 기본값만큼 더 크므로, 처음 보낸 본문이 한도에 가까웠다면 저장된 본문을 다시 보낼 때 한도를 넘을 수 있습니다. 이럴 때는 보낸 본문을 보관해 두었다가 그 본문을 다시 보내세요. ID는 루브릭이나 평가 기준 안에서 겹치면 안 됩니다.

필드범위와 기본값
name, criteria[].title1~80자, 1~120자.
criteria1~20개. 결과도 이 순서로 나옵니다.
criteria[].id영문 소문자 하나 뒤에 영문자, 숫자, _ 최대 39자.
criteria[].kindordinal과 binary(pass 또는 fail)는 모델 호출로 판단하고, metric은 호출 없이 계산합니다.
definition, weightordinal, binary: 1~2,000자. weight는 0~1, 기본 1.
levelsordinal: 낮은 순으로 { id, descriptor } 2~11개. id는 영문자, 숫자, -, _ 1~16자이고 cannot_judge나 __…__는 쓸 수 없습니다. descriptor는 600자까지.
checklist, exampleschecklist는 200자 이하 항목 최대 8개. examples는 { excerpt, level, rationale } 최대 3개이고, excerpt는 2,000자, rationale은 400자까지, level은 그 기준의 수준 중 하나.
evidence{ required, maxQuotes }, 인용 1~5개. 기본값 { required: true, maxQuotes: 3 }.
applicability.requiresopposingTurns, timestamps, audioFeatures, videoFeatures 중 최대 4개. 계약 1에서 오디오·비디오가 필요한 기준은 적용되지 않습니다.
uses[] 또는 ["argumentMap"]. 논증 맵으로 판단할 때 씁니다.
criticalbinary: 기본 false.
metricturn_count, talk_share, longest_turn_share, mean_turn_chars, lexical_uptake 중 하나.
aggregate.overallnone(기본) 또는 weighted_mean.
feedback.maxSuggestions0~5, 기본 0. 이번 미리보기에서는 0보다 크면 거부합니다.
201 response
{
  "rubric": {
    "id": "evr_55cb3e93643989b563ca29e2560ee818",
    "latestRevision": 1,
    "createdAt": 1793000000000,
    "updatedAt": 1793000000000
  },
  "revision": {
    "rubricId": "evr_55cb3e93643989b563ca29e2560ee818",
    "revision": 1,
    "digest": "ec7883d11fa3b47c545d0e8780808821e66fd480d9327a4c82d82259a596964a",
    "body": {
      "name": "Debate practice",
      "criteria": [
        {
          "kind": "ordinal",
          "id": "rebuttal",
          "title": "Rebuttal",
          "definition": "How well the speaker answers the opponent's main claim.",
          "evidence": {
            "required": true,
            "maxQuotes": 3
          },
          "applicability": {
            "requires": [
              "opposingTurns"
            ]
          },
          "uses": [
            "argumentMap"
          ],
          "weight": 1,
          "levels": […]
        },
        {
          "kind": "binary",
          "id": "stayedOnMotion",
          "title": "Stayed on the motion",
          "definition": "Every argument addresses the motion in the context.",
          "evidence": {
            "required": true,
            "maxQuotes": 3
          },
          "weight": 1,
          "critical": false
        },
        {
          "kind": "metric",
          "id": "talkShare",
          "title": "Talk share",
          "metric": "talk_share"
        }
      ],
      "aggregate": {
        "overall": "weighted_mean"
      },
      "feedback": {
        "maxSuggestions": 0
      }
    },
    "operation": {
      "operationId": "op_3f841de9f62c9ff598a0b4c342890328",
      "idempotencyKey": "debate-rubric-1",
      "inputDigest": "41d493701ffb4344ef76ed2d428416e0aadd64226e4d67b7a778b612532aabd5"
    },
    "createdAt": 1793000000000,
    "expiresAt": 1795592000000
  }
}

고치기와 읽기

  • 루브릭을 바꾸려면 전체 본문을 새 idempotencyKey와 함께 다시 보내고, 마지막으로 읽은 latestRevision을 expectedRevision에 넣으세요. 201 응답은 { rubric, revision }이며 루브릭의 새 latestRevision과 updatedAt이 담깁니다.
  • expectedRevision이 최신이 아니면 409 revision_conflict가 오고 error.expectedRevision에 최신 번호가 담깁니다. 그 값과 새 키로 다시 보내세요.
  • 리비전은 만든 지 30일 뒤 expiresAt에 만료되며, 읽거나 계획이나 실행에 써도 기한이 늘어나지 않습니다. 만료된 리비전을 읽거나 계획이나 새 실행에서 지정하면 not_found를 반환하지만, 그 전에 접수된 실행은 영향을 받지 않습니다. 루브릭에는 ID, 최신 번호, 시각만 남습니다.
  • 루브릭을 계속 쓰려면 전에 보낸 본문으로 리비전을 추가하세요. 다이제스트가 같습니다. 프로젝트 내보내기에는 만료되지 않은 리비전이 들어가고, 프로젝트를 삭제하면 함께 지워집니다(프로젝트 종료와 내보내기).
Revise a rubric
POST /v1/evaluations/rubrics/evr_55cb3e93643989b563ca29e2560ee818/revisions
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

# The full body again, criteria as in the create request.
{
  "idempotencyKey": "debate-rubric-2",
  "expectedRevision": 1,
  "name": "Debate practice (v2)",
  "criteria": […],
  "aggregate": {
    "overall": "weighted_mean"
  }
}

# 201, Roye-Contract-Version: 1
{
  "rubric": {
    "id": "evr_55cb3e93643989b563ca29e2560ee818",
    "latestRevision": 2,
    "createdAt": 1793000000000,
    "updatedAt": 1793000060000
  },
  "revision": {
    "rubricId": "evr_55cb3e93643989b563ca29e2560ee818",
    "revision": 2,
    "digest": "ef082615ef1e4dad2c490de4fc1cb4f1b172ab1bdffbcac037e299e35b978c1e",
    "body": {
      "name": "Debate practice (v2)",
      "criteria": […],
      "aggregate": {
        "overall": "weighted_mean"
      },
      "feedback": {
        "maxSuggestions": 0
      }
    },
    "operation": {
      "operationId": "op_27b3b7a1f200791332139aeeefa06d76",
      "idempotencyKey": "debate-rubric-2",
      "inputDigest": "8bf69e2dbcbf94fa32e62acc40ea2e89206b7bf90f050f893f5293ae8837a4b6"
    },
    "createdAt": 1793000060000,
    "expiresAt": 1795592060000
  }
}

# The same body with a new key, debate-rubric-3, and the stale expectedRevision 1:
# 409 revision_conflict, with error.expectedRevision 2. Read the rubric, then send expectedRevision 2 with a new key.
# Sending debate-rubric-2 again replays the 201 above with Roye-Replayed: true.
Read a rubric and a revision
GET /v1/evaluations/rubrics/evr_55cb3e93643989b563ca29e2560ee818
# 200
{
  "id": "evr_55cb3e93643989b563ca29e2560ee818",
  "latestRevision": 2,
  "createdAt": 1793000000000,
  "updatedAt": 1793000060000
}

GET /v1/evaluations/rubrics/evr_55cb3e93643989b563ca29e2560ee818/revisions/2
# 200: the revision object of the 201 above, the same until it expires.

계획 조회

계획은 실행 요청을 키 없이 받습니다. 호출 기록도 예약도 만들지 않으며 접수도 아닙니다. 적용되는 기준 중 논증 맵을 쓰는 것이 있으면 argument_map 호출이 하나 생기고, 이어서 적용되는 모델 기준과 샘플마다 호출이 하나씩 생기며 샘플은 1부터 셉니다. opposingTurns가 필요한 기준은 상대 발화 뒤에 대상 화자의 발화가 없으면 적용되지 않습니다.

프로젝트의 요금표가 준비되어 있으면 계획에 maximumMicros와 policyRevision도 담깁니다. maximumMicros는 이 실행에 청구될 수 있는 최대 금액(USD 마이크로 단위)입니다. 두 필드는 항상 함께 나오고 POST /v1/billing/quote와 같은 소매 가격 규칙을 따르며, 실행을 접수할 때 정확히 이 금액을 예약합니다. 아직 측정한 채점 모델이 없으므로 모든 호출의 maxInputTokens는 그 모델의 입력 상한입니다.

필드범위
rubric{ id, revision }, revision은 1 이상.
profile{ id: "conversation-rubric", revision: "1" }, revision은 문자열.
model카탈로그에 있는 provider/model, 최대 200자.
transcript.language, outputLanguage2~35자 BCP 47 태그. 판단 이유는 outputLanguage로 쓰고, 인용은 원문 그대로 둡니다.
transcript.speakers{ id, label? } 1~16개, label 최대 80자.
transcript.turns순서대로 { id, speaker, text, startMs?, endMs? } 1~2,000개. text 최대 20,000자, 0 ≤ startMs ≤ endMs.
발화와 화자 ID영문자, 숫자, -, _ 1~32자. 겹치면 안 되고 화자는 선언되어 있어야 합니다.
target.speakerIds1~4명. 나머지 화자의 발화는 상대 발화입니다.
context.text선택. 토론 주제나 정책 문서, 최대 64 KiB.
sampling.samples선택, 1.

제공 범위는 프로필 리비전 1, 카탈로그에 있는 모델, 프로필의 단계와 샘플입니다. 그 밖의 설정은 unsupported_capability로 거부하고 error.field가 그 필드를 가리킵니다. /feedback/maxSuggestions를 0보다 크게 둔 루브릭은 루브릭을 만들 때, /sampling/samples를 3으로 둔 계획·실행 요청은 계획을 만들 때 거부합니다. 아래 예시의 금액은 설명을 위한 값입니다.

200 response
{
  "callCount": 3,
  "calls": [
    {
      "stage": "argument_map",
      "model": "provider/judge-model",
      "maxInputTokens": 200000,
      "maxOutputTokens": 8192
    },
    {
      "stage": "criterion",
      "criterionId": "rebuttal",
      "sample": 1,
      "model": "provider/judge-model",
      "maxInputTokens": 200000,
      "maxOutputTokens": 4096
    },
    {
      "stage": "criterion",
      "criterionId": "stayedOnMotion",
      "sample": 1,
      "model": "provider/judge-model",
      "maxInputTokens": 200000,
      "maxOutputTokens": 4096
    }
  ],
  "maximumMicros": 742500,
  "policyRevision": "retail-2026-10"
}

실행 시작

POST /v1/evaluations/runs는 계획 요청에 idempotencyKey를 더해 받습니다. 접수하면서 계획의 maximumMicros를 예약하고, 202와 함께 queued 상태의 실행 뷰를 반환합니다.

  • 실행 ID는 evx_ 뒤에 16진수 64자리가 붙은 값으로, 프로젝트, 환경, 모듈, kind, 키로 정해집니다. 그래서 키 하나는 언제나 실행 하나를 가리킵니다.
  • 같은 키와 같은 본문을 보내면 원래 202 응답을 바이트 그대로 Roye-Replayed: true와 함께 다시 돌려줍니다. 그사이 루브릭 리비전이 만료됐거나 모델이 카탈로그에서 빠졌어도 같습니다. 같은 키로 본문을 바꿔 보내면 idempotency_conflict입니다.
  • 새 키로 다시 보내지 마세요. 실행이 하나 더 시작됩니다. 응답을 받지 못했다면 접수를 복구하세요.
  • inputDigest는 키를 뺀 본문의 호출 다이제스트라서, 본문이 같은 실행끼리는 값이 같습니다.
Start a run
POST /v1/evaluations/runs
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

# The plan request plus an idempotencyKey; transcript and context as in the plan request.
{
  "idempotencyKey": "debate-run-1",
  "rubric": {
    "id": "evr_55cb3e93643989b563ca29e2560ee818",
    "revision": 2
  },
  "profile": {
    "id": "conversation-rubric",
    "revision": "1"
  },
  "model": "provider/judge-model",
  "transcript": {…},
  "target": {
    "speakerIds": [
      "student"
    ]
  },
  "context": {…},
  "outputLanguage": "ko"
}
202 response
{
  "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9",
  "operation": {
    "operationId": "op_c38dcfde2cd1d8af04be1c1e25068f2a",
    "idempotencyKey": "debate-run-1",
    "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908"
  },
  "status": "queued",
  "terminalReason": null,
  "rubric": {
    "id": "evr_55cb3e93643989b563ca29e2560ee818",
    "revision": 2,
    "digest": "ef082615ef1e4dad2c490de4fc1cb4f1b172ab1bdffbcac037e299e35b978c1e"
  },
  "profile": {
    "id": "conversation-rubric",
    "revision": "1"
  },
  "model": "provider/judge-model",
  "contractVersion": 1,
  "serviceRevision": "roye-2026-10-27.1",
  "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908",
  "outputDigest": null,
  "plan": {
    "callCount": 3,
    "argumentMapCalls": 1,
    "criterionCalls": 2,
    "feedbackCalls": 0
  },
  "qualification": {
    "state": "unqualified"
  },
  "criteria": [],
  "executionSettled": false,
  "meteringSettled": false,
  "accounting": "reserved",
  "createdAt": 1793000120000
}

실행 상태와 결과

GET /v1/evaluations/runs/{runId}는 실행 뷰를 반환합니다. waitMs를 주면 실행이 종료 상태가 될 때까지 기다리되, 대기 시간이 끝나면 그대로 응답합니다. 기다린다고 실행이 취소되지는 않습니다. 시간 한도는 한도에 나와 있습니다.

상태의미
queued접수되어 시작을 기다립니다. 제때 시작되지 않으면 expired로 끝납니다.
runningRoye가 계획한 호출을 보냅니다. 호출이 모두 끝나거나 실행 기한이 지날 때까지 이어집니다.
cancelling진행 중인 실행에 취소나 내용 삭제 요청이 왔습니다. 시작하지 않은 호출은 시작하지 않고 진행 중인 호출은 중단하며, 호출이 마무리되면 cancelled로 끝납니다.
completed결과가 확정됐습니다. terminalReason은 completed이고, 실행 기한 때문에 끝내지 못한 호출이 있었다면 deadline입니다.
failed결과가 없습니다. terminalReason은 all_criteria_failed, deadline, 또는 프로젝트 권한이 더는 유효하지 않을 때의 authority_revoked입니다.
cancelled결과가 없습니다. terminalReason은 caller_cancelled, run_purged, project_deleted 중 하나입니다.
expired결과가 없습니다. 한 번도 시작되지 않았고 terminalReason은 deadline입니다.
  • 적용되는 모델 기준이 있는 실행은 그 기준이 모두 실패하면 failed(all_criteria_failed)로 끝납니다. 그렇지 않으면 실패한 기준을 결과에 담은 채 completed로 끝납니다.
  • 결과는 completed 실행만 확정합니다. 루브릭 순서대로 나열한 criteria, 루브릭에 critical 기준이 있을 때의 critical, weighted_mean일 때의 overall, 확정 결과의 SHA-256인 outputDigest가 담깁니다. 다른 실행은 criteria가 비어 있고 outputDigest가 null입니다.
  • 기준의 status는 scored, computed(지표 value), cannot_judge, not_applicable(reason 포함), insufficient_evidence, failed 중 하나입니다.
  • 채점된 기준에는 level, 가장 낮은 수준이 0이고 가장 높은 수준이 1인 score, 검증된 인용, outputLanguage로 쓴 rationale이 담깁니다. 인용의 start와 end는 발화 원문에서 센 코드 포인트 위치이며, end 위치의 글자는 포함하지 않습니다. match는 exact 또는 normalized입니다.
  • 실패한 기준에는 대화 내용을 담지 않은 diagnostic이 붙고, 그 cause는 call, argument_map, deadline 중 하나입니다.
  • 실행 기한에 이르면 진행 중인 호출을 중단하고, 끝나지 않은 기준은 모두 cause deadline으로 실패합니다. 공급자 쪽 작업이 일어났을 수 있으면 uncertain: true도 붙습니다. 그다음 실행은 첫 번째 규칙대로 끝나고 terminalReason은 deadline입니다. 기한 안에 모든 호출을 마친 실행의 terminalReason은 completed나 all_criteria_failed입니다.
Wait for the result
GET /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9?waitMs=30000
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

# 200 once the run is terminal, or when the wait ends with the run still queued or running.
200 response
{
  "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9",
  "operation": {
    "operationId": "op_c38dcfde2cd1d8af04be1c1e25068f2a",
    "idempotencyKey": "debate-run-1",
    "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908"
  },
  "status": "completed",
  "terminalReason": "completed",
  "rubric": {…},
  "profile": {…},
  "model": "provider/judge-model",
  "contractVersion": 1,
  "serviceRevision": "roye-2026-10-27.1",
  "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908",
  "outputDigest": "35bd780826cfef881c8f0206c281e407c0b8d08ad83c93fb0447b3bc57c8b1f3",
  "plan": {…},
  "qualification": {…},
  "criteria": [
    {
      "id": "rebuttal",
      "kind": "ordinal",
      "status": "scored",
      "level": "3",
      "score": 0.75,
      "evidenceRejected": 0,
      "rationale": "복장이 아니어도 동아리와 과제로 자신을 표현할 수 있다는 이유를 들어 반론에 답했습니다. 설문 결과는 비용에 관한 근거라서 자기표현 주장을 직접 뒷받침하지는 않습니다.",
      "evidence": [
        {
          "id": "rebuttal-1",
          "turnId": "t4",
          "speaker": "student",
          "quote": "Students still express themselves through clubs and their work",
          "start": 0,
          "end": 62,
          "match": "exact"
        }
      ]
    },
    {
      "id": "stayedOnMotion",
      "kind": "binary",
      "status": "scored",
      "level": "pass",
      "score": 1,
      "evidenceRejected": 0,
      "rationale": "모든 주장이 교복 의무화라는 논제를 다룹니다.",
      "evidence": [
        {
          "id": "stayedOnMotion-1",
          "turnId": "t2",
          "speaker": "student",
          "quote": "Uniforms remove pressure to buy expensive clothes",
          "start": 0,
          "end": 49,
          "match": "exact"
        }
      ]
    },
    {
      "id": "talkShare",
      "kind": "metric",
      "status": "computed",
      "value": 0.6819672131147541
    }
  ],
  "overall": {
    "score": 0.88,
    "basis": [
      "rebuttal",
      "stayedOnMotion"
    ]
  },
  "executionSettled": true,
  "meteringSettled": true,
  "accounting": "settled",
  "createdAt": 1793000120000,
  "startedAt": 1793000120800,
  "finishedAt": 1793000139300
}

실행 따라가기

GET /v1/evaluations/runs/{runId}/events는 이벤트를 순서대로 최대 64개 담은 페이지와 그 페이지의 cursor, executionSettled, meteringSettled를 반환합니다. 그 cursor를 ?cursor=로 보내면 뒤에 이어지는 이벤트를 읽습니다. 빈 페이지가 오면 cursor가 그대로이므로 같은 cursor로 다시 조회하세요.

유형담는 값
run.statusstatus.
run.stage단계의 첫 호출이 시작될 때 stage(argument_map 또는 criterion).
run.criterioncriterionId와 status.

모든 이벤트에는 eventId, module evaluations, source(domain evaluations, type run, 실행 ID), causalOperationId(이벤트를 일으킨 접수, 취소, 내용 삭제 호출, 없으면 null), at, cursor가 있습니다. 이벤트에는 대화 기록, 인용, 판단 이유 텍스트가 들어가지 않으니 결과는 실행을 조회해 확인하세요.

Read run events
GET /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9/events
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

# 200. No transcript, quote or rationale text.
200 response
{
  "events": [
    {
      "eventId": "eve_fb3596f6c7ed10dc0ba55da056e5f6ac",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": "op_c38dcfde2cd1d8af04be1c1e25068f2a",
      "at": 1793000120000,
      "cursor": "1",
      "type": "run.status",
      "status": "queued"
    },
    {
      "eventId": "eve_1dcc68d09392ebe9b1f2fe4203938a4d",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000120800,
      "cursor": "2",
      "type": "run.status",
      "status": "running"
    },
    {
      "eventId": "eve_a5457692fd8d371d2ccce92cc410e637",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000120850,
      "cursor": "3",
      "type": "run.stage",
      "stage": "argument_map"
    },
    {
      "eventId": "eve_6af22a74a9592a41b4b183fe1f49e2cc",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000131200,
      "cursor": "4",
      "type": "run.stage",
      "stage": "criterion"
    },
    {
      "eventId": "eve_dce74eab7face32aeee11b2a1c46e0a0",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000137400,
      "cursor": "5",
      "type": "run.criterion",
      "criterionId": "rebuttal",
      "status": "scored"
    },
    {
      "eventId": "eve_23553e56c4b78ff811ff9b6318e5da44",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000139100,
      "cursor": "6",
      "type": "run.criterion",
      "criterionId": "stayedOnMotion",
      "status": "scored"
    },
    {
      "eventId": "eve_07df47e205eac7990c5b8b0d57e94358",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000139300,
      "cursor": "7",
      "type": "run.criterion",
      "criterionId": "talkShare",
      "status": "computed"
    },
    {
      "eventId": "eve_cac7bd0abc286b044166ac6793da8978",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000139300,
      "cursor": "8",
      "type": "run.status",
      "status": "completed"
    }
  ],
  "cursor": "8",
  "executionSettled": true,
  "meteringSettled": true
}
Read the next page
GET /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9/events?cursor=8
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

# 200 with no new events: { "events": [], "cursor": "8", ... }. Poll again with the same cursor.

취소와 내용 삭제

두 경로 모두 idempotencyKey만 담은 본문을 받고, 대상은 runId입니다. 실행이 어떤 상태든 200과 대화 내용을 뺀 실행 뷰를 반환합니다. 기준 결과에는 status, level, score, diagnostic만 남고 근거와 판단 이유는 빠집니다. 결과는 GET /runs/{runId}로 조회하세요.

  • 취소: queued 실행은 바로 cancelled로 끝납니다. running 실행은 cancelling으로 바뀌고, 진행 중인 호출이 마무리되면 cancelled(caller_cancelled)로 끝납니다. 취소된 실행은 결과를 확정하지 않으며, 이미 종료된 실행을 취소하면 아무것도 바뀌지 않습니다.
  • 내용 삭제: 종료되지 않은 실행은 먼저 취소합니다(run_purged). 그다음 요청, 대화 기록, 맥락, 근거, 판단 이유를 지우고 purgedAt을 기록합니다. 실행의 ID, 상태, 다이제스트, 대화 내용을 뺀 기준 결과, 청구 기록은 남습니다. 내용을 삭제하기 전에 만든 내보내기에서도 이 실행의 콘텐츠는 더 이상 읽을 수 없습니다.
  • 내용을 삭제하지 않아도 이 콘텐츠는 실행을 접수하고 30일 뒤 만료됩니다. 그 뒤 completed 실행에는 대화 내용을 뺀 뷰만 남습니다.
  • 프로젝트 내보내기에는 만료되지 않은 실행 콘텐츠가 들어가고, 실행이 얼마나 오래됐든 대화 내용을 뺀 뷰도 모두 들어갑니다. 그 항목의 expiresAt은 내보내기 자체가 만료되는 시각입니다. 프로젝트를 삭제하면 콘텐츠도 지워집니다.
Cancel a running run
# A second run, admitted with the key debate-run-2, is running.
POST /v1/evaluations/runs/evx_e92efcbcec15071a513864d5b3038eeb3ed3e2fae21fd377bfe082d9c6666afd/cancel
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{
  "idempotencyKey": "debate-run-2-cancel"
}

# 200. Calls in flight are interrupted; the run ends cancelled (caller_cancelled) once they settle,
# with empty criteria and a null outputDigest. A queued run would be cancelled at once.
{
  "id": "evx_e92efcbcec15071a513864d5b3038eeb3ed3e2fae21fd377bfe082d9c6666afd",
  "operation": {
    "operationId": "op_f63a683299c17f99fe6f4f972795224c",
    "idempotencyKey": "debate-run-2",
    "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908"
  },
  "status": "cancelling",
  "terminalReason": null,
  "rubric": {…},
  "profile": {…},
  "model": "provider/judge-model",
  "contractVersion": 1,
  "serviceRevision": "roye-2026-10-27.1",
  "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908",
  "outputDigest": null,
  "plan": {…},
  "qualification": {…},
  "criteria": [],
  "executionSettled": false,
  "meteringSettled": false,
  "accounting": "reserved",
  "createdAt": 1793000200000,
  "startedAt": 1793000200600
}
Cancel a completed run
POST /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9/cancel
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{
  "idempotencyKey": "debate-run-1-cancel"
}

# 200. The completed run is unchanged. A cancel answers the content-free view in every state:
# criterion results without evidence or rationales. Read the results with GET /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9.
{
  "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9",
  "operation": {
    "operationId": "op_c38dcfde2cd1d8af04be1c1e25068f2a",
    "idempotencyKey": "debate-run-1",
    "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908"
  },
  "status": "completed",
  "terminalReason": "completed",
  "rubric": {…},
  "profile": {…},
  "model": "provider/judge-model",
  "contractVersion": 1,
  "serviceRevision": "roye-2026-10-27.1",
  "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908",
  "outputDigest": "35bd780826cfef881c8f0206c281e407c0b8d08ad83c93fb0447b3bc57c8b1f3",
  "plan": {…},
  "qualification": {…},
  "criteria": [
    {
      "id": "rebuttal",
      "kind": "ordinal",
      "status": "scored",
      "level": "3",
      "score": 0.75,
      "evidenceRejected": 0
    },
    {
      "id": "stayedOnMotion",
      "kind": "binary",
      "status": "scored",
      "level": "pass",
      "score": 1,
      "evidenceRejected": 0
    },
    {
      "id": "talkShare",
      "kind": "metric",
      "status": "computed",
      "value": 0.6819672131147541
    }
  ],
  "overall": {
    "score": 0.88,
    "basis": [
      "rebuttal",
      "stayedOnMotion"
    ]
  },
  "executionSettled": true,
  "meteringSettled": true,
  "accounting": "settled",
  "createdAt": 1793000120000,
  "startedAt": 1793000120800,
  "finishedAt": 1793000139300
}
Purge a run
POST /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9/purge
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{
  "idempotencyKey": "debate-run-1-purge"
}

# 200. The content-free view above with purgedAt; the request, transcript, evidence and rationales are gone.
{
  "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9",
  "operation": {
    "operationId": "op_c38dcfde2cd1d8af04be1c1e25068f2a",
    "idempotencyKey": "debate-run-1",
    "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908"
  },
  "status": "completed",
  "terminalReason": "completed",
  "rubric": {…},
  "profile": {…},
  "model": "provider/judge-model",
  "contractVersion": 1,
  "serviceRevision": "roye-2026-10-27.1",
  "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908",
  "outputDigest": "35bd780826cfef881c8f0206c281e407c0b8d08ad83c93fb0447b3bc57c8b1f3",
  "plan": {…},
  "qualification": {…},
  "criteria": […],
  "overall": {
    "score": 0.88,
    "basis": [
      "rebuttal",
      "stayedOnMotion"
    ]
  },
  "executionSettled": true,
  "meteringSettled": true,
  "accounting": "settled",
  "createdAt": 1793000120000,
  "startedAt": 1793000120800,
  "finishedAt": 1793000139300,
  "purgedAt": 1793000400000
}

엔드포인트

경로는 /v1/evaluations 아래에 있고 백엔드 키를 받습니다. 쓰기 요청의 idempotencyKey는 프로젝트, 환경, 모듈, kind, target 범위 안에서 구분됩니다.

경로용도응답
GET /profiles/conversation-rubric/revisions/1카탈로그 항목 읽기.200. 다른 리비전은 404 not_found.
POST /rubrics루브릭 만들기.201 { rubric, revision }. kind rubrics.create, target {}.
POST /rubrics/{rubricId}/revisions루브릭 고치기.201 { rubric, revision }. kind rubrics.revise, target { rubricId }.
GET /rubrics/{rubricId}루브릭 읽기.latestRevision과 함께 200.
GET /rubrics/{rubricId}/revisions/{revision}리비전 읽기.digest와 본문과 함께 200.
POST /plans계획 조회.200 { callCount, calls }. 요금표가 준비되면 maximumMicros와 policyRevision도 담깁니다. 키 없음.
POST /runs실행 시작.queued 상태의 실행 뷰와 함께 202. kind runs.create, target {}.
GET /runs/{runId}실행 조회.실행 뷰와 함께 200. waitMs 0~30,000으로 종료 상태까지 기다립니다.
GET /runs/{runId}/events실행 이벤트 조회.200 { events, cursor, executionSettled, meteringSettled }.
POST /runs/{runId}/cancel실행 취소.대화 내용을 뺀 실행 뷰와 함께 200. kind runs.cancel, target { runId }.
POST /runs/{runId}/purge실행 내용 삭제.purgedAt이 붙은 실행 뷰와 함께 200. kind runs.purge, target { runId }.

한도

입력을 잘라 내지 않습니다. 한도를 넘으면 payload_limit이고, 논증 맵 한도만 예외입니다. 출력 토큰 한도는 Roye가 보내는 호출에만 걸리며 요청을 거부하지 않습니다. 프로젝트 정책이 더 엄격할 수 있습니다.

한도값
루브릭, 대화 기록정규 JSON 64 KiB, 256 KiB.
요청 본문1 MiB.
계획 호출실행당 64개.
출력 토큰기준 호출 4,096, 논증 맵과 feedback 8,192.
논증 맵발화 200개. 넘으면 맵을 쓰는 기준이 적용되지 않고(transcript_too_long_for_map) 호출도 없습니다.
페이지당 이벤트64개.
waitMs0~30,000ms.
대기 중인 실행24시간 안에 시작되지 않으면 expired로 끝납니다.
실행 기한시작 후 1,200,000ms(20분).

오류

오류는 공통 오류 형식을 씁니다. 필드 오류는 error.field에 /criteria/0/levels/2/id 같은 JSON Pointer를 담고, 모르는 필드는 /criteria/0/notes처럼 그 필드 자체를 가리킵니다. 본문 전체에 걸린 한도는 필드를 가리키지 않습니다. 실행을 접수할 때는 플랫폼의 기존 할당량, 자금, 가용성 오류 코드도 받을 수 있습니다.

코드HTTP원인과 대응
invalid_request400모르는 값, 빠진 값, 겹치는 값, 선언되지 않은 값, 범위를 벗어난 값(예: 2개보다 적은 수준, 예약된 수준 ID, 짝 없는 서로게이트)입니다. 경로가 받지 않는 쿼리 매개변수, 0~30,000을 벗어난 waitMs, 실행에 아직 없는 이벤트를 가리키는 cursor도 해당합니다.
payload_limit413한도나 개수를 넘었습니다(예: 수준 11개 초과). 1 MiB를 넘는 본문은 파싱 전에 거부합니다.
unsupported_capability400제공 범위 밖의 설정, capabilities에 나오지 않는 프로필 리비전, 카탈로그에 없는 모델입니다.
not_found404없거나, 범위 밖이거나, 만료되거나 지워진 루브릭·리비전(조회할 때와 계획이나 새 실행에서 지정할 때), 모르는 프로필 리비전, 없거나 범위 밖인 실행, 모듈을 제공하지 않는 배포입니다.
revision_conflict409expectedRevision이 최신이 아닙니다. 루브릭을 읽고 새 키로 다시 보내세요.
idempotency_conflict409다른 본문에 이미 쓴 키입니다. 원래 호출을 복구하세요.
not_ready409프로젝트의 요금표나 자금이 준비되지 않아 실행을 접수하지 못했습니다. 아무것도 접수하거나 예약하지 않습니다.
budget_exhausted409사용 가능한 크레딧으로 계획의 maximumMicros를 감당할 수 없어 실행을 접수하지 못했습니다. 아무것도 접수하거나 예약하지 않습니다.
contract_version_unsupported400계약 1을 쓰세요.

복구

키는 영문자, 숫자, -, _ 1~80자입니다. 보내기 전에 키를 본문과 함께 저장하고, 결과가 불확실한 쓰기를 새 키로 재시도하지 마세요. 같은 키와 본문을 보내면 원래 응답을 Roye-Replayed: true와 함께 다시 돌려줍니다. 루브릭 쓰기는 요청 안에서 끝나지만 실행은 접수된 뒤에도 계속 진행되므로 취소로 멈춥니다. 조회, 계획, 이벤트에는 키가 필요 없습니다.

상황대응
쓰기 응답을 받지 못함같은 키로 다시 보내거나, POST /v1/operations/recover에 module evaluations, 엔드포인트의 kind와 target, 원래 키를 보내 복구하세요.
실행 접수 응답을 받지 못함같은 방법으로 kind runs.create, target {}를 보내 복구하세요. 새 키로 보내면 실행이 하나 더 시작됩니다.
복구 결과가 not_found커밋된 것이 없습니다. 같은 키로 다시 보내세요.
같은 키로 다른 작업새 키를 쓰세요.
Recover a lost response
POST /v1/operations/recover
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Content-Type: application/json

{
  "module": "evaluations",
  "kind": "rubrics.revise",
  "target": {
    "rubricId": "evr_55cb3e93643989b563ca29e2560ee818"
  },
  "idempotencyKey": "debate-rubric-2"
}

# 200: the operation record of the original revise.
# 404 not_found: nothing was committed under the key, so send the same request with the same key.

# A lost run admission is recovered the same way, never with a new key.
{
  "module": "evaluations",
  "kind": "runs.create",
  "target": {},
  "idempotencyKey": "debate-run-1"
}

고객이 모두 연결을 끊어도 Roye는 접수한 실행을 모두 종료 상태까지 진행합니다. 연결을 유지하거나 대기열을 고치거나 실행을 직접 마무리할 필요가 없습니다. 조회, 대기, 이벤트는 상태를 보여 줄 뿐 실행에 영향을 주지 않습니다.

  • 공급자 쪽 작업이 기록됐거나 일어났을 수 있는 호출은 다시 보내지 않습니다. 작업자(worker)가 사라져도 실행은 이어서 진행되고, 그 호출의 기준은 uncertain: true로 실패합니다.
  • 호출이 공급자에게 가기 전에 Roye 쪽 오류로 멈추면 그 시도만 끝납니다. 진행 중인 호출은 그대로 마무리되고, Roye는 멈춘 호출을 실행 기한 전까지 다음 시도에서 다시 보냅니다.

사용량과 요금

실행을 접수할 때 계획의 maximumMicros를 예약하고, 실행이 끝나면 요금을 청구합니다. 실행 뷰의 accounting은 그때까지 reserved이고, 청구가 확정되면 settled, 어떤 호출의 사용량이 불확실하게 남아 있으면 uncertain입니다. 리플레이, 조회, 대기, 이벤트에는 요금이 없고, 프로필 조회, 루브릭 쓰기, 계획도 마찬가지입니다.

결과청구
completed실행한 모든 호출의 측정 사용량. 실패한 기준의 호출도 포함합니다.
failed, expired없음.
cancelled이미 실행된 호출에서 신뢰할 수 있게 확인된 소비 단위만.
불확실하게 남은 사용량72시간 선의 면제(goodwill) 정책에 따라 해제됩니다(결제와 사용량).

실행의 사용량 기록은 GET /v1/billing/usage 목록에 나오며, source는 module evaluations, type run, 실행 ID입니다. 계획의 호출이 8개를 넘으면 그 기록에는 pricing이 없습니다. 호출마다의 상한은 계획에 이미 나와 있습니다.

실행의 청구 기록은 청구 계약 1의 GET /v1/billing/usage/evaluations/RUN_ID나 roye.billing.usage.getEvaluationRun으로 조회합니다. 범위를 지정한 키에는 billing 범위가 있어야 합니다. 없는 실행, 다른 프로젝트나 환경의 실행, 모델 호출을 계획하지 않은 실행에는 청구 기록이 없어 not_found를 반환합니다. not_found는 청구액이 0이라는 뜻이 아닙니다. 내용을 삭제해도 청구 기록은 남습니다.

Read a run's bill
GET /v1/billing/usage/evaluations/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

# 200 under billing contract 1, once the completed run above has settled. The charge is illustrative. pricing, the frozen
# disclosure of each call's bound, is left out here; a run of more than eight calls has none. original is deprecated:
# read source.
{
  "id": "use_00025e433b7eccc13f3d83666d484d8179dc32a4df74a599041dd3df3c3a7d2d",
  "scope": {
    "projectId": "my-project",
    "environment": "development"
  },
  "source": {
    "module": "evaluations",
    "type": "run",
    "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
  },
  "original": {
    "namespace": "royeEvaluationRuns",
    "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
  },
  "currency": "USD",
  "maximumMicros": 742500,
  "heldMicros": 0,
  "chargedMicros": 3150,
  "releasedMicros": 739350,
  "state": "settled",
  "reason": "completed",
  "companyId": null,
  "createdAt": 1793000120000,
  "releaseAt": 1793259320000,
  "settledAt": 1793000139300
}

# A run that planned no model call, a run ID that was never admitted and another project's run: 404 not_found.

SDK 클라이언트

비공개 워크스페이스 패키지 @roye-ai/client의 roye.evaluations는 위 경로를 그대로 호출합니다. 이 패키지는 아직 배포하지 않았습니다. 메서드마다 경로 하나에 요청을 한 번 보내며, 모두 계약 1을 고릅니다.

  • 메서드는 profiles.get, rubrics.create·revise·get·getRevision, plans.create, runs.create·get·wait·events·cancel·purge입니다. 실행의 청구 기록은 roye.billing.usage.getEvaluationRun으로 조회합니다.
  • 루브릭과 실행을 만들거나 바꾸는 호출에는 idempotencyKey가 필요합니다. 저장해 둔 키를 넘기거나 인텐트 저장소를 주입하세요. 저장소가 있으면 SDK가 보내기 전에 키를 저장하고, 재시작한 뒤에는 roye.intents.resume()이 새 키를 만들지 않고 그 키로 원래 작업을 복구합니다.
  • SDK는 요청을 보내기 전에 입력을 검사합니다. 일시적 실패와 rate_limited일 때만 같은 키와 본문으로 다시 시도합니다.
  • runs.wait는 waitMs를 0부터 30,000까지 받으며 기본값은 30,000입니다. runs.events에는 이전 페이지의 cursor를 넘기세요.
  • 미리보기에서 새로 생긴 값이 실행 뷰, 이벤트 페이지, 카탈로그 항목에 오면 SDK는 오류 없이 문자열 그대로 돌려줍니다. 실행 상태, 종료 사유, 평가 기준 종류, 적용 불가 사유, 단계가 그 예입니다. 다만 평가 기준 결과의 status와 이벤트의 type은 기록에 어떤 필드가 들어갈지 결정하므로 알려진 값만 받습니다. 요청에 다시 넣는 카탈로그의 samples도 마찬가지입니다.
  • 저장된 리비전 본문은 요청 본문으로 그대로 쓸 수 있지만, 64 KiB 한도에 가깝다면 보낸 본문을 다시 보내세요(루브릭 본문). SDK는 리비전 본문을 엄격하게 읽으므로, SDK에 정의되지 않은 평가 기준 종류나 지표가 들어 있으면 오류가 납니다.
SDK client
import { EphemeralIntentStore, Roye } from '@roye-ai/client';

// EphemeralIntentStore is for tests and scripts; give production code your own durable IntentStore.
const roye = new Roye({ baseURL, token: () => backendKey, projectId, environment: 'development', intents: new EphemeralIntentStore() });

const entry = await roye.evaluations.profiles.get('conversation-rubric', '1');
// Keep the body you sent: the stored revision body holds the defaults and can exceed 64 KiB near the bound.
const body = { name: 'Debate practice', criteria, aggregate };
const created = await roye.evaluations.rubrics.create({ idempotencyKey: 'debate-rubric-1', ...body });
const { rubric, revision } = await roye.evaluations.rubrics.revise(created.rubric.id, {
  idempotencyKey: 'debate-rubric-2', expectedRevision: created.rubric.latestRevision,
  ...body, name: 'Debate practice (v2)',
});
const request = {
  rubric: { id: rubric.id, revision: revision.revision },
  profile: { id: 'conversation-rubric', revision: '1' },
  model: 'provider/judge-model', // one of entry.models
  transcript, target: { speakerIds: ['student'] }, context: { text: motion }, outputLanguage: 'ko',
};
const plan = await roye.evaluations.plans.create(request); // reserves and charges nothing
const run = await roye.evaluations.runs.create({ idempotencyKey: 'debate-run-1', ...request });
const done = await roye.evaluations.runs.wait(run.id, { waitMs: 30000 });
const page = await roye.evaluations.runs.events(run.id);
const later = await roye.evaluations.runs.events(run.id, { cursor: page.cursor });
const bill = await roye.billing.usage.getEvaluationRun(run.id);
await roye.evaluations.runs.purge(run.id, { idempotencyKey: 'debate-run-1-purge' });

// After a restart, with the same durable store: recovers unresolved writes by their keys, never with a new key.
const resumed = await roye.intents.resume();