> This page is also available as Markdown: append .md to its URL. The full index of Sikaru docs is at https://docs.sikaru.ai/llms.txt. Code examples use only operations from the public API reference at https://docs.sikaru.ai/api-reference.

# Update Agent Grader

PATCH https://api.sikaru.ai/v1/projects/{project_id}/agents/{agent_id}/graders/{grader_id}
Content-Type: application/json

Change the description, judge, escalation or release check. A judge or escalation change saves a provisional
version that goes live only once it clears the promotion rule; the other settings change no verdict.

Reference: https://docs.sikaru.ai/api-reference/graders/update

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `grader_id` (string, required)
- `project_id` (string, required)
- `agent_id` (string, required)

### Body (application/json)

This endpoint expects a SettingsBody.

- `description` (string, optional, nullable)
- `escalate` (boolean, optional, nullable)
- `judge` (JudgeChoice, optional, nullable)
- `reason` (string, optional, nullable) — Why a check that blocks a release is turned off or loosened; required then, and recorded.
- `releaseCheck` (CheckChoice, optional, nullable)

## Response

### 200

Successful Response

- `bar` (Bar, required)
- `criteria` (list of CriterionView, required)
- `criteriaVersion` (integer, required, nullable)
- `current` (GraderVersionView, required, nullable) — The live version, else the newest.
- `description` (string, required)
- `escalate` (boolean, required) — Uncertain conversations go to the LLM judge (decision model only).
- `failureId` (string, required, nullable)
- `file` (GraderFileView, required, nullable) — The agent-folder file that defines this Grader, if any.
- `id` (string, required)
- `judge` (JudgeView, required)
- `labels` (LabelCounts, required)
- `latest` (GraderVersionView, required, nullable)
- `name` (string, required)
- `origin` (string, required)
- `pause` (PauseView, required, nullable)
- `refitting` (boolean, required)
- `releaseCheck` (ReleaseCheckView, required)
- `staleSince` (string, required, nullable)
- `status` (enum, required)
  - Allowed values: `live`, `provisional`, `uncalibrated`
- `versions` (list of GraderVersionView, required) — Newest first.

## Errors

### 401 Unauthorized Error

Missing or invalid credentials (`unauthenticated`).

- `code` (string, required) — Stable machine code. Specific values: `credits_exhausted` (402): Your organization has no available credits. Add credits in Billing to continue.; `spend_limit_reached` (402): A spending limit has been reached. Review the organization's monthly limit and agent caps in Billing.; `billing_unavailable` (503): Spending confirmation is temporarily unavailable. Your progress is saved; retry shortly.; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `still_blocked` (409): funding still prevents this work from resuming; inspect reason; `not_resumable` (409): the run is not waiting for funding or has already resumed; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now; `top_up_unavailable` (409): agent credit top-ups are not available for this organization; `top_up_amount_out_of_range` (422): the amount must be whole cents within the per-top-up minimum and maximum; `top_up_blocked` (409): agent top-ups are paused for this organization until support clears them; `release_check_blocked` (409): a release check blocked this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `release_check_unverified` (409): a release check couldn't verify this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `invalid_grader_file` (422): a Grader file is invalid; `detail` names its path and line; `invalid_grader` (422): the Grader's criteria are invalid; `grader_admin_required` (403): changing a Grader's judge, escalation or release check, or removing a Grader file, needs Grader admin credentials; `grading_off` (409): personal and end-user agents are never graded; `reason_required` (409): turning off or loosening a release check that blocks a release needs a reason, given from the dashboard or the API; `release_check_refused` (409): the release check cannot be turned on: the Grader has no live version; `preset_judge_fixed` (409): built-in Graders keep the decision model and never escalate; `escalation_unavailable` (422): only a Grader judged by the decision model can escalate; `missing_field` (422): a required field for this request is missing; `judge_is_graded_agent` (409): an agent cannot judge its own conversations; `judge_content_private` (409): a personal or end-user agent cannot be a judge; `judge_not_live` (409): the judge agent needs a live version first; `judge_needs_setup` (409): the judge agent must be set up to read a copy of the conversation; `test_unavailable` (503): Grader testing is unavailable right now; `estimate_unavailable` (503): judge pricing is unavailable right now; `regrade_refused` (409): the Grader has no version, or the selected window has no or too many conversations; `regrade_unavailable` (503): history re-scoring is unavailable right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (ErrorResponseDetail, required)
- `reason` (string, optional, nullable) — Current funding reason when code is still_blocked.
- `topUp` (TopUpHint, optional, nullable) — Set on `credits_exhausted`, and on `still_blocked` with that reason, while agent top-ups are available.

