Start an improvement pass
const url = 'https://example.com/v1/proposals/improve';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"agentId":"example","fromVersion":"example","scope":{"kind":"tenant"},"suiteId":"example","tiers":["settings"],"model":{"providerId":"example","model":"example"},"candidates":3,"classWeights":"as-recorded","objective":"weightedYesShare","budget":{"maxCostUsd":1,"maxCandidates":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/proposals/improve \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "agentId": "example", "fromVersion": "example", "scope": { "kind": "tenant" }, "suiteId": "example", "tiers": [ "settings" ], "model": { "providerId": "example", "model": "example" }, "candidates": 3, "classWeights": "as-recorded", "objective": "weightedYesShare", "budget": { "maxCostUsd": 1, "maxCandidates": 1 } }'The runtime looks for better values for the version’s tunable settings (keys its settings blocks’ schemas mark x-kindgi-tunable) on the test set, within the budget, and writes its best candidate as an improvement proposal, which waits for a reviewer when requested. It answers at once with the pass, running. Checked first: the version is active and pins a settings block with tunable keys (400 validation-failed), the agent registry takes writes (409 registry-read-only), and the agent has a live version for the whole tenant (409 proposal-needs-pin). No pass starts for an agent whose project is suspended (409 project-suspended), and a pass going when it is ends cancelled, with the reason in cancelReason. Needs publish on the agent. Without improvement passes in this runtime, 501 improve-unsupported.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Caller-supplied idempotency key, scoped to the caller: the same key from someone else in the tenant is their own request (from 0.1.5). Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1). A retry sent while the first request still runs is answered 409 idempotency-key-in-flight with Retry-After, on a runtime whose store holds keys (from 0.1.5); retry after it, and you get the first request’s answer. An answer that carries a secret (a new API key or public run token, a session token, a generated signing secret) isn’t kept: a retry gets 409 idempotency-key-replay-withheld, with the first request’s status and when it succeeded (from 0.1.5).
Request Bodyrequired
Section titled “Request Bodyrequired”Start an improvement pass.
object
The version whose settings it tunes. Default: the one serving scope.
The agent’s default for the whole tenant.
object
An org’s projects.
object
One project.
object
A segment path within a project: it covers every run whose path starts with it.
object
object
Lowercase, like an identifier: company, contact-role.
The test set (a judged eval suite). The pass splits it into a search part and a hold-out part, and proves its best candidate on the hold-out part.
['settings']: values for the tunable settings keys. ['prompt']: a model drafts templates for the prompt block (needs model); a template that reads or names anything the agent doesn’t have is refused, and a drafted proposal always waits for a reviewer.
For a prompt pass: the tenant’s provider and model that drafts the templates.
object
For a prompt pass: how many templates it drafts.
Which judgments the pass learns from: by default only those recorded under a restricted (trusted) judge class.
Default: $5 and 30 candidates.
object
Responses
Section titled “Responses”The pass, running.
An improvement pass: the runtime looking for better values for an agent version’s tunable settings (x-kindgi-tunable) on a test set, within a budget. Its best candidate becomes an improvement proposal.
object
The version whose settings it tunes.
The agent’s default for the whole tenant.
object
An org’s projects.
object
One project.
object
A segment path within a project: it covers every run whose path starts with it.
object
object
Lowercase, like an identifier: company, contact-role.
The test set it searches and proves on.
Which judgments its comparisons count. Absent from older servers: restricted-only.
For a prompt pass: the provider and model that drafts the templates.
object
For a prompt pass: how many templates it drafts.
object
The most the pass’s comparisons may cost, in US dollars.
The most candidates it compares.
What its comparisons have cost so far (US dollars).
What a finished pass found. proposed: its best candidate beat the current values on the test set’s hold-out part, so it wrote an improvement proposal (proposalId) for a reviewer to decide. nothing-found: no candidate beat them by more than the noise, or within the budget (reason; holdOut has the best candidate’s numbers when one got that far). failed: message says why.
object
object
Why a cancelled pass stopped when nobody cancelled it: a comparison’s eval run was cancelled for it (that run’s cancelReason, e.g. project-suspended). It wrote no proposal. Absent when it was cancelled.
Its comparisons so far, each an eval run to open: reference (the version as it is, on the search part), each candidate (the block and the values it changed, on the search part), and the proof (the proposal, on the hold-out part). Absent from older servers.
object
object
For a drafted template that was never compared: why the check refused it (what it reads or names that the agent doesn’t have, or its size).
object
For a drafted template: what the drafter meant it to change.
The improve schedule and fire that started it (GET /v1/schedules/{triggerId}/fires); absent for a pass a person started.
object
Example
{ "scope": { "kind": "tenant" }, "tiers": [ "settings" ], "objective": "weightedYesShare", "classWeights": "as-recorded", "status": "running", "outcome": { "kind": "proposed" }, "comparisons": [ { "role": "reference", "part": "search" } ]}Malformed request body, or validation-failed. Or reference-out-of-scope: the test set isn’t registered in the agent’s project, its org or the tenant, or a project or segment scope doesn’t reach the agent (details.issues).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}fromVersion (or the version serving the scope) is not an active version.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}registry-read-only, proposal-needs-pin, or project-suspended: the agent’s project is suspended. Or Idempotency-Key was reused with a different body.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Server error (unmapped domain code or framework crash).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}improve-unsupported: this runtime runs no improvement passes.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}