### 403 Forbidden Error

The credential lacks access or a required scope (`forbidden`).

- `code` (string, required) — Stable machine code. Specific values: `credits_exhausted` (402): Your organization has no available credits. Add credits in Billing to continue.; `spend_limit_reached` (402): A spending limit has been reached. Review the organization's monthly limit and agent caps in Billing.; `billing_unavailable` (503): Spending confirmation is temporarily unavailable. Your progress is saved; retry shortly.; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `still_blocked` (409): funding still prevents this work from resuming; inspect reason; `not_resumable` (409): the run is not waiting for funding or has already resumed; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now; `top_up_unavailable` (409): agent credit top-ups are not available for this organization; `top_up_amount_out_of_range` (422): the amount must be whole cents within the per-top-up minimum and maximum; `top_up_blocked` (409): agent top-ups are paused for this organization until support clears them; `release_check_blocked` (409): a release check blocked this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `release_check_unverified` (409): a release check couldn't verify this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `invalid_grader_file` (422): a Grader file is invalid; `detail` names its path and line; `invalid_grader` (422): the Grader's criteria are invalid; `grader_admin_required` (403): changing a Grader's judge, escalation or release check, or removing a Grader file, needs Grader admin credentials; `grading_off` (409): personal and end-user agents are never graded; `reason_required` (409): turning off or loosening a release check that blocks a release needs a reason, given from the dashboard or the API; `release_check_refused` (409): the release check cannot be turned on: the Grader has no live version; `preset_judge_fixed` (409): built-in Graders keep the decision model and never escalate; `escalation_unavailable` (422): only a Grader judged by the decision model can escalate; `missing_field` (422): a required field for this request is missing; `judge_is_graded_agent` (409): an agent cannot judge its own conversations; `judge_content_private` (409): a personal or end-user agent cannot be a judge; `judge_not_live` (409): the judge agent needs a live version first; `judge_needs_setup` (409): the judge agent must be set up to read a copy of the conversation; `test_unavailable` (503): Grader testing is unavailable right now; `estimate_unavailable` (503): judge pricing is unavailable right now; `regrade_refused` (409): the Grader has no version, or the selected window has no or too many conversations; `regrade_unavailable` (503): history re-scoring is unavailable right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (ErrorResponseDetail, required)
- `reason` (string, optional, nullable) — Current funding reason when code is still_blocked.
- `topUp` (TopUpHint, optional, nullable) — Set on `credits_exhausted`, and on `still_blocked` with that reason, while agent top-ups are available.

### 404 Not Found Error

The resource or route does not exist (`not_found`).

- `code` (string, required) — Stable machine code. Specific values: `credits_exhausted` (402): Your organization has no available credits. Add credits in Billing to continue.; `spend_limit_reached` (402): A spending limit has been reached. Review the organization's monthly limit and agent caps in Billing.; `billing_unavailable` (503): Spending confirmation is temporarily unavailable. Your progress is saved; retry shortly.; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `still_blocked` (409): funding still prevents this work from resuming; inspect reason; `not_resumable` (409): the run is not waiting for funding or has already resumed; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now; `top_up_unavailable` (409): agent credit top-ups are not available for this organization; `top_up_amount_out_of_range` (422): the amount must be whole cents within the per-top-up minimum and maximum; `top_up_blocked` (409): agent top-ups are paused for this organization until support clears them; `release_check_blocked` (409): a release check blocked this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `release_check_unverified` (409): a release check couldn't verify this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `invalid_grader_file` (422): a Grader file is invalid; `detail` names its path and line; `invalid_grader` (422): the Grader's criteria are invalid; `grader_admin_required` (403): changing a Grader's judge, escalation or release check, or removing a Grader file, needs Grader admin credentials; `grading_off` (409): personal and end-user agents are never graded; `reason_required` (409): turning off or loosening a release check that blocks a release needs a reason, given from the dashboard or the API; `release_check_refused` (409): the release check cannot be turned on: the Grader has no live version; `preset_judge_fixed` (409): built-in Graders keep the decision model and never escalate; `escalation_unavailable` (422): only a Grader judged by the decision model can escalate; `missing_field` (422): a required field for this request is missing; `judge_is_graded_agent` (409): an agent cannot judge its own conversations; `judge_content_private` (409): a personal or end-user agent cannot be a judge; `judge_not_live` (409): the judge agent needs a live version first; `judge_needs_setup` (409): the judge agent must be set up to read a copy of the conversation; `test_unavailable` (503): Grader testing is unavailable right now; `estimate_unavailable` (503): judge pricing is unavailable right now; `regrade_refused` (409): the Grader has no version, or the selected window has no or too many conversations; `regrade_unavailable` (503): history re-scoring is unavailable right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (ErrorResponseDetail, required)
- `reason` (string, optional, nullable) — Current funding reason when code is still_blocked.
- `topUp` (TopUpHint, optional, nullable) — Set on `credits_exhausted`, and on `still_blocked` with that reason, while agent top-ups are available.

### 409 Conflict Error

`reason_required`: turning off or loosening a release check that blocks a release needs a reason, given from the dashboard or the API. `release_check_refused`: the release check cannot be turned on: the Grader has no live version. `preset_judge_fixed`: built-in Graders keep the decision model and never escalate. `judge_is_graded_agent`: an agent cannot judge its own conversations. `judge_content_private`: a personal or end-user agent cannot be a judge. `judge_not_live`: the judge agent needs a live version first. `judge_needs_setup`: the judge agent must be set up to read a copy of the conversation. `grading_off`: personal and end-user agents are never graded.

- `code` (string, required) — Stable machine code. Specific values: `credits_exhausted` (402): Your organization has no available credits. Add credits in Billing to continue.; `spend_limit_reached` (402): A spending limit has been reached. Review the organization's monthly limit and agent caps in Billing.; `billing_unavailable` (503): Spending confirmation is temporarily unavailable. Your progress is saved; retry shortly.; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `still_blocked` (409): funding still prevents this work from resuming; inspect reason; `not_resumable` (409): the run is not waiting for funding or has already resumed; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now; `top_up_unavailable` (409): agent credit top-ups are not available for this organization; `top_up_amount_out_of_range` (422): the amount must be whole cents within the per-top-up minimum and maximum; `top_up_blocked` (409): agent top-ups are paused for this organization until support clears them; `release_check_blocked` (409): a release check blocked this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `release_check_unverified` (409): a release check couldn't verify this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `invalid_grader_file` (422): a Grader file is invalid; `detail` names its path and line; `invalid_grader` (422): the Grader's criteria are invalid; `grader_admin_required` (403): changing a Grader's judge, escalation or release check, or removing a Grader file, needs Grader admin credentials; `grading_off` (409): personal and end-user agents are never graded; `reason_required` (409): turning off or loosening a release check that blocks a release needs a reason, given from the dashboard or the API; `release_check_refused` (409): the release check cannot be turned on: the Grader has no live version; `preset_judge_fixed` (409): built-in Graders keep the decision model and never escalate; `escalation_unavailable` (422): only a Grader judged by the decision model can escalate; `missing_field` (422): a required field for this request is missing; `judge_is_graded_agent` (409): an agent cannot judge its own conversations; `judge_content_private` (409): a personal or end-user agent cannot be a judge; `judge_not_live` (409): the judge agent needs a live version first; `judge_needs_setup` (409): the judge agent must be set up to read a copy of the conversation; `test_unavailable` (503): Grader testing is unavailable right now; `estimate_unavailable` (503): judge pricing is unavailable right now; `regrade_refused` (409): the Grader has no version, or the selected window has no or too many conversations; `regrade_unavailable` (503): history re-scoring is unavailable right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (ErrorResponseDetail, required)
- `reason` (string, optional, nullable) — Current funding reason when code is still_blocked.
- `topUp` (TopUpHint, optional, nullable) — Set on `credits_exhausted`, and on `still_blocked` with that reason, while agent top-ups are available.

### 422 Unprocessable Entity Error

`escalation_unavailable`: only a Grader judged by the decision model can escalate. `missing_field`: a required field for this request is missing.

- `code` (string, required) — Stable machine code. Specific values: `credits_exhausted` (402): Your organization has no available credits. Add credits in Billing to continue.; `spend_limit_reached` (402): A spending limit has been reached. Review the organization's monthly limit and agent caps in Billing.; `billing_unavailable` (503): Spending confirmation is temporarily unavailable. Your progress is saved; retry shortly.; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `still_blocked` (409): funding still prevents this work from resuming; inspect reason; `not_resumable` (409): the run is not waiting for funding or has already resumed; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now; `top_up_unavailable` (409): agent credit top-ups are not available for this organization; `top_up_amount_out_of_range` (422): the amount must be whole cents within the per-top-up minimum and maximum; `top_up_blocked` (409): agent top-ups are paused for this organization until support clears them; `release_check_blocked` (409): a release check blocked this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `release_check_unverified` (409): a release check couldn't verify this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `invalid_grader_file` (422): a Grader file is invalid; `detail` names its path and line; `invalid_grader` (422): the Grader's criteria are invalid; `grader_admin_required` (403): changing a Grader's judge, escalation or release check, or removing a Grader file, needs Grader admin credentials; `grading_off` (409): personal and end-user agents are never graded; `reason_required` (409): turning off or loosening a release check that blocks a release needs a reason, given from the dashboard or the API; `release_check_refused` (409): the release check cannot be turned on: the Grader has no live version; `preset_judge_fixed` (409): built-in Graders keep the decision model and never escalate; `escalation_unavailable` (422): only a Grader judged by the decision model can escalate; `missing_field` (422): a required field for this request is missing; `judge_is_graded_agent` (409): an agent cannot judge its own conversations; `judge_content_private` (409): a personal or end-user agent cannot be a judge; `judge_not_live` (409): the judge agent needs a live version first; `judge_needs_setup` (409): the judge agent must be set up to read a copy of the conversation; `test_unavailable` (503): Grader testing is unavailable right now; `estimate_unavailable` (503): judge pricing is unavailable right now; `regrade_refused` (409): the Grader has no version, or the selected window has no or too many conversations; `regrade_unavailable` (503): history re-scoring is unavailable right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (ErrorResponseDetail, required)
- `reason` (string, optional, nullable) — Current funding reason when code is still_blocked.
- `topUp` (TopUpHint, optional, nullable) — Set on `credits_exhausted`, and on `still_blocked` with that reason, while agent top-ups are available.

### 503 Service Unavailable Error

`storage_unavailable`: the storage behind this resource is unavailable right now.

- `code` (string, required) — Stable machine code. Specific values: `credits_exhausted` (402): Your organization has no available credits. Add credits in Billing to continue.; `spend_limit_reached` (402): A spending limit has been reached. Review the organization's monthly limit and agent caps in Billing.; `billing_unavailable` (503): Spending confirmation is temporarily unavailable. Your progress is saved; retry shortly.; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `still_blocked` (409): funding still prevents this work from resuming; inspect reason; `not_resumable` (409): the run is not waiting for funding or has already resumed; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now; `top_up_unavailable` (409): agent credit top-ups are not available for this organization; `top_up_amount_out_of_range` (422): the amount must be whole cents within the per-top-up minimum and maximum; `top_up_blocked` (409): agent top-ups are paused for this organization until support clears them; `release_check_blocked` (409): a release check blocked this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `release_check_unverified` (409): a release check couldn't verify this version; `detail` is an object with `message`, `publicationId` (the publication Publish Anyway releases) and `results`, one per Grader: `graderId`, `name`, `outcome` (`blocked` or `couldnt_verify`), `flagged` (up to 10 conversation keys flagged only for this version) and `flaggedCount`; `invalid_grader_file` (422): a Grader file is invalid; `detail` names its path and line; `invalid_grader` (422): the Grader's criteria are invalid; `grader_admin_required` (403): changing a Grader's judge, escalation or release check, or removing a Grader file, needs Grader admin credentials; `grading_off` (409): personal and end-user agents are never graded; `reason_required` (409): turning off or loosening a release check that blocks a release needs a reason, given from the dashboard or the API; `release_check_refused` (409): the release check cannot be turned on: the Grader has no live version; `preset_judge_fixed` (409): built-in Graders keep the decision model and never escalate; `escalation_unavailable` (422): only a Grader judged by the decision model can escalate; `missing_field` (422): a required field for this request is missing; `judge_is_graded_agent` (409): an agent cannot judge its own conversations; `judge_content_private` (409): a personal or end-user agent cannot be a judge; `judge_not_live` (409): the judge agent needs a live version first; `judge_needs_setup` (409): the judge agent must be set up to read a copy of the conversation; `test_unavailable` (503): Grader testing is unavailable right now; `estimate_unavailable` (503): judge pricing is unavailable right now; `regrade_refused` (409): the Grader has no version, or the selected window has no or too many conversations; `regrade_unavailable` (503): history re-scoring is unavailable right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (ErrorResponseDetail, required)
- `reason` (string, optional, nullable) — Current funding reason when code is still_blocked.
- `topUp` (TopUpHint, optional, nullable) — Set on `credits_exhausted`, and on `still_blocked` with that reason, while agent top-ups are available.

## Types

### JudgeChoice

- `kind` (enum, required)
  - Allowed values: `decision-model`, `llm`, `agent`
- `agentId` (string, optional, nullable)

### CheckChoice

- `enabled` (boolean, required)
- `ceiling` (double, optional, nullable) — The flag-rate ceiling; null removes it, and leaving it out keeps the current one.

### Bar

- `agreement` (double, required)
- `heldOut` (integer, required)

### CriterionView

- `description` (string, required)
- `kind` (string, required)
- `name` (string, required)

### GraderVersionView

- `agreement` (double, required, nullable) — Held-out agreement with the owner's labels, 0 to 1.
- `createdAt` (string, required, nullable)
- `heldOut` (integer, required) — Labels the agreement was measured on.
- `labelCount` (integer, required)
- `status` (enum, required)
  - Allowed values: `provisional`, `live`, `retired`
- `version` (integer, required)

### GraderFileView

- `path` (string, required) — graders/\<name>.toml in the agent folder.
- `retired` (boolean, required) — The file was removed: the Grader no longer scores or checks; labels stay.

### JudgeView

- `agentId` (string, required, nullable) — The project agent that judges, for an agent judge.
- `kind` (enum, required)
  - Allowed values: `decision-model`, `llm`, `agent`

### LabelCounts

- `flagged` (integer, required)
- `looksFine` (integer, required)
- `total` (integer, required)

### PauseView

- `message` (string, required)
- `reason` (string, required)

### ReleaseCheckView

- `ceiling` (double, required, nullable) — The flag rate above which a release is blocked, 0 to 1.
- `enabled` (boolean, required)

### ErrorResponseDetail

- string
- map from string to any

### TopUpHint

An agent can add credits itself: create a top-up offer, then pay its URL.

- `cli` (string, required) — CLI command that creates the top-up offer.
- `maxUsd` (string, required)
- `minUsd` (string, required)
- `operation` (string, required) — SDK operation that creates the top-up offer.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "bar": {
    "agreement": 1.1,
    "heldOut": 1
  },
  "criteria": [
    {
      "description": "string",
      "kind": "string",
      "name": "string"
    }
  ],
  "criteriaVersion": 1,
  "current": {
    "agreement": 1.1,
    "createdAt": "string",
    "heldOut": 1,
    "labelCount": 1,
    "status": "provisional",
    "version": 1
  },
  "description": "string",
  "escalate": true,
  "failureId": "string",
  "file": {
    "path": "string",
    "retired": true
  },
  "id": "string",
  "judge": {
    "agentId": "string",
    "kind": "decision-model"
  },
  "labels": {
    "flagged": 1,
    "looksFine": 1,
    "total": 1
  },
  "latest": {
    "agreement": 1.1,
    "createdAt": "string",
    "heldOut": 1,
    "labelCount": 1,
    "status": "provisional",
    "version": 1
  },
  "name": "string",
  "origin": "string",
  "pause": {
    "message": "string",
    "reason": "string"
  },
  "refitting": true,
  "releaseCheck": {
    "ceiling": 1.1,
    "enabled": true
  },
  "staleSince": "string",
  "status": "live",
  "versions": [
    {
      "agreement": 1.1,
      "createdAt": "string",
      "heldOut": 1,
      "labelCount": 1,
      "status": "provisional",
      "version": 1
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.sikaru.ai/v1/projects/project_id/agents/agent_id/graders/grader_id"

payload = {}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.sikaru.ai/v1/projects/project_id/agents/agent_id/graders/grader_id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sikaru.ai/v1/projects/project_id/agents/agent_id/graders/grader_id"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.sikaru.ai/v1/projects/project_id/agents/agent_id/graders/grader_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.sikaru.ai/v1/projects/project_id/agents/agent_id/graders/grader_id")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.sikaru.ai/v1/projects/project_id/agents/agent_id/graders/grader_id', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.sikaru.ai/v1/projects/project_id/agents/agent_id/graders/grader_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sikaru.ai/v1/projects/project_id/agents/agent_id/graders/grader_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```