CALIBER Python SDK API reference
Every GA resource module the client exposes, the models they decode into, error types, waiters, and the stability tier each surface carries.
This reference is generated from the SDK source tree at build time. It follows the same pattern as the MLflow Python API docs: start with the top-level package, then drill into resource modules, models, errors, waiters, and the async client.
This page is intentionally about the Python client, not the raw HTTP routes. If you need headers, envelopes, or concrete endpoints, start with the REST API overview and HTTP reference.
Most developers should begin with:
caliber_sdk.CaliberClientfor the synchronous clientcaliber_sdk.aio.AsyncCaliberClientfor async workflows- the SDK guide for setup and common flows
- SDK recipes for full runnable scenarios
The reference below is generated from the current SDK code, so the published HTML stays aligned with the package the tests exercise.
Reference
The most common entry point is caliber_sdk.CaliberClient; the rest of the package fans out into typed resource modules, dataclass models, shared transport and error helpers, and an async client.
The reference tables below are generated directly from the current SDK source. Behavior notes and examples come from the SDK docstrings and the executable example files the test suite runs.
Module index
Symbol index
Every documented class and module-level function, with the module that defines it. Members hang off their class, so start here and follow the link.
A
B
| Symbol | Defined in |
|---|---|
Bucket | caliber_sdk.models.integrations |
C
E
F
| Symbol | Defined in |
|---|---|
FieldError | caliber_sdk.models.errors |
G
| Symbol | Defined in |
|---|---|
GatewayAPI | caliber_sdk.resources.integrations |
I
J
| Symbol | Defined in |
|---|---|
Job | caliber_sdk.models.operations |
JobsAPI | caliber_sdk.resources.operations |
Judge | caliber_sdk.models.quality |
JudgeAlignment | caliber_sdk.models.quality |
JudgesAPI | caliber_sdk.resources.quality |
K
| Symbol | Defined in |
|---|---|
KnowledgeBase | caliber_sdk.models.integrations |
KnowledgeBasesAPI | caliber_sdk.resources.integrations |
L
| Symbol | Defined in |
|---|---|
LlmSetupStatus | caliber_sdk.models.core |
M
| Symbol | Defined in |
|---|---|
McpServer | caliber_sdk.models.integrations |
McpServersAPI | caliber_sdk.resources.integrations |
MeAPI | caliber_sdk.resources.system |
N
| Symbol | Defined in |
|---|---|
NoAuth | caliber_sdk.auth |
O
P
R
S
T
W
Package index
Module caliber_sdk
caliber-sdk — a typed Python client for the CALIBER management API.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_api.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
API_PREFIX, ENV_BASE_URL, ENV_PROJECT, ENV_TOKEN, ENV_USER, FAILURE_STATES, TERMINAL_STATES, AuthProvider, CaliberAPIError, CaliberAuthenticationError, CaliberClient, CaliberConfigError, CaliberConflictError, CaliberError, CaliberNotFoundError, CaliberPermissionError, CaliberRateLimitError, CaliberServerError, CaliberTransportError, CaliberValidationError, ErrorBody, FieldError, NoAuth, Page, RawAPI, Response, Stability, TokenAuth, Transport, TrustedHeaderAuth, WaitFailed, WaitTimeout, WorkflowRunFailed, __version__, wait_for, wait_for_terminal_state
Module constants
| Name | Value |
|---|---|
__version__ | '0.1.0.dev0' |
Module caliber_sdk.client
The root client — what a developer constructs first.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_api.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
ENV_BASE_URL, ENV_PROJECT, ENV_TOKEN, ENV_USER, CaliberClient
Module constants
| Name | Value |
|---|---|
ENV_BASE_URL | 'CALIBER_BASE_URL' |
ENV_TOKEN | 'CALIBER_TOKEN' |
ENV_PROJECT | 'CALIBER_PROJECT' |
ENV_USER | 'CALIBER_USER' |
Classes
CaliberClient
class CaliberClient(base_url: str | None = None, *, token: str | None = None, user: str | None = None, proxy_secret: str | None = None, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, verify: bool | str = True, http_client: httpx.Client | None = None)
A connection to one CALIBER deployment.
Usage example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_api.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Constructor
__init__(base_url: str | None = None, *, token: str | None = None, user: str | None = None, proxy_secret: str | None = None, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, verify: bool | str = True, http_client: httpx.Client | None = None) -> None
Operate on the caliber client surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
base_url | positional-or-keyword | `str | None` | None |
token | keyword-only | `str | None` | None |
user | keyword-only | `str | None` | None |
proxy_secret | keyword-only | `str | None` | None |
auth | keyword-only | `AuthProvider | None` | None |
project | keyword-only | `str | None` | None |
timeout | keyword-only | float | 30.0 | |
max_retries | keyword-only | int | 2 | |
verify | keyword-only | `bool | str` | True |
http_client | keyword-only | `httpx.Client | None` | None |
Returns: None
Raises:
Attributes
| Attribute | Type | Notes |
|---|---|---|
raw | RawAPI | Low-level route access through the SDK transport. |
auth | AuthAPI | Session inspection plus token and account sub-resources. |
me | MeAPI | The caller identity surface. |
capabilities_api | CapabilitiesAPI | Runtime stability tiers and deployment capabilities. |
settings | SettingsAPI | Runtime and LLM configuration inventory. |
projects | ProjectsAPI | Projects plus the managed file registry. |
prompts | PromptsAPI | Prompt registry authoring and promotion. |
skills | SkillsAPI | Skill registry, render tests, selection tests, and versions. |
tools | ToolsAPI | Tool registry, schemas, and deterministic calibration. |
workflows | WorkflowsAPI | Workflow registry plus versions, runs, and services. |
datasets | EvalDatasetsAPI | Evaluation datasets and examples. |
judges | JudgesAPI | Model-backed graders and alignment scoring. |
evaluations | EvaluationsAPI | Scored dataset runs. |
mcp_servers | McpServersAPI | Managed MCP server registry and governed tool invocation. |
openapi_integrations | OpenApiIntegrationsAPI | Governed OpenAPI import, curation, dependency review, and tool-draft publication. |
gateway | GatewayAPI | Gateway discovery, usage, and guardrails. |
knowledge_bases | KnowledgeBasesAPI | RAG corpora, versions, retrieval, and calibration. |
object_store | ObjectStoreAPI | Buckets and objects under the storage substrate. |
jobs | JobsAPI | Long-running background jobs. |
review_queues | ReviewQueuesAPI | Human review queues and queue items. |
aria | AriaAPI | The approval-aware plan and interaction loop. |
releases | ReleasesAPI | Release candidates, waivers, signoff, and reports. |
observability | ObservabilityAPI | Traces, experiments, and metrics. |
audit | AuditAPI | The audit log. |
events | EventsAPI | Server-sent event stream. |
cookbooks | CookbooksAPI | The built-in cookbook catalog and installer. |
secrets | SecretsAPI | Write-only secret references. |
Properties
stability() -> dict[str, list[str]]
Tags grouped by `ga / beta / internal`.
This callable takes no public parameters.
Returns: dict[str, list[str]]
Methods
close() -> None
Close the underlying HTTP client or transport owned by this object.
This callable takes no public parameters.
Returns: None
__enter__() -> CaliberClient
Return this instance so it can be used inside a context manager.
This callable takes no public parameters.
Returns: CaliberClient
__exit__(*_: object) -> None
Close any owned resources when leaving the context manager.
| Parameter | Kind | Type | Default |
|---|---|---|---|
_ | var-positional | object | — |
Returns: None
capabilities() -> Any
Runtime feature flags and the SDK stability tiers.
The cheap half of feature detection: it answers "may I call this?" without downloading the full OpenAPI document.
This callable takes no public parameters.
Returns: Any
Raises:
openapi() -> Any
The management OpenAPI document, generated from the live routes.
This callable takes no public parameters.
Returns: Any
Raises:
whoami() -> Any
The identity and scopes CALIBER resolved for this client's credential.
The first call worth making when a script gets an unexpected 403: it distinguishes "wrong credential" from "right credential, wrong scope".
It reports identity rather than requiring it, so an invalid or revoked credential does not raise here -- it returns `user_id: "anonymous"` with no scopes. Check the value; do not rely on an exception to detect a bad token.
This callable takes no public parameters.
Returns: Any
Raises:
health() -> Any
Fetch the lightweight health/readiness view exposed by the deployment.
This callable takes no public parameters.
Returns: Any
Raises:
bootstrap_csrf() -> str | None
Fetch a CSRF token up front.
Rarely needed: the transport fetches one automatically when a write is refused for want of it. Exposed for callers who would rather pay that round trip at startup than on their first write.
This callable takes no public parameters.
Returns: str | None
__repr__() -> str
Operate on the caliber client surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: str
Module caliber_sdk.auth
Authentication strategies for the CALIBER management API.
Tested example
def issue_scoped_token(caliber: CaliberClient, *, name: str = "ci") -> dict[str, Any]:
"""Create a token limited to operator scope.
The scope list is a *ceiling*: the effective authority is the intersection
with what the owner holds when the request is made. Requesting more than
you hold is refused outright rather than silently narrowed, so a token
never claims authority it cannot exercise.
"""
issued = caliber.auth.tokens.create(name, scopes=["caliber.operator"])
# The plaintext exists exactly once. There is no endpoint that returns it
# again — store it now or rotate to get a new one.
secret = issued.token
live = [token.token_id for token in caliber.auth.tokens.list() if token.active]
caliber.auth.tokens.revoke(issued.token_id)
return {"token_id": issued.token_id, "secret_len": len(secret), "live_before_revoke": live}sdk/caliber-sdk/examples/tokens.py — executed by the SDK test suite.Public exports
AuthProvider, NoAuth, TokenAuth, TrustedHeaderAuth
Classes
AuthProvider
class AuthProvider()
Bases: Protocol
Supplies per-request auth headers.
A protocol rather than a base class so a caller can plug in their own -- fetching a short-lived token from a secret manager, for instance -- without subclassing anything in this package.
Properties
uses_cookie_auth() -> bool
Whether this credential is cookie-based.
Drives CSRF: CALIBER's protection exists for browser credentials, and a Bearer client should not be forced to bootstrap a token it does not need. See :mod:caliber_sdk.csrf.
This callable takes no public parameters.
Returns: bool
Methods
headers() -> dict[str, str]
Headers to attach to every request.
This callable takes no public parameters.
Returns: dict[str, str]
TokenAuth
class TokenAuth(token: str)
`Authorization: Bearer <token>` — personal access or session token.
Constructor
__init__(token: str) -> None
Operate on the token auth surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
token | positional-or-keyword | str | — |
Returns: None
Raises:
Properties
uses_cookie_auth() -> bool
Report whether this auth strategy relies on cookie-backed authentication.
This callable takes no public parameters.
Returns: bool
Methods
headers() -> dict[str, str]
Build the authentication headers added to outgoing HTTP requests.
This callable takes no public parameters.
Returns: dict[str, str]
__repr__() -> str
Operate on the token auth surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: str
TrustedHeaderAuth
class TrustedHeaderAuth(user: str, *, proxy_secret: str | None = None)
`X-CALIBER-User — only for deployments in trusted_header` mode.
Carries no proof of identity by itself, which is why CALIBER ignores the header entirely in the default `session` mode. Offered because local development and proxy-terminated deployments genuinely use it.
Constructor
__init__(user: str, *, proxy_secret: str | None = None) -> None
Operate on the trusted header auth surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
user | positional-or-keyword | str | — | |
proxy_secret | keyword-only | `str | None` | None |
Returns: None
Raises:
Properties
uses_cookie_auth() -> bool
Report whether this auth strategy relies on cookie-backed authentication.
This callable takes no public parameters.
Returns: bool
Methods
headers() -> dict[str, str]
Build the authentication headers added to outgoing HTTP requests.
This callable takes no public parameters.
Returns: dict[str, str]
__repr__() -> str
Operate on the trusted header auth surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: str
NoAuth
class NoAuth()
Send no credential. Useful for probing an unauthenticated endpoint.
Properties
uses_cookie_auth() -> bool
Report whether this auth strategy relies on cookie-backed authentication.
This callable takes no public parameters.
Returns: bool
Methods
headers() -> dict[str, str]
Build the authentication headers added to outgoing HTTP requests.
This callable takes no public parameters.
Returns: dict[str, str]
Module caliber_sdk.transport
HTTP transport: envelopes, errors, retries, CSRF, and correlation.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_api.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
API_PREFIX, USER_AGENT, Response, Transport
Module constants
| Name | Value |
|---|---|
USER_AGENT | 'caliber-sdk-python' |
API_PREFIX | '/ajax-api/2.0/mlflow/caliber' |
Classes
Response
class Response(*, data, status_code: int, headers: Mapping[str, str], request_id: str | None)
A decoded response plus the context needed to debug it.
Constructor
__init__(*, data, status_code: int, headers: Mapping[str, str], request_id: str | None) -> None
Operate on the response surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
data | keyword-only | Any | — | |
status_code | keyword-only | int | — | |
headers | keyword-only | Mapping[str, str] | — | |
request_id | keyword-only | `str | None` | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
data | Any | — |
status_code | Any | — |
headers | Any | — |
request_id | Any | — |
Transport
class Transport(base_url: str, *, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, backoff_factor: float = 0.5, verify: bool | str = True, client: httpx.Client | None = None, user_agent: str | None = None)
Synchronous HTTP transport against one CALIBER deployment.
Constructor
__init__(base_url: str, *, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, backoff_factor: float = 0.5, verify: bool | str = True, client: httpx.Client | None = None, user_agent: str | None = None) -> None
Send a prepared request through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
base_url | positional-or-keyword | str | — | |
auth | keyword-only | `AuthProvider | None` | None |
project | keyword-only | `str | None` | None |
timeout | keyword-only | float | 30.0 | |
max_retries | keyword-only | int | 2 | |
backoff_factor | keyword-only | float | 0.5 | |
verify | keyword-only | `bool | str` | True |
client | keyword-only | `httpx.Client | None` | None |
user_agent | keyword-only | `str | None` | None |
Returns: None
Raises:
Attributes
| Attribute | Type | Notes |
|---|---|---|
base_url | Any | — |
auth | Any | Session inspection plus token and account sub-resources. |
project | Any | — |
Methods
close() -> None
Close the underlying HTTP client or transport owned by this object.
This callable takes no public parameters.
Returns: None
__enter__() -> Transport
Return this instance so it can be used inside a context manager.
This callable takes no public parameters.
Returns: Transport
__exit__(*_: object) -> None
Close any owned resources when leaving the context manager.
| Parameter | Kind | Type | Default |
|---|---|---|---|
_ | var-positional | object | — |
Returns: None
url_for(path: str) -> str
Absolute URL for an API path, with or without the prefix.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
Returns: str
bootstrap_csrf() -> str | None
Fetch and cache a CSRF token, returning it.
Idempotent and cheap to call. Returns `None` when the deployment does not issue one, which is not an error: CSRF enforcement is configurable and a Bearer client may not need it.
This callable takes no public parameters.
Returns: str | None
request(method: str, path: str, *, params: Mapping[str, Any] | None = None, json = None, headers: Mapping[str, str] | None = None, files = None, data: Mapping[str, Any] | None = None, timeout: float | None = None, _csrf_retry: bool = True) -> Response
Perform one API call, returning the unwrapped payload.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
method | positional-or-keyword | str | — | |
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
json | keyword-only | Any | None | |
headers | keyword-only | `Mapping[str, str] | None` | None |
files | keyword-only | Any | None | |
data | keyword-only | `Mapping[str, Any] | None` | None |
timeout | keyword-only | `float | None` | None |
_csrf_retry | keyword-only | bool | True |
Returns: Response
Raises:
get(path: str, **kwargs) -> Response
Fetch one record from the transport surface identified by path.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
post(path: str, **kwargs) -> Response
Send a prepared request through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
put(path: str, **kwargs) -> Response
Send a prepared request through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
patch(path: str, **kwargs) -> Response
Send a prepared request through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
delete(path: str, **kwargs) -> Response
Delete a record on the transport surface and return the server acknowledgement.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
download(path: str, **kwargs) -> bytes
Fetch raw bytes.
Separate from :meth:request because file content is not JSON: it has no envelope to unwrap and decoding it would corrupt binary data.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: bytes
Raises:
stream_lines(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | None = None) -> Iterator[str]
Yield lines from a server-sent-events endpoint.
Streaming needs its own path: the ordinary request reads the whole body before returning, which for an endpoint that never ends means blocking forever. No default timeout is applied either — a stream staying open is the success case, not a hang.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
timeout | keyword-only | `float | None` | None |
Returns: Iterator[str]
Raises:
paginate(path: str, *, params: Mapping[str, Any] | None = None, limit: int = 100) -> Iterator[Any]
Yield items across `limit/offset` pages.
CALIBER's list endpoints are offset-based today. Exposing an iterator rather than the raw pages means the eventual move to cursors does not change this signature.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
limit | keyword-only | int | 100 |
Returns: Iterator[Any]
Raises:
Module caliber_sdk.errors
Exception hierarchy for the CALIBER SDK.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_api.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
CaliberAPIError, CaliberAuthenticationError, CaliberConfigError, CaliberConflictError, CaliberError, CaliberNotFoundError, CaliberPermissionError, CaliberRateLimitError, CaliberServerError, CaliberTransportError, CaliberValidationError, error_for_response
Functions
error_for_response(*, status_code: int, payload, method: str, url: str, request_id: str | None = None) -> CaliberAPIError
Build the right exception for a non-2xx response.
Tolerates a body that is not the documented shape -- an HTML error page from a proxy in front of CALIBER is a realistic response, and it must produce a usable exception rather than a KeyError inside the SDK.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status_code | keyword-only | int | — | |
payload | keyword-only | Any | — | |
method | keyword-only | str | — | |
url | keyword-only | str | — | |
request_id | keyword-only | `str | None` | None |
Returns: CaliberAPIError
Classes
CaliberError
class CaliberError()
Bases: Exception
Base class for everything this SDK raises.
A caller who wants "any SDK failure" catches this and nothing else.
CaliberConfigError
class CaliberConfigError()
Bases: CaliberError
The client was constructed with an unusable configuration.
CaliberTransportError
class CaliberTransportError()
Bases: CaliberError
The request never produced an HTTP response.
Connection refused, DNS failure, timeout. Distinct from :class:CaliberAPIError because there is no server verdict to inspect -- and because retrying is often correct here and often wrong there.
CaliberAPIError
class CaliberAPIError(message: str, *, status_code: int, detail: str | None = None, method: str | None = None, url: str | None = None, request_id: str | None = None, payload = None)
Bases: CaliberError
The server returned a non-2xx response.
Constructor
__init__(message: str, *, status_code: int, detail: str | None = None, method: str | None = None, url: str | None = None, request_id: str | None = None, payload = None) -> None
Operate on the caliber a p i error surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
message | positional-or-keyword | str | — | |
status_code | keyword-only | int | — | |
detail | keyword-only | `str | None` | None |
method | keyword-only | `str | None` | None |
url | keyword-only | `str | None` | None |
request_id | keyword-only | `str | None` | None |
payload | keyword-only | Any | None |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
status_code | Any | — |
detail | Any | — |
method | Any | — |
url | Any | — |
request_id | Any | — |
payload | Any | — |
CaliberAuthenticationError
class CaliberAuthenticationError()
Bases: CaliberAPIError
401 — no usable identity. The credential is missing, wrong, or revoked.
CaliberPermissionError
class CaliberPermissionError()
Bases: CaliberAPIError
403 — authenticated, but the identity lacks the required scope.
CaliberNotFoundError
class CaliberNotFoundError()
Bases: CaliberAPIError
404 — no such resource.
CALIBER also returns this for a resource that exists but belongs to another user, deliberately: distinguishing the two would let a caller enumerate ids.
CaliberConflictError
class CaliberConflictError()
Bases: CaliberAPIError
409 — the request conflicts with current state (duplicate name, etc.).
CaliberValidationError
class CaliberValidationError(message: str, *, errors: list[dict[str, Any]], **kwargs)
Bases: CaliberAPIError
400 with a structured `errors` list.
Constructor
__init__(message: str, *, errors: list[dict[str, Any]], **kwargs) -> None
Operate on the caliber validation error surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
message | positional-or-keyword | str | — |
errors | keyword-only | list[dict[str, Any]] | — |
kwargs | var-keyword | Any | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
errors | Any | — |
CaliberRateLimitError
class CaliberRateLimitError()
Bases: CaliberAPIError
429 — too many requests.
CaliberServerError
class CaliberServerError()
Bases: CaliberAPIError
5xx — the server failed. Usually worth retrying; never worth assuming.
Module caliber_sdk.waiters
Polling helpers for CALIBER's long-running operations.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
FAILURE_STATES, TERMINAL_STATES, WaitFailed, WaitTimeout, state_of, wait_for, wait_for_terminal_state
Functions
wait_for(poll: Callable[[], T], *, is_done: Callable[[T], bool], timeout: float = 300.0, interval: float = 2.0, max_interval: float = 15.0, backoff: float = 1.5, sleep: Callable[[float], None] = time.sleep, now: Callable[[], float] = time.monotonic) -> T
Poll until `is_done` or the timeout expires.
The interval grows geometrically to `max_interval. A fixed short interval is what turns a slow job into thousands of requests; a fixed long one makes a fast job feel slow. sleep and now` are injectable so tests do not have to spend real seconds proving this.
| Parameter | Kind | Type | Default |
|---|---|---|---|
poll | positional-or-keyword | Callable[[], T] | — |
is_done | keyword-only | Callable[[T], bool] | — |
timeout | keyword-only | float | 300.0 |
interval | keyword-only | float | 2.0 |
max_interval | keyword-only | float | 15.0 |
backoff | keyword-only | float | 1.5 |
sleep | keyword-only | Callable[[float], None] | time.sleep |
now | keyword-only | Callable[[], float] | time.monotonic |
Returns: T
Raises:
ValueErrorWaitTimeout
state_of(payload, *, keys: Sequence[str] = ('status', 'state')) -> str
Read a status field from a payload, tolerating either spelling.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | positional-or-keyword | Any | — |
keys | keyword-only | Sequence[str] | ('status', 'state') |
Returns: str
wait_for_terminal_state(poll: Callable[[], Any], *, terminal: frozenset[str] = TERMINAL_STATES, failure: frozenset[str] = FAILURE_STATES, raise_on_failure: bool = True, **kwargs) -> Any
Poll until the payload's status is terminal.
`raise_on_failure` is on by default because the common script wants a failed job to stop it; a caller inspecting the outcome themselves turns it off rather than wrapping every call in a try.
| Parameter | Kind | Type | Default |
|---|---|---|---|
poll | positional-or-keyword | Callable[[], Any] | — |
terminal | keyword-only | frozenset[str] | TERMINAL_STATES |
failure | keyword-only | frozenset[str] | FAILURE_STATES |
raise_on_failure | keyword-only | bool | True |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
Classes
WaitTimeout
class WaitTimeout(message: str, *, last = None, elapsed: float = 0.0)
Bases: CaliberError
The operation did not reach a terminal state within the budget.
Constructor
__init__(message: str, *, last = None, elapsed: float = 0.0) -> None
Operate on the wait timeout surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
message | positional-or-keyword | str | — |
last | keyword-only | Any | None |
elapsed | keyword-only | float | 0.0 |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
last | Any | — |
elapsed | Any | — |
WaitFailed
class WaitFailed(message: str, *, state: str, last = None)
Bases: CaliberError
The operation reached a terminal state that indicates failure.
Constructor
__init__(message: str, *, state: str, last = None) -> None
Operate on the wait failed surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
message | positional-or-keyword | str | — |
state | keyword-only | str | — |
last | keyword-only | Any | None |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
state | Any | — |
last | Any | — |
Resource modules
Module caliber_sdk.resources
Resource modules — typed façades over route groups.
Public exports
AccountsAPI, AriaAPI, AuditAPI, AuthAPI, CapabilitiesAPI, CookbooksAPI, EvalDatasetsAPI, EvaluationsAPI, EventsAPI, GatewayAPI, JobsAPI, JudgesAPI, KnowledgeBasesAPI, McpServersAPI, MeAPI, ObjectStoreAPI, ObservabilityAPI, OpenApiIntegrationsAPI, ProjectFilesAPI, ProjectsAPI, PromptsAPI, RawAPI, ReleasesAPI, Resource, ReviewQueuesAPI, SecretsAPI, SettingsAPI, SkillsAPI, TokensAPI, ToolsAPI, WorkflowRunFailed, WorkflowRunsAPI, WorkflowServicesAPI, WorkflowVersionsAPI, WorkflowsAPI
Module caliber_sdk.resources.auth
Authentication, tokens, and accounts.
Tested example
def issue_scoped_token(caliber: CaliberClient, *, name: str = "ci") -> dict[str, Any]:
"""Create a token limited to operator scope.
The scope list is a *ceiling*: the effective authority is the intersection
with what the owner holds when the request is made. Requesting more than
you hold is refused outright rather than silently narrowed, so a token
never claims authority it cannot exercise.
"""
issued = caliber.auth.tokens.create(name, scopes=["caliber.operator"])
# The plaintext exists exactly once. There is no endpoint that returns it
# again — store it now or rotate to get a new one.
secret = issued.token
live = [token.token_id for token in caliber.auth.tokens.list() if token.active]
caliber.auth.tokens.revoke(issued.token_id)
return {"token_id": issued.token_id, "secret_len": len(secret), "live_before_revoke": live}sdk/caliber-sdk/examples/tokens.py — executed by the SDK test suite.Public exports
AccountsAPI, AuthAPI, TokensAPI
Classes
TokensAPI
class TokensAPI()
Personal access tokens for automation.
Methods
list() -> list[PersonalAccessToken]
Every token belonging to the caller. Never includes a secret.
This callable takes no public parameters.
Returns: list[PersonalAccessToken]
Raises:
create(name: str, *, scopes: Sequence[str] | None = None, expires_at: str | None = None) -> IssuedToken
Issue a token. The plaintext is returned once — store it now.
`scopes` is a ceiling, not a grant: the effective authority is the intersection with what the owner holds at request time. Omit it to inherit the owner's scopes. Requesting a scope the caller does not hold is refused rather than silently narrowed.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
scopes | keyword-only | `Sequence[str] | None` | None |
expires_at | keyword-only | `str | None` | None |
Returns: IssuedToken
Raises:
revoke(token_id: str) -> bool
Revoke a token. Returns whether a live token was actually revoked.
| Parameter | Kind | Type | Default |
|---|---|---|---|
token_id | positional-or-keyword | str | — |
Returns: bool
Raises:
rotate(token_id: str) -> IssuedToken
Replace a token's secret, preserving its name and scope ceiling.
One transaction on the server: the old token is revoked and the replacement issued together, so a failure cannot leave an account with two live tokens or none.
| Parameter | Kind | Type | Default |
|---|---|---|---|
token_id | positional-or-keyword | str | — |
Returns: IssuedToken
Raises:
AccountsAPI
class AccountsAPI()
User accounts. Admin-only on the server.
Methods
list() -> list[Account]
Return the current collection of user accounts, applying any supported filters.
This callable takes no public parameters.
Returns: list[Account]
Raises:
create(user_id: str, password: str) -> Any
Create a new record on the user accounts surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
user_id | positional-or-keyword | str | — |
password | positional-or-keyword | str | — |
Returns: Any
Raises:
update(user_id: str, *, password: str | None = None, disabled: bool | None = None) -> Any
Reset a password or enable/disable an account.
Both revoke the account's sessions server-side, so they take effect immediately rather than at the next expiry.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
user_id | positional-or-keyword | str | — | |
password | keyword-only | `str | None` | None |
disabled | keyword-only | `bool | None` | None |
Returns: Any
Raises:
revoke_sessions(user_id: str) -> int
Sign an account out everywhere. Returns how many sessions were cut.
| Parameter | Kind | Type | Default |
|---|---|---|---|
user_id | positional-or-keyword | str | — |
Returns: int
Raises:
AuthAPI
class AuthAPI(transport)
Session inspection, plus the token and account sub-resources.
Constructor
__init__(transport) -> None
Operate on the authentication and session state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
transport | positional-or-keyword | Any | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
tokens | TokensAPI | — |
accounts | AccountsAPI | — |
Methods
session() -> SessionInfo
How this client's identity was established.
This callable takes no public parameters.
Returns: SessionInfo
Raises:
Module caliber_sdk.resources.system
Identity, capabilities, and settings — the deployment-level surfaces.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_api.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
CapabilitiesAPI, MeAPI, SettingsAPI
Classes
MeAPI
class MeAPI()
The caller's own identity.
Methods
get() -> Identity
Resolve this client's identity and scopes.
Reports rather than requires: an invalid or revoked credential returns an anonymous identity instead of raising. Check :attr:Identity.is_anonymous; do not rely on an exception.
This callable takes no public parameters.
Returns: Identity
Raises:
CapabilitiesAPI
class CapabilitiesAPI()
Runtime feature flags and API stability tiers.
Methods
get() -> Capabilities
Fetch one record from the runtime capabilities surface identified by id.
This callable takes no public parameters.
Returns: Capabilities
Raises:
SettingsAPI
class SettingsAPI()
Runtime configuration inventory and LLM credential status.
Methods
runtime() -> RuntimeSettings
Return the current runtime settings snapshot for the deployment.
This callable takes no public parameters.
Returns: RuntimeSettings
Raises:
llm() -> LlmSetupStatus
Which LLM credentials are configured.
Presence flags and masked fingerprints only — the endpoint does not disclose key values, deliberately.
This callable takes no public parameters.
Returns: LlmSetupStatus
Raises:
update_llm(**changes) -> Any
Write LLM provider settings. Secrets are write-only on the server.
| Parameter | Kind | Type | Default |
|---|---|---|---|
changes | var-keyword | Any | — |
Returns: Any
Raises:
Module caliber_sdk.resources.projects
Projects and their files — the workspace-scoping surface.
Tested example
def prompt_lifecycle(
caliber: CaliberClient, *, agent_id: str = "intake-classifier"sdk/caliber-sdk/examples/prompt_lifecycle.py — executed by the SDK test suite.Public exports
ProjectFilesAPI, ProjectsAPI
Classes
ProjectFilesAPI
class ProjectFilesAPI()
Files inside one project.
Methods
list(project_id: str) -> tuple[list[ProjectFile], list[ProjectFolder]]
Files and the directories containing them.
Returned as a pair rather than one flattened list: a directory is not a file, and collapsing them would make an empty folder indistinguishable from a missing one.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: tuple[list[ProjectFile], list[ProjectFolder]] — see ProjectFile, ProjectFolder
Raises:
upload(project_id: str, *, filename: str, content: bytes | BinaryIO, path: str | None = None, kind: str = 'input', media_type: str | None = None) -> ProjectFile
Upload a file. Multipart, so it does not go through the JSON path.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
filename | keyword-only | str | — | |
content | keyword-only | `bytes | BinaryIO` | — |
path | keyword-only | `str | None` | None |
kind | keyword-only | str | 'input' | |
media_type | keyword-only | `str | None` | None |
Returns: ProjectFile
Raises:
create_folder(project_id: str, path: str) -> ProjectFolder
Operate on the project files and folders surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
path | positional-or-keyword | str | — |
Returns: ProjectFolder
Raises:
delete(project_id: str, file_id: str) -> bool
Delete a record on the project files and folders surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
file_id | positional-or-keyword | str | — |
Returns: bool
Raises:
download(project_id: str, file_id: str) -> bytes
Raw bytes. Not JSON, so it bypasses the envelope entirely.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
file_id | positional-or-keyword | str | — |
Returns: bytes
Raises:
ProjectsAPI
class ProjectsAPI(transport)
Projects, project access, and the file sub-resource.
Related APIs: ProjectFilesAPI
Constructor
__init__(transport) -> None
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
transport | positional-or-keyword | Any | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
files | ProjectFilesAPI | — |
Methods
list(*, status: str | None = None) -> list[Project]
Active projects by default; pass `status="all"` for everything.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Project]
Raises:
get(project_id: str) -> Project
Fetch one record from the projects surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: Project
Raises:
create(name: str, *, description: str | None = None) -> Project
Create a new record on the projects surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
description | keyword-only | `str | None` | None |
Returns: Project
Raises:
update(project_id: str, *, name: str | None = None, description: str | None = None, status: str | None = None) -> Project
Patch an existing record on the projects surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
name | keyword-only | `str | None` | None |
description | keyword-only | `str | None` | None |
status | keyword-only | `str | None` | None |
Returns: Project
Raises:
list_members(project_id: str) -> list[ProjectMember]
List active members and their effective project roles.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: list[ProjectMember]
Raises:
add_member(project_id: str, user_id: str, *, role: str = 'viewer') -> ProjectMember
Grant `user_id` a project role; only owners may manage members.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
user_id | positional-or-keyword | str | — |
role | keyword-only | str | 'viewer' |
Returns: ProjectMember
Raises:
update_member(project_id: str, user_id: str, *, role: str | None = None, status: str | None = None) -> ProjectMember
Change a member's role or active status.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
user_id | positional-or-keyword | str | — | |
role | keyword-only | `str | None` | None |
status | keyword-only | `str | None` | None |
Returns: ProjectMember
Raises:
remove_member(project_id: str, user_id: str) -> bool
Deactivate a member; the project owner cannot be removed.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
user_id | positional-or-keyword | str | — |
Returns: bool
Raises:
storage() -> Any
Where project files live, and what else the deployment supports.
This callable takes no public parameters.
Returns: Any
Raises:
Module caliber_sdk.resources.assets
Prompts, skills, and tools — the governed asset families.
Tested example
def prompt_lifecycle(
caliber: CaliberClient, *, agent_id: str = "intake-classifier"sdk/caliber-sdk/examples/prompt_lifecycle.py — executed by the SDK test suite.Public exports
PromptsAPI, SkillsAPI, ToolsAPI
Classes
PromptsAPI
class PromptsAPI()
Prompt registry surfaces.
Prompts are MLflow registry objects that CALIBER governs. Versions are immutable and an alias points at one of them, so "update a prompt" is always "register a new version", never an edit in place.
Usage example
def prompt_lifecycle(
caliber: CaliberClient, *, agent_id: str = "intake-classifier"sdk/caliber-sdk/examples/prompt_lifecycle.py — executed by the SDK test suite.Related APIs: EvaluationsAPI, ReviewQueuesAPI
Methods
list() -> list[Prompt]
Return the current collection of prompts and prompt versions, applying any supported filters.
This callable takes no public parameters.
Returns: list[Prompt]
Raises:
get(agent_id: str) -> Prompt
Fetch one record from the prompts and prompt versions surface identified by agent_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
Returns: Prompt
Raises:
create(name: str, template: str, *, commit_message: str | None = None) -> Any
Register a prompt and its first version.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
template | positional-or-keyword | str | — | |
commit_message | keyword-only | `str | None` | None |
Returns: Any
Raises:
versions(agent_id: str) -> Any
Every registered version, newest first.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
Returns: Any
Raises:
register_version(agent_id: str, template: str, *, commit_message: str | None = None) -> Any
Add a version without touching the live alias.
The alias is rotated separately by :meth:promote, so authoring is never a deployment — the property the whole refinement loop depends on.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
agent_id | positional-or-keyword | str | — | |
template | positional-or-keyword | str | — | |
commit_message | keyword-only | `str | None` | None |
Returns: Any
Raises:
promote(agent_id: str, version: int, *, alias: str = 'prod') -> Any
Point an alias at a version. This is the deployment step.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
version | positional-or-keyword | int | — |
alias | keyword-only | str | 'prod' |
Returns: Any
Raises:
SkillsAPI
class SkillsAPI()
Skill registry, rendering, selection testing, and versions.
Related APIs: JudgesAPI, EvaluationsAPI
Methods
list(*, status: str | None = None, tag: str | None = None) -> list[Skill]
Return the current collection of skills, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
tag | keyword-only | `str | None` | None |
Returns: list[Skill]
Raises:
get(skill_id: str) -> Skill
Fetch one record from the skills surface identified by skill_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
Returns: Skill
Raises:
create(name: str, *, content: str, owner: str, summary: str | None = None, description: str | None = None, tags: Sequence[str] | None = None) -> Skill
Create a skill.
`owner` is required by the server and is therefore keyword-required here rather than defaulted to the caller's identity: a skill's owner is a governance field, and quietly inferring it would make authorship an accident of which credential happened to run the script.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
content | keyword-only | str | — | |
owner | keyword-only | str | — | |
summary | keyword-only | `str | None` | None |
description | keyword-only | `str | None` | None |
tags | keyword-only | `Sequence[str] | None` | None |
Returns: Skill
Raises:
update(skill_id: str, **changes) -> Skill
Patch an existing record on the skills surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Skill
Raises:
render(skill_id: str, *, variables: dict[str, Any] | None = None) -> SkillRender
Substitute `{{variables}}` and report what was left unresolved.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
skill_id | positional-or-keyword | str | — | |
variables | keyword-only | `dict[str, Any] | None` | None |
Returns: SkillRender
Raises:
test_selection(skill_id: str, query: str) -> SkillSelection
Would this skill be auto-selected for this query?
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
query | positional-or-keyword | str | — |
Returns: SkillSelection
Raises:
versions(skill_id: str) -> list[SkillVersion]
Operate on the skills surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
Returns: list[SkillVersion]
Raises:
ToolsAPI
class ToolsAPI()
Tool registry, fixtures, and calibration.
Methods
list(*, status: str | None = None) -> list[Tool]
Return the current collection of tools and calibration cases, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Tool]
Raises:
get(tool_id: str) -> Tool
Fetch one record from the tools and calibration cases surface identified by tool_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
Returns: Tool
Raises:
register(name: str, *, version: str, module_path: str, callable_name: str, input_schema: dict[str, Any] | None = None, output_schema: dict[str, Any] | None = None, **options) -> Tool
Operate on the tools and calibration cases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
version | keyword-only | str | — | |
module_path | keyword-only | str | — | |
callable_name | keyword-only | str | — | |
input_schema | keyword-only | `dict[str, Any] | None` | None |
output_schema | keyword-only | `dict[str, Any] | None` | None |
options | var-keyword | Any | — |
Returns: Tool
Raises:
update(tool_id: str, **changes) -> Tool
Patch an existing record on the tools and calibration cases surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Tool
Raises:
calibrate(tool_id: str, **options) -> CalibrationJob
Queue a calibration run. Returns immediately with a job to poll.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: CalibrationJob
Raises:
calibration_job(tool_id: str, job_id: str) -> CalibrationJob
Operate on the tools and calibration cases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
Returns: CalibrationJob
Raises:
calibration_jobs(tool_id: str) -> list[CalibrationJob]
Operate on the tools and calibration cases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
Returns: list[CalibrationJob]
Raises:
wait_for_calibration(tool_id: str, job_id: str, *, timeout: float = 600.0, **options) -> CalibrationJob
Poll a calibration job until it stops.
Returns the terminal job rather than raising on failure: a failed calibration is a result to inspect, not an error in the call.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 600.0 |
options | var-keyword | Any | — |
Returns: CalibrationJob
Raises:
Module caliber_sdk.resources.workflows
Workflows, versions, runs, deployments, and services.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
WorkflowRunFailed, WorkflowRunsAPI, WorkflowServicesAPI, WorkflowVersionsAPI, WorkflowsAPI
Classes
WorkflowRunFailed
class WorkflowRunFailed(run: WorkflowRun)
Bases: CaliberError
A run reached a terminal state that is not success.
Constructor
__init__(run: WorkflowRun) -> None
Operate on the workflow run failed surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run | positional-or-keyword | WorkflowRun | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
run | Any | — |
WorkflowVersionsAPI
class WorkflowVersionsAPI()
Immutable manifest snapshots of one workflow.
Related APIs: WorkflowsAPI, WorkflowRunsAPI, WorkflowServicesAPI
Methods
list(workflow_id: str) -> list[WorkflowVersion]
Return the current collection of workflow versions, applying any supported filters.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: list[WorkflowVersion]
Raises:
get(version_id: str) -> WorkflowVersion
Fetch one record from the workflow versions surface identified by version_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: WorkflowVersion
Raises:
create(workflow_id: str, manifest: dict[str, Any]) -> WorkflowVersion
Register a draft version. Drafts are not runnable until published.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
manifest | positional-or-keyword | dict[str, Any] | — |
Returns: WorkflowVersion
Raises:
validate(version_id: str) -> Any
Validation report for a version's manifest.
Returned untyped on purpose: the report is produced by the server's validator, and a schema here would be a second definition of a contract that lives there.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
compile(version_id: str) -> Any
Ask the server to compile the draft workflow or asset into its executable form.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
publish(version_id: str) -> WorkflowVersion
Promote the draft or version into the published state used by operators or runtime callers.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: WorkflowVersion
Raises:
WorkflowRunsAPI
class WorkflowRunsAPI()
Executions, and waiting on them.
Usage example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Related APIs: WorkflowsAPI, WorkflowVersionsAPI, WorkflowServicesAPI
Methods
list(workflow_id: str, *, status: str | None = None) -> list[WorkflowRun]
Runs of one workflow.
Scoped to a workflow because the server has no unscoped run listing: `/workflow-runs` is POST-only (submission). An SDK method implying otherwise returned 405 at runtime, which is how this was found.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
workflow_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
Returns: list[WorkflowRun]
Raises:
get(run_id: str) -> WorkflowRun
Fetch one record from the workflow runs surface identified by run_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: WorkflowRun
Raises:
submit(*, workflow_version_id: str | None = None, workflow_id: str | None = None, alias: str | None = None, input = None, idempotency_key: str | None = None, **options) -> WorkflowRun
Queue a run. Returns immediately with a run to poll.
A run targets either a specific version or a workflow plus a deployment alias — the server accepts both, and forcing one here would make the alias path unreachable, which is how a deployed workflow is invoked.
`idempotency_key` is passed through because submission is the one mutating call the SDK cannot safely retry on its own.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
workflow_version_id | keyword-only | `str | None` | None |
workflow_id | keyword-only | `str | None` | None |
alias | keyword-only | `str | None` | None |
input | keyword-only | Any | None | |
idempotency_key | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: WorkflowRun
Raises:
cancel(run_id: str) -> WorkflowRun
Operate on the workflow runs surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: WorkflowRun
Raises:
wait(run_id: str, *, timeout: float = 900.0, raise_on_failure: bool = True, **options) -> WorkflowRun
Poll until the run stops.
Raises by default, unlike calibration: a script that submitted work and got a failure almost always wants to stop, whereas a calibration score is the thing being measured. Pass `raise_on_failure=False` to inspect instead.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
raise_on_failure | keyword-only | bool | True |
options | var-keyword | Any | — |
Returns: WorkflowRun
Raises:
WorkflowServicesAPI
class WorkflowServicesAPI()
Workflows published as external HTTP services.
The server splits this in two, and so does this class. Management lives under `/workflows/{id}/service — configuring and publishing is a property of the workflow. *Invocation* lives under /services/{id}` — that is the external surface, authenticated by per-service tokens rather than a user credential.
There is no unscoped service listing; a service is reached through its workflow. An earlier version of this class invented `GET /services` and returned 404 at runtime.
Related APIs: WorkflowsAPI, WorkflowVersionsAPI
Methods
get(workflow_id: str) -> WorkflowService
Fetch one record from the workflow services surface identified by workflow_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: WorkflowService
Raises:
publish(workflow_id: str, **options) -> WorkflowService
Promote the draft or version into the published state used by operators or runtime callers.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: WorkflowService
Raises:
unpublish(workflow_id: str) -> bool
Remove the published state from the targeted runtime asset.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: bool
Raises:
openapi(workflow_id: str) -> Any
The per-workflow OpenAPI document the service surface publishes.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Any
Raises:
invoke(workflow_id: str, payload = None, **options) -> Any
Call a published service.
The external surface: in production this is authenticated by a per-service token rather than the user credential the rest of this client carries.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
payload | positional-or-keyword | Any | None |
options | var-keyword | Any | — |
Returns: Any
Raises:
WorkflowsAPI
class WorkflowsAPI(transport)
Workflows, plus versions, runs, and services as sub-resources.
Usage example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Related APIs: WorkflowVersionsAPI, WorkflowRunsAPI, WorkflowServicesAPI
Constructor
__init__(transport) -> None
Operate on the workflows surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
transport | positional-or-keyword | Any | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
versions | WorkflowVersionsAPI | — |
runs | WorkflowRunsAPI | — |
services | WorkflowServicesAPI | — |
Methods
list(*, status: str | None = None) -> list[Workflow]
Return the current collection of workflows, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Workflow]
Raises:
get(workflow_id: str) -> Workflow
Fetch one record from the workflows surface identified by workflow_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Workflow
Raises:
create(name: str, *, description: str | None = None, **options) -> Workflow
Create a new record on the workflows surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
description | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: Workflow
Raises:
update(workflow_id: str, **changes) -> Workflow
Patch an existing record on the workflows surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Workflow
Raises:
delete(workflow_id: str) -> Any
Delete a record on the workflows surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Any
Raises:
Module caliber_sdk.resources.quality
Datasets, judges, and evaluations — the evidence and scoring surfaces.
Tested example
def build_and_score(caliber: CaliberClient, *, owner: str = "@you") -> dict[str, Any]:
"""Create a dataset, add a row, define a judge, and run an evaluation."""
dataset = caliber.datasets.create("intake-golden", owner=owner)
caliber.datasets.add_example(
dataset.dataset_id,
inputs={"ticket": "I was charged twice"},
expected={"intent": "billing"},
)
# Instructions must reference an evaluation variable. A judge with no
# variable grades nothing — it returns the same verdict every time — so
# the server rejects it rather than letting you collect meaningless scores.
judge = caliber.judges.create(
"valid-intent",
instructions="Given {{ inputs }} and {{ outputs }}, return true if intent is allowed.",
feedback_value_type="bool",
)
evaluation = caliber.evaluations.create(dataset.dataset_id, judge_id=judge.judge_id)
return {
"dataset_id": dataset.dataset_id,
"judge_id": judge.judge_id,
"evaluation_id": evaluation.evaluation_id,
}sdk/caliber-sdk/examples/evaluation.py — executed by the SDK test suite.Public exports
EvalDatasetsAPI, EvaluationsAPI, JudgesAPI
Classes
EvalDatasetsAPI
class EvalDatasetsAPI()
Versioned evaluation datasets and their examples.
Usage example
def build_and_score(caliber: CaliberClient, *, owner: str = "@you") -> dict[str, Any]:
"""Create a dataset, add a row, define a judge, and run an evaluation."""
dataset = caliber.datasets.create("intake-golden", owner=owner)
caliber.datasets.add_example(
dataset.dataset_id,
inputs={"ticket": "I was charged twice"},
expected={"intent": "billing"},
)
# Instructions must reference an evaluation variable. A judge with no
# variable grades nothing — it returns the same verdict every time — so
# the server rejects it rather than letting you collect meaningless scores.
judge = caliber.judges.create(
"valid-intent",
instructions="Given {{ inputs }} and {{ outputs }}, return true if intent is allowed.",
feedback_value_type="bool",
)
evaluation = caliber.evaluations.create(dataset.dataset_id, judge_id=judge.judge_id)
return {
"dataset_id": dataset.dataset_id,
"judge_id": judge.judge_id,
"evaluation_id": evaluation.evaluation_id,
}sdk/caliber-sdk/examples/evaluation.py — executed by the SDK test suite.Related APIs: EvaluationsAPI, JudgesAPI, ReviewQueuesAPI
Methods
list(*, status: str | None = None) -> list[EvalDataset]
Return the current collection of evaluation datasets, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[EvalDataset]
Raises:
get(dataset_id: str) -> EvalDataset
Fetch one record from the evaluation datasets surface identified by dataset_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
Returns: EvalDataset
Raises:
create(name: str, *, owner: str, description: str | None = None, **options) -> EvalDataset
Create a dataset.
`owner` is required by the server and kept keyword-required here for the same reason as skills: ownership is a governance field, not something to infer from whichever credential ran the script.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
owner | keyword-only | str | — | |
description | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: EvalDataset
Raises:
add_example(dataset_id: str, *, inputs, expected = None, **options) -> EvalExample
Append one labeled example row to the targeted evaluation dataset.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
inputs | keyword-only | Any | — |
expected | keyword-only | Any | None |
options | var-keyword | Any | — |
Returns: EvalExample
Raises:
examples(dataset_id: str) -> list[EvalExample]
Return the example rows currently stored for the targeted evaluation dataset.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
Returns: list[EvalExample]
Raises:
add_from_trace(dataset_id: str, trace_id: str, **options) -> EvalExample
Capture a production trace as a dataset row.
The path that turns an observed failure into evidence, which is where the refinement loop starts.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
trace_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: EvalExample
Raises:
JudgesAPI
class JudgesAPI()
Model-backed graders and their human alignment.
Usage example
def build_and_score(caliber: CaliberClient, *, owner: str = "@you") -> dict[str, Any]:
"""Create a dataset, add a row, define a judge, and run an evaluation."""
dataset = caliber.datasets.create("intake-golden", owner=owner)
caliber.datasets.add_example(
dataset.dataset_id,
inputs={"ticket": "I was charged twice"},
expected={"intent": "billing"},
)
# Instructions must reference an evaluation variable. A judge with no
# variable grades nothing — it returns the same verdict every time — so
# the server rejects it rather than letting you collect meaningless scores.
judge = caliber.judges.create(
"valid-intent",
instructions="Given {{ inputs }} and {{ outputs }}, return true if intent is allowed.",
feedback_value_type="bool",
)
evaluation = caliber.evaluations.create(dataset.dataset_id, judge_id=judge.judge_id)
return {
"dataset_id": dataset.dataset_id,
"judge_id": judge.judge_id,
"evaluation_id": evaluation.evaluation_id,
}sdk/caliber-sdk/examples/evaluation.py — executed by the SDK test suite.Methods
list() -> list[Judge]
Return the current collection of judges and alignment assets, applying any supported filters.
This callable takes no public parameters.
Returns: list[Judge]
Raises:
get(judge_id: str) -> Judge
Fetch one record from the judges and alignment assets surface identified by judge_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
judge_id | positional-or-keyword | str | — |
Returns: Judge
Raises:
create(name: str, *, instructions: str, feedback_value_type: str = 'bool', model: str | None = None, **options) -> Judge
Create a model-backed grader.
`instructions must reference at least one evaluation variable — {{ inputs }}, {{ outputs }}, {{ expectations }}, {{ conversation }}, or {{ trace }}` — or the server rejects it. The rule exists because a judge with no variable grades nothing: it would return the same verdict for every example.
`feedback_value_type defaults to bool`. A numeric judge is not interchangeable with a boolean one downstream, so scorecards read this field to know which they have.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
instructions | keyword-only | str | — | |
feedback_value_type | keyword-only | str | 'bool' | |
model | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: Judge
Raises:
test(judge_id: str, **payload) -> Any
Run a judge against sample input without recording a scorecard.
| Parameter | Kind | Type | Default |
|---|---|---|---|
judge_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
alignment(judge_id: str, **payload) -> JudgeAlignment
Agreement with human labels.
Read `kappa, not agreement`: a judge that always answers the same way agrees with a skewed sample while measuring nothing.
| Parameter | Kind | Type | Default |
|---|---|---|---|
judge_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: JudgeAlignment
Raises:
EvaluationsAPI
class EvaluationsAPI()
Scored runs over datasets.
Usage example
def build_and_score(caliber: CaliberClient, *, owner: str = "@you") -> dict[str, Any]:
"""Create a dataset, add a row, define a judge, and run an evaluation."""
dataset = caliber.datasets.create("intake-golden", owner=owner)
caliber.datasets.add_example(
dataset.dataset_id,
inputs={"ticket": "I was charged twice"},
expected={"intent": "billing"},
)
# Instructions must reference an evaluation variable. A judge with no
# variable grades nothing — it returns the same verdict every time — so
# the server rejects it rather than letting you collect meaningless scores.
judge = caliber.judges.create(
"valid-intent",
instructions="Given {{ inputs }} and {{ outputs }}, return true if intent is allowed.",
feedback_value_type="bool",
)
evaluation = caliber.evaluations.create(dataset.dataset_id, judge_id=judge.judge_id)
return {
"dataset_id": dataset.dataset_id,
"judge_id": judge.judge_id,
"evaluation_id": evaluation.evaluation_id,
}sdk/caliber-sdk/examples/evaluation.py — executed by the SDK test suite.Related APIs: EvalDatasetsAPI, JudgesAPI, ReviewQueuesAPI
Methods
list(*, dataset_id: str | None = None) -> list[Evaluation]
Return the current collection of evaluation runs, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
dataset_id | keyword-only | `str | None` | None |
Returns: list[Evaluation]
Raises:
get(evaluation_id: str) -> Evaluation
Fetch one record from the evaluation runs surface identified by evaluation_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
evaluation_id | positional-or-keyword | str | — |
Returns: Evaluation
Raises:
create(dataset_id: str, **options) -> Evaluation
Create a new record on the evaluation runs surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Evaluation
Raises:
wait(evaluation_id: str, *, timeout: float = 900.0, **options) -> Evaluation
Poll until the evaluation stops.
Returns the terminal evaluation rather than raising: a low score is the measurement, not an error in the call.
| Parameter | Kind | Type | Default |
|---|---|---|---|
evaluation_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: Evaluation
Raises:
Module caliber_sdk.resources.integrations
MCP servers, the LLM gateway, knowledge bases, and object storage.
Tested example
def install_ready_cookbook(caliber: CaliberClient) -> dict[str, Any]:
"""Install the first cookbook whose prerequisites are already satisfied.
Readiness is checked before installing rather than after failing: the
recipe's unmet checks name what is missing, and each one that can be fixed
carries the route that fixes it.
"""
recipes = caliber.cookbooks.list()
ready = [recipe for recipe in recipes if recipe.is_ready]
if not ready:
blocked = {
recipe.id: [check.get("label") for check in recipe.unmet_checks] for recipe in recipes
}
return {"installed": None, "blocked_by": blocked}
recipe = ready[0]
result = caliber.cookbooks.install(recipe.id, name=f"{recipe.title} (SDK)")
# Installed paused, never running: an example manifest can carry model,
# connector, or side-effect bindings an operator should review first.
workflow = result.get("workflow") if isinstance(result, dict) else None
return {
"installed": recipe.id,
"workflow_status": (workflow or {}).get("status"),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Public exports
GatewayAPI, KnowledgeBasesAPI, McpServersAPI, ObjectStoreAPI, OpenApiIntegrationsAPI
Classes
McpServersAPI
class McpServersAPI()
Managed MCP server definitions and governed tool use.
Related APIs: ToolsAPI, GatewayAPI
Methods
list() -> list[McpServer]
Return the current collection of MCP servers and governed tools, applying any supported filters.
This callable takes no public parameters.
Returns: list[McpServer]
Raises:
get(server_id: str) -> McpServer
Fetch one record from the MCP servers and governed tools surface identified by server_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: McpServer
Raises:
history(server_id: str) -> Any
Return the recorded history for the targeted managed integration.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: Any
Raises:
create(name: str, **options) -> McpServer
Create a new record on the MCP servers and governed tools surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: McpServer
Raises:
update(server_id: str, **changes) -> McpServer
Patch an existing record on the MCP servers and governed tools surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: McpServer
Raises:
delete(server_id: str) -> Any
Delete a record on the MCP servers and governed tools surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: Any
Raises:
test_connection(server_id: str) -> Any
Probe the server now, rather than trusting the last known state.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: Any
Raises:
discover_tools(server_id: str) -> Any
Refresh the tool inventory from the remote server.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: Any
Raises:
tools(server_id: str) -> Any
The tool inventory as last discovered.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: Any
Raises:
update_tool_policy(server_id: str, tool_name: str, **policy) -> Any
Write the policy overlay that governs one discovered tool.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
tool_name | positional-or-keyword | str | — |
policy | var-keyword | Any | — |
Returns: Any
Raises:
save_test_cases(server_id: str, tool_name: str, test_cases: list[dict[str, Any]]) -> Any
Persist deterministic calibration cases for the targeted integration tool.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
tool_name | positional-or-keyword | str | — |
test_cases | positional-or-keyword | list[dict[str, Any]] | — |
Returns: Any
Raises:
calibrate_tool(server_id: str, tool_name: str) -> Any
Start or run the calibration pass for the targeted integration tool.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
tool_name | positional-or-keyword | str | — |
Returns: Any
Raises:
invoke_tool(server_id: str, tool_name: str, arguments = None) -> Any
Call a remote tool through CALIBER's governed egress path.
Routed through the server rather than called directly, which is what makes tool policy, secret resolution, and audit apply at all.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
tool_name | positional-or-keyword | str | — |
arguments | positional-or-keyword | Any | None |
Returns: Any
Raises:
OpenApiIntegrationsAPI
class OpenApiIntegrationsAPI()
Governed OpenAPI import, curation, and publication.
The control-plane pipeline is: create an integration shell, import a pinned spec version into it, review the normalized operations and detected dependencies, generate tool drafts from selected operations, then publish an approved draft into CALIBER's tool registry. Importing a spec never creates a runtime tool by itself — `generate_tool_drafts and publish_tool_draft` are the two explicit steps that do.
Related APIs: ToolsAPI, McpServersAPI
Methods
list(*, status: str | None = None) -> list[OpenApiIntegration]
Return the current collection of OpenAPI integrations, tool drafts, and dependency graph, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[OpenApiIntegration]
Raises:
get(integration_id: str) -> OpenApiIntegration
Fetch one record from the OpenAPI integrations, tool drafts, and dependency graph surface identified by integration_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
Returns: OpenApiIntegration
Raises:
create(name: str, **options) -> OpenApiIntegration
Create a new record on the OpenAPI integrations, tool drafts, and dependency graph surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: OpenApiIntegration
Raises:
update(integration_id: str, **changes) -> OpenApiIntegration
Patch an existing record on the OpenAPI integrations, tool drafts, and dependency graph surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: OpenApiIntegration
Raises:
archive(integration_id: str) -> OpenApiIntegration
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
Returns: OpenApiIntegration
Raises:
import_spec(integration_id: str, *, spec_text: str | None = None, spec_base64: str | None = None, spec_url: str | None = None, source_ref: str | None = None) -> OpenApiIntegrationVersion
Import one OpenAPI 3.x document, pinning it as a new version.
Exactly one of `spec_text (pasted JSON/YAML), spec_base64 (an uploaded file), or spec_url` (fetched over CALIBER's guarded egress path) must be given.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
spec_text | keyword-only | `str | None` | None |
spec_base64 | keyword-only | `str | None` | None |
spec_url | keyword-only | `str | None` | None |
source_ref | keyword-only | `str | None` | None |
Returns: OpenApiIntegrationVersion
Raises:
reimport(integration_id: str) -> Any
Re-fetch the last imported version's `url` source and diff it.
Only meaningful when the last imported version came from `spec_url`; an inline or uploaded spec has nothing live to re-fetch.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
Returns: Any
Raises:
validate_spec_source(integration_id: str, *, spec_url: str, source_kind: str = 'url') -> Any
Check whether a spec source is reachable and permitted, without importing it.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
spec_url | keyword-only | str | — |
source_kind | keyword-only | str | 'url' |
Returns: Any
Raises:
versions(integration_id: str) -> list[OpenApiIntegrationVersion]
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
Returns: list[OpenApiIntegrationVersion]
Raises:
version(integration_id: str, version_id: str) -> OpenApiIntegrationVersion
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
version_id | positional-or-keyword | str | — |
Returns: OpenApiIntegrationVersion
Raises:
diff_version(integration_id: str, version_id: str, *, compare_to_version_id: str | None = None) -> Any
Diff one pinned version against another, defaulting to its predecessor.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
version_id | positional-or-keyword | str | — | |
compare_to_version_id | keyword-only | `str | None` | None |
Returns: Any
Raises:
list_operations(integration_id: str, *, version_id: str | None = None) -> list[OpenApiOperation]
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
version_id | keyword-only | `str | None` | None |
Returns: list[OpenApiOperation]
Raises:
get_operation(integration_id: str, operation_id: str) -> OpenApiOperation
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: OpenApiOperation
Raises:
list_dependencies(integration_id: str, *, version_id: str | None = None, status: str | None = None) -> list[OpenApiOperationDependency]
Canonical dependency rows — the source of truth the API graph derives from.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
version_id | keyword-only | `str | None` | None |
status | keyword-only | `str | None` | None |
Returns: list[OpenApiOperationDependency]
Raises:
review_dependency(integration_id: str, dependency_id: str, *, status: str, notes: str | None = None) -> OpenApiOperationDependency
Confirm or reject one suggested/advisory dependency (`status is "confirmed" or "rejected"`). A high-confidence, already auto-wired row cannot be reviewed.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
dependency_id | positional-or-keyword | str | — | |
status | keyword-only | str | — | |
notes | keyword-only | `str | None` | None |
Returns: OpenApiOperationDependency
Raises:
graph(integration_id: str, *, version_id: str | None = None) -> Any
The derived API dependency graph (nodes/edges) for planning and display.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
version_id | keyword-only | `str | None` | None |
Returns: Any
Raises:
generate_tool_drafts(integration_id: str, *, operation_ids: list[str] | None = None, tags: list[str] | None = None, methods: list[str] | None = None, path_prefix: str | None = None, group_as_pack: bool = False, version_id: str | None = None, server_url: str | None = None, auth_binding: dict[str, Any] | None = None, requires_approval: bool = False, allow_in_preview: bool = False) -> list[OpenApiToolDraft]
Generate one or more curated tool drafts from selected operations.
Select operations by id, or by filter (`tags/methods/path_prefix) — useful for a large spec without enumerating every id by hand. With group_as_pack=True` and more than one selected operation, all of them are bound into a single tool-pack draft instead of one draft each.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
operation_ids | keyword-only | `list[str] | None` | None |
tags | keyword-only | `list[str] | None` | None |
methods | keyword-only | `list[str] | None` | None |
path_prefix | keyword-only | `str | None` | None |
group_as_pack | keyword-only | bool | False | |
version_id | keyword-only | `str | None` | None |
server_url | keyword-only | `str | None` | None |
auth_binding | keyword-only | `dict[str, Any] | None` | None |
requires_approval | keyword-only | bool | False | |
allow_in_preview | keyword-only | bool | False |
Returns: list[OpenApiToolDraft]
Raises:
list_tool_drafts(integration_id: str) -> list[OpenApiToolDraft]
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
Returns: list[OpenApiToolDraft]
Raises:
get_tool_draft(integration_id: str, draft_id: str) -> OpenApiToolDraft
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
draft_id | positional-or-keyword | str | — |
Returns: OpenApiToolDraft
Raises:
update_tool_draft(integration_id: str, draft_id: str, **changes) -> OpenApiToolDraft
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
draft_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: OpenApiToolDraft
Raises:
preview_tool_draft(integration_id: str, draft_id: str, *, input: dict[str, Any] | None = None) -> Any
Run one real upstream call for an unpublished draft.
This is a live effect, not a simulation — refused unless the draft has `allow_in_preview` set, so an approval-gated write cannot be fired through preview before anyone approves it.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
draft_id | positional-or-keyword | str | — | |
input | keyword-only | `dict[str, Any] | None` | None |
Returns: Any
Raises:
publish_tool_draft(integration_id: str, draft_id: str, *, name: str | None = None, description: str | None = None, version: str = '1.0') -> Any
Publish an approved draft into CALIBER's governed tool registry.
Returns `{"draft": ..., "tool": ...} — the tool is now reachable through the standard tool, workflow, and SDK tools` surfaces.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
draft_id | positional-or-keyword | str | — | |
name | keyword-only | `str | None` | None |
description | keyword-only | `str | None` | None |
version | keyword-only | str | '1.0' |
Returns: Any
Raises:
validate_credential_binding(integration_id: str, *, auth_binding: dict[str, Any]) -> Any
Check whether an auth binding's secret references resolve, without publishing.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
auth_binding | keyword-only | dict[str, Any] | — |
Returns: Any
Raises:
GatewayAPI
class GatewayAPI()
External LLM gateway discovery, guardrails, and usage.
Methods
get() -> Any
Discovered endpoints and routing visibility.
This callable takes no public parameters.
Returns: Any
Raises:
usage(**params) -> Any
Trace-derived usage. Derived, not metered: it reports what was traced, so untraced calls are absent rather than zero.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
guardrails() -> Any
Return the configured gateway guardrails for the connected deployment.
This callable takes no public parameters.
Returns: Any
Raises:
guardrail_catalog() -> Any
What this deployment can enforce, versus what it does.
This callable takes no public parameters.
Returns: Any
Raises:
create_guardrail(**payload) -> Any
Create a new gateway guardrail from the supplied configuration payload.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | var-keyword | Any | — |
Returns: Any
Raises:
delete_guardrail(guardrail_id: str) -> Any
Delete the targeted gateway guardrail definition.
| Parameter | Kind | Type | Default |
|---|---|---|---|
guardrail_id | positional-or-keyword | str | — |
Returns: Any
Raises:
attach_guardrail(endpoint_id: str, **payload) -> Any
Operate on the gateway policies and usage surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
endpoint_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
KnowledgeBasesAPI
class KnowledgeBasesAPI()
Versioned RAG corpora, retrieval, and calibration.
Related APIs: ProjectsAPI, EvaluationsAPI
Methods
list(*, status: str | None = None) -> list[KnowledgeBase]
Return the current collection of knowledge bases, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[KnowledgeBase]
Raises:
get(knowledge_base_id: str) -> KnowledgeBase
Fetch one record from the knowledge bases surface identified by knowledge_base_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
Returns: KnowledgeBase
Raises:
create(name: str, **options) -> KnowledgeBase
Create a new record on the knowledge bases surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: KnowledgeBase
Raises:
update(knowledge_base_id: str, **changes) -> KnowledgeBase
Patch an existing record on the knowledge bases surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: KnowledgeBase
Raises:
delete(knowledge_base_id: str) -> Any
Delete a record on the knowledge bases surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
Returns: Any
Raises:
options() -> Any
Embedding models and chunking strategies this deployment offers.
This callable takes no public parameters.
Returns: Any
Raises:
versions(knowledge_base_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
Returns: Any
Raises:
create_version(knowledge_base_id: str, **payload) -> Any
Create a new version under the targeted top-level asset.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
activate_version(knowledge_base_id: str, version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
runs(knowledge_base_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
Returns: Any
Raises:
run_events(run_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
version(version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
sync_version_to_age(version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
sources(version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
chunks(version_id: str, *, q: str | None = None, source_key: str | None = None, limit: int | None = None) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
version_id | positional-or-keyword | str | — | |
q | keyword-only | `str | None` | None |
source_key | keyword-only | `str | None` | None |
limit | keyword-only | `int | None` | None |
Returns: Any
Raises:
entities(version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
relationships(version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
graph(version_id: str, **params) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
calibrate(knowledge_base_id: str, **options) -> Any
Start the calibration flow exposed by the knowledge bases surface.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
test_runs(knowledge_base_id: str, *, limit: int | None = None) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
Returns: Any
Raises:
test_run(test_run_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
test_run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
set_baseline(knowledge_base_id: str, **options) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
rollback(knowledge_base_id: str, **options) -> Any
Roll back to a prior version.
Knowledge bases roll back by activation history, not by an alias restore — the semantics differ per asset family, and the server is the authority on what this one means.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
query(**payload) -> Any
Run a query against the server-managed corpus or knowledge surface and return the response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | var-keyword | Any | — |
Returns: Any
Raises:
ObjectStoreAPI
class ObjectStoreAPI()
S3/MinIO console operations.
Distinct from `projects.files`: that is CALIBER's managed file registry with lineage and immutable refs, this is the raw bucket browser underneath.
Methods
status() -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: Any
Raises:
buckets() -> list[Bucket]
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: list[Bucket]
Raises:
create_bucket(bucket: str) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
Returns: Any
Raises:
delete_bucket(bucket: str) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
Returns: Any
Raises:
listing(bucket: str, *, prefix: str | None = None, token: str | None = None, recursive: bool = False) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
prefix | keyword-only | `str | None` | None |
token | keyword-only | `str | None` | None |
recursive | keyword-only | bool | False |
Returns: Any
Raises:
objects(bucket: str, *, prefix: str | None = None, token: str | None = None, recursive: bool = False) -> list[StoredObject]
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
prefix | keyword-only | `str | None` | None |
token | keyword-only | `str | None` | None |
recursive | keyword-only | bool | False |
Returns: list[StoredObject]
Raises:
folders(bucket: str, *, prefix: str | None = None) -> list[str]
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
prefix | keyword-only | `str | None` | None |
Returns: list[str]
Raises:
upload(bucket: str, *, filename: str, content: bytes, prefix: str | None = None, key: str | None = None, media_type: str | None = None) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
filename | keyword-only | str | — | |
content | keyword-only | bytes | — | |
prefix | keyword-only | `str | None` | None |
key | keyword-only | `str | None` | None |
media_type | keyword-only | `str | None` | None |
Returns: Any
Raises:
create_folder(bucket: str, name: str, *, prefix: str | None = None) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
name | positional-or-keyword | str | — | |
prefix | keyword-only | `str | None` | None |
Returns: Any
Raises:
delete_objects(bucket: str, *, keys: list[str] | None = None, prefix: str | None = None) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
keys | keyword-only | `list[str] | None` | None |
prefix | keyword-only | `str | None` | None |
Returns: Any
Raises:
download(bucket: str, key: str, *, disposition: str | None = None) -> bytes
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
key | positional-or-keyword | str | — | |
disposition | keyword-only | `str | None` | None |
Returns: bytes
Raises:
preview(bucket: str, key: str) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
key | positional-or-keyword | str | — |
Returns: Any
Raises:
extract(bucket: str, key: str) -> Any
Extract text/structure from a stored document.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
key | positional-or-keyword | str | — |
Returns: Any
Raises:
import_object(bucket: str, key: str, **options) -> Any
Register a stored object as a managed project file.
The bridge from raw storage into the governed registry, where it gains a content hash and lineage.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
key | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
delete_object(bucket: str, key: str) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
key | positional-or-keyword | str | — |
Returns: Any
Raises:
Module caliber_sdk.resources.operations
Jobs, review queues, Aria, releases, observability, audit, events, cookbooks.
Tested example
def plan_from_intent(caliber: CaliberClient, goal: str) -> dict[str, Any]:
"""State an intent, wait for Aria to plan it, and approve if it asks.
``wait_for_plan`` returns as soon as the plan pauses, because a paused plan
makes no further progress on its own — polling past it would burn the whole
timeout on the expected outcome.
"""
detail = caliber.aria.create_plan(goal)
settled = caliber.aria.wait_for_plan(detail.plan.plan_id, timeout=120)
if settled.plan.needs_you:
# The plan is waiting on a human decision. Approving is that decision,
# made explicitly rather than inferred from the script continuing.
caliber.aria.approve_plan(settled.plan.plan_id)
settled = caliber.aria.execute_plan(settled.plan.plan_id)
return {
"plan_id": settled.plan.plan_id,
"status": settled.plan.status,
"steps": len(settled.steps),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Public exports
AriaAPI, AuditAPI, CookbooksAPI, EventsAPI, JobsAPI, ObservabilityAPI, ReleasesAPI, ReviewQueuesAPI, SecretsAPI
Classes
JobsAPI
class JobsAPI()
Durable background jobs — refinement, calibration, reporting.
Methods
list(*, status: str | None = None) -> list[Job]
Return the current collection of background jobs, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Job]
Raises:
get(job_id: str) -> Job
Fetch one record from the background jobs surface identified by job_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
Returns: Job
Raises:
targets(job_id: str) -> Any
What applying this job would change.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
Returns: Any
Raises:
apply(job_id: str, **options) -> Any
Apply a job's candidate. This is the human decision, made explicit.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
wait(job_id: str, *, timeout: float = 900.0, **options) -> Job
Poll until the job stops or stops for a person.
`awaits_human counts as done here on purpose. A refinement job that reaches candidate_ready` will never advance on its own, so a waiter that only accepted terminal states would block until timeout on the expected outcome.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: Job
Raises:
ReviewQueuesAPI
class ReviewQueuesAPI()
Structured human review.
Related APIs: JudgesAPI, ObservabilityAPI, EvalDatasetsAPI
Methods
list() -> list[ReviewQueue]
Return the current collection of review queues and queue items, applying any supported filters.
This callable takes no public parameters.
Returns: list[ReviewQueue]
Raises:
get(queue_id: str) -> ReviewQueue
Fetch one record from the review queues and queue items surface identified by queue_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
Returns: ReviewQueue
Raises:
create(name: str, **options) -> ReviewQueue
Create a new record on the review queues and queue items surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: ReviewQueue
Raises:
update(queue_id: str, **changes) -> ReviewQueue
Patch an existing record on the review queues and queue items surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: ReviewQueue
Raises:
enqueue(queue_id: str, **payload) -> Any
Add the supplied items to the targeted review queue.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
submit(queue_id: str, item_id: str, **answers) -> Any
Answer a queued item. The write-back that turns review into evidence.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
item_id | positional-or-keyword | str | — |
answers | var-keyword | Any | — |
Returns: Any
Raises:
alignment_examples(queue_id: str) -> Any
Human labels usable for judge-alignment scoring.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
Returns: Any
Raises:
AriaAPI
class AriaAPI()
Aria goal-plans: the permissioned agentic loop.
Usage example
def plan_from_intent(caliber: CaliberClient, goal: str) -> dict[str, Any]:
"""State an intent, wait for Aria to plan it, and approve if it asks.
``wait_for_plan`` returns as soon as the plan pauses, because a paused plan
makes no further progress on its own — polling past it would burn the whole
timeout on the expected outcome.
"""
detail = caliber.aria.create_plan(goal)
settled = caliber.aria.wait_for_plan(detail.plan.plan_id, timeout=120)
if settled.plan.needs_you:
# The plan is waiting on a human decision. Approving is that decision,
# made explicitly rather than inferred from the script continuing.
caliber.aria.approve_plan(settled.plan.plan_id)
settled = caliber.aria.execute_plan(settled.plan.plan_id)
return {
"plan_id": settled.plan.plan_id,
"status": settled.plan.status,
"steps": len(settled.steps),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Related APIs: JobsAPI, ReviewQueuesAPI, JudgesAPI, EvalDatasetsAPI
Methods
capabilities() -> Any
What Aria is allowed to do in this deployment.
This callable takes no public parameters.
Returns: Any
Raises:
plans(*, session_id: str | None = None, limit: int | None = None, offset: int | None = None) -> list[AriaPlan]
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
session_id | keyword-only | `str | None` | None |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[AriaPlan]
Raises:
get_plan(plan_id: str) -> AriaPlanDetail
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
Returns: AriaPlanDetail
Raises:
create_plan(goal: str, **options) -> AriaPlanDetail
State an intent. Aria plans the steps; you approve them.
| Parameter | Kind | Type | Default |
|---|---|---|---|
goal | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
update_plan(plan_id: str, **changes) -> AriaPlanDetail
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
approve_plan(plan_id: str, **options) -> AriaPlanDetail
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
execute_plan(plan_id: str, **options) -> AriaPlanDetail
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
poll_plan(plan_id: str, **options) -> AriaPlanDetail
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
interactions(plan_id: str, *, limit: int | None = None, offset: int | None = None) -> list[AriaInteraction]
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
plan_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[AriaInteraction]
Raises:
answer(interaction_id: str, **payload) -> AriaPlanDetail
Answer a question Aria paused to ask.
| Parameter | Kind | Type | Default |
|---|---|---|---|
interaction_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
wait_for_plan(plan_id: str, *, timeout: float = 900.0, **options) -> AriaPlanDetail
Poll until the plan finishes or pauses for you.
`paused` is a resting state, not a transient one: the plan makes no further progress until a person answers, so polling past it would burn the whole timeout waiting for something that cannot happen.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
ReleasesAPI
class ReleasesAPI()
Release candidates, evidence, waivers, and signoff.
Related APIs: EvaluationsAPI, ReviewQueuesAPI, WorkflowsAPI
Methods
candidates() -> list[ReleaseCandidate]
Operate on the release candidates and signoffs surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: list[ReleaseCandidate]
Raises:
get_candidate(candidate_id: str) -> ReleaseCandidate
Operate on the release candidates and signoffs surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
candidate_id | positional-or-keyword | str | — |
Returns: ReleaseCandidate
Raises:
create_candidate(name: str, **options) -> ReleaseCandidate
Create a release candidate with its decision criteria, evidence, and rollback metadata.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: ReleaseCandidate
Raises:
evaluate(candidate_id: str, **options) -> ReleaseCandidate
Recompute the weighted score from current evidence.
| Parameter | Kind | Type | Default |
|---|---|---|---|
candidate_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: ReleaseCandidate
Raises:
add_waiver(candidate_id: str, **payload) -> Any
Record an exception. Admin-only, and audited — a waiver is a decision someone owns, not a way to raise a score.
| Parameter | Kind | Type | Default |
|---|---|---|---|
candidate_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
generate_report(candidate_id: str, **options) -> Any
Start the durable report-generation job for the targeted release candidate.
| Parameter | Kind | Type | Default |
|---|---|---|---|
candidate_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
sign(candidate_id: str, *, decision: str, rationale: str, **options) -> Any
Record go / no-go. `rationale` is required by design: a signoff without a reason is not evidence of a decision.
| Parameter | Kind | Type | Default |
|---|---|---|---|
candidate_id | positional-or-keyword | str | — |
decision | keyword-only | str | — |
rationale | keyword-only | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
ObservabilityAPI
class ObservabilityAPI()
Traces, experiments, and metrics.
Methods
traces(**params) -> list[Trace]
Operate on the observability traces and metrics surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: list[Trace]
Raises:
trace(trace_id: str) -> Any
One trace with its full span tree, left untyped: the node structure is MLflow's, and re-declaring it here would drift from it.
| Parameter | Kind | Type | Default |
|---|---|---|---|
trace_id | positional-or-keyword | str | — |
Returns: Any
Raises:
experiments() -> Any
Operate on the observability traces and metrics surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: Any
Raises:
metrics(**params) -> Any
Operate on the observability traces and metrics surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
AuditAPI
class AuditAPI()
The audit log.
Methods
list(**params) -> list[AuditEntry]
Return the current collection of audit log entries, applying any supported filters.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: list[AuditEntry]
Raises:
export(*, format: str = 'csv', **params) -> bytes
Raw export bytes. CSV by default; JSON is admin-only on the server.
| Parameter | Kind | Type | Default |
|---|---|---|---|
format | keyword-only | str | 'csv' |
params | var-keyword | Any | — |
Returns: bytes
Raises:
EventsAPI
class EventsAPI()
Server-sent events.
Methods
stream(**params) -> Iterator[str]
Yield raw SSE lines.
Deliberately unparsed. The event vocabulary is a live surface, and a client that decoded into fixed types would reject events added after it shipped — the opposite of what a stream consumer wants.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Iterator[str]
Raises:
CookbooksAPI
class CookbooksAPI()
Built-in, installable examples.
Usage example
def install_ready_cookbook(caliber: CaliberClient) -> dict[str, Any]:
"""Install the first cookbook whose prerequisites are already satisfied.
Readiness is checked before installing rather than after failing: the
recipe's unmet checks name what is missing, and each one that can be fixed
carries the route that fixes it.
"""
recipes = caliber.cookbooks.list()
ready = [recipe for recipe in recipes if recipe.is_ready]
if not ready:
blocked = {
recipe.id: [check.get("label") for check in recipe.unmet_checks] for recipe in recipes
}
return {"installed": None, "blocked_by": blocked}
recipe = ready[0]
result = caliber.cookbooks.install(recipe.id, name=f"{recipe.title} (SDK)")
# Installed paused, never running: an example manifest can carry model,
# connector, or side-effect bindings an operator should review first.
workflow = result.get("workflow") if isinstance(result, dict) else None
return {
"installed": recipe.id,
"workflow_status": (workflow or {}).get("status"),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Related APIs: WorkflowsAPI, ProjectsAPI, ReviewQueuesAPI, AriaAPI
Methods
list() -> list[CookbookRecipe]
Return the current collection of built-in cookbook recipes, applying any supported filters.
This callable takes no public parameters.
Returns: list[CookbookRecipe]
Raises:
install(cookbook_id: str, *, name: str | None = None, **options) -> Any
Install a recipe as a paused workflow plus an editable draft.
Paused on purpose: an example manifest can carry model, connector, or side-effect bindings that an operator should review before anything runs.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
cookbook_id | positional-or-keyword | str | — | |
name | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: Any
Raises:
SecretsAPI
class SecretsAPI()
Secret references. Write-only: values are never returned.
Methods
list() -> Any
Names and metadata only — no values, by design.
This callable takes no public parameters.
Returns: Any
Raises:
put(name: str, value: str) -> Any
Operate on the secret references surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
value | positional-or-keyword | str | — |
Returns: Any
Raises:
revoke(name: str) -> Any
Operate on the secret references surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
Returns: Any
Raises:
delete(name: str) -> Any
Delete a record on the secret references surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
Returns: Any
Raises:
Module caliber_sdk.resources.raw
Untyped access to any management endpoint.
Tested example
def plan_from_intent(caliber: CaliberClient, goal: str) -> dict[str, Any]:
"""State an intent, wait for Aria to plan it, and approve if it asks.
``wait_for_plan`` returns as soon as the plan pauses, because a paused plan
makes no further progress on its own — polling past it would burn the whole
timeout on the expected outcome.
"""
detail = caliber.aria.create_plan(goal)
settled = caliber.aria.wait_for_plan(detail.plan.plan_id, timeout=120)
if settled.plan.needs_you:
# The plan is waiting on a human decision. Approving is that decision,
# made explicitly rather than inferred from the script continuing.
caliber.aria.approve_plan(settled.plan.plan_id)
settled = caliber.aria.execute_plan(settled.plan.plan_id)
return {
"plan_id": settled.plan.plan_id,
"status": settled.plan.status,
"steps": len(settled.steps),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Public exports
RawAPI
Classes
RawAPI
class RawAPI()
Call any path under `/ajax-api/2.0/mlflow/caliber`.
Methods
get(path: str, **kwargs) -> Any
Fetch one record from the low-level management API routes surface identified by path.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
post(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
put(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
patch(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
delete(path: str, **kwargs) -> Any
Delete a record on the low-level management API routes surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
paginate(path: str, *, params: Mapping[str, Any] | None = None, limit: int = 100) -> Iterator[Any]
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
limit | keyword-only | int | 100 |
Returns: Iterator[Any]
Raises:
Model modules
Module caliber_sdk.models
Shared models for the CALIBER SDK.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_api.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
FAILED_RUN_STATES, STABILITY_BETA, STABILITY_GA, STABILITY_INTERNAL, TERMINAL_RUN_STATES, Account, AriaInteraction, AriaPlan, AriaPlanDetail, AriaPlanStep, AuditEntry, Bucket, CalibrationJob, Capabilities, CookbookRecipe, ErrorBody, EvalDataset, EvalExample, Evaluation, Extensibility, FieldError, Identity, IssuedToken, Job, Judge, JudgeAlignment, KnowledgeBase, LlmSetupStatus, McpServer, OpenApiIntegration, OpenApiIntegrationVersion, OpenApiOperation, OpenApiOperationDependency, OpenApiToolDraft, OptimizerPlugin, Page, PersonalAccessToken, Project, ProjectFile, ProjectFolder, ProjectMember, Prompt, RegisteredOptimizer, ReleaseCandidate, ReviewQueue, RuntimeSettings, RuntimeSettingsSummary, SessionInfo, Skill, SkillRender, SkillSelection, SkillVersion, Stability, StoredObject, Tool, Trace, Workflow, WorkflowRun, WorkflowRunCapabilities, WorkflowService, WorkflowVersion, decode, decode_list
Module caliber_sdk.models.common
Shapes shared across the API, independent of any one resource.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_api.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
STABILITY_BETA, STABILITY_GA, STABILITY_INTERNAL, Page, Stability
Module constants
| Name | Value |
|---|---|
STABILITY_GA | 'ga' |
STABILITY_BETA | 'beta' |
STABILITY_INTERNAL | 'internal' |
Classes
Page
class Page()
One page of an offset-paginated list.
Kept even though :meth:Transport.paginate hides pagination from most callers: a caller who needs to checkpoint and resume needs the offset, and reconstructing it from a flat iterator is not possible.
Dataclass fields
| Field | Type | Default |
|---|---|---|
items | list[Any] | field(default_factory=list) |
limit | int | 0 |
offset | int | 0 |
Properties
is_last() -> bool
Whether this looks like the final page.
A short page ends the sequence. A full page might too -- the only way to know is to ask for the next one and get nothing.
This callable takes no public parameters.
Returns: bool
next_offset() -> int
Operate on the page surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: int
Stability
class Stability()
Which API tags fall in which tier.
Dataclass fields
| Field | Type | Default |
|---|---|---|
ga | tuple[str, ...] | () |
beta | tuple[str, ...] | () |
internal | tuple[str, ...] | () |
Methods
from_payload(payload) -> Stability
Operate on the stability surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | positional-or-keyword | Any | — |
Returns: Stability
tier_of(tag: str) -> str | None
Operate on the stability surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tag | positional-or-keyword | str | — |
Returns: str | None
Module caliber_sdk.models.core
Typed models for the core admin surfaces: auth, identity, capabilities, settings.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_api.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
Account, Capabilities, Extensibility, Identity, IssuedToken, LlmSetupStatus, OptimizerPlugin, PersonalAccessToken, Project, ProjectFile, ProjectFolder, ProjectMember, RegisteredOptimizer, RuntimeSettings, RuntimeSettingsSummary, SessionInfo, WorkflowRunCapabilities
Classes
Identity
class Identity()
Who the caller is, from `GET /me`.
Note the server reports identity rather than requiring it: an invalid or revoked credential yields `user_id == "anonymous" with no scopes rather than an error. :meth:is_anonymous` is the check to make.
Dataclass fields
| Field | Type | Default |
|---|---|---|
user_id | str | '' |
scopes | list[str] | field(default_factory=list) |
is_admin | bool | False |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_anonymous() -> bool
Operate on the identity surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
SessionInfo
class SessionInfo()
How the caller's identity was established, from `GET /auth/session`.
Dataclass fields
| Field | Type | Default |
|---|---|---|
user_id | str | '' |
scopes | list[str] | field(default_factory=list) |
is_admin | bool | False |
auth_mode | str | '' |
authenticated_by | str | '' |
login_required | bool | False |
extra | dict[str, Any] | field(default_factory=dict) |
Account
class Account()
A user account. Never carries a password hash.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
user_id | str | '' | |
disabled | bool | False | |
created_at | `str | None` | None |
password_updated_at | `str | None` | None |
last_login_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
PersonalAccessToken
class PersonalAccessToken()
Token metadata. Never carries the secret.
The plaintext lives on :class:IssuedToken, which only the issue and rotate calls return — mirroring the server, where a listed token has no `token` key at all rather than a null one.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
token_id | str | '' | |
user_id | str | '' | |
name | str | '' | |
scopes | list[str] | field(default_factory=list) | |
created_at | `str | None` | None |
created_by | `str | None` | None |
expires_at | `str | None` | None |
last_used_at | `str | None` | None |
revoked_at | `str | None` | None |
revoked_reason | `str | None` | None |
rotated_from | `str | None` | None |
active | bool | True | |
extra | dict[str, Any] | field(default_factory=dict) |
IssuedToken
class IssuedToken()
Bases: PersonalAccessToken
A freshly issued token. `token` is returned exactly once, ever.
Dataclass fields
| Field | Type | Default |
|---|---|---|
token | str | '' |
WorkflowRunCapabilities
class WorkflowRunCapabilities()
Which workflow-run features the deployment has switched on.
Dataclass fields
| Field | Type | Default |
|---|---|---|
queue_enabled | bool | False |
supports_async_submit | bool | False |
supports_cancel | bool | False |
supports_retry | bool | False |
supports_resume | bool | False |
runtime_approvals_enabled | bool | False |
checkpointing_enabled | bool | False |
event_backend | str | '' |
approval_readiness | dict[str, Any] | field(default_factory=dict) |
extra | dict[str, Any] | field(default_factory=dict) |
RegisteredOptimizer
class RegisteredOptimizer()
One optimizer the deployment can run, with its provenance.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
name | str | '' | |
summary | str | '' | |
artifact_types | list[str] | field(default_factory=list) | |
source | str | 'builtin' | |
requires | `str | None` | None |
distribution | `str | None` | None |
explicit_only | bool | False | |
experimental | bool | False | |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_third_party() -> bool
True when a distribution other than CALIBER registered this.
Worth checking before pinning an agent to an optimizer: a third-party optimizer authors the artifact that gets promoted to production, and it is only present because the deployment allowlisted its distribution.
This callable takes no public parameters.
Returns: bool
Methods
can_target(artifact_type: str) -> bool
Operate on the registered optimizer surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
artifact_type | positional-or-keyword | str | — |
Returns: bool
OptimizerPlugin
class OptimizerPlugin()
An installed optimizer plugin and whether the deployment enabled it.
An entry with `allowlisted=False` is installed and inert. That is the normal state for a freshly installed plugin, not an error — CALIBER discovers plugins automatically and enables none of them automatically.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
name | str | '' | |
distribution | `str | None` | None |
value | str | '' | |
allowlisted | bool | False | |
error | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_active() -> bool
Operate on the optimizer plugin surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
Extensibility
class Extensibility()
What this deployment can run, and what it has been permitted to run.
Dataclass fields
| Field | Type | Default |
|---|---|---|
optimizers | list[RegisteredOptimizer] | field(default_factory=list) |
plugins | list[OptimizerPlugin] | field(default_factory=list) |
allowlist_env_var | str | 'CALIBER_PLUGIN_ALLOWLIST' |
extra | dict[str, Any] | field(default_factory=dict) |
Methods
optimizers_for(artifact_type: str) -> list[RegisteredOptimizer]
Optimizers that can target one artifact kind.
Filtering matters because the artifact kinds are not interchangeable: submitting a skill job with a prompt-only optimizer is rejected by the server, and asking here is how a caller avoids finding out that way.
| Parameter | Kind | Type | Default |
|---|---|---|---|
artifact_type | positional-or-keyword | str | — |
Returns: list[RegisteredOptimizer]
optimizer(name: str) -> RegisteredOptimizer | None
Operate on the extensibility surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
Returns: RegisteredOptimizer | None
Capabilities
class Capabilities()
Runtime feature flags plus the SDK stability tiers.
`artifact_families is deliberately left as a mapping: the server documents that each family means something different by the same key (rollback` in particular), so flattening it here would imply a uniformity the platform does not have.
Dataclass fields
| Field | Type | Default |
|---|---|---|
workflow_runs | WorkflowRunCapabilities | field(default_factory=WorkflowRunCapabilities) |
sync_workflow_version_run | bool | True |
artifact_families | dict[str, Any] | field(default_factory=dict) |
sdk_stability | dict[str, list[str]] | field(default_factory=dict) |
extensibility | Extensibility | field(default_factory=Extensibility) |
extra | dict[str, Any] | field(default_factory=dict) |
Methods
tier_of(tag: str) -> str | None
Which stability tier an API tag falls in, or `None` if unknown.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tag | positional-or-keyword | str | — |
Returns: str | None
is_ga(tag: str) -> bool
Operate on the capabilities surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tag | positional-or-keyword | str | — |
Returns: bool
LlmSetupStatus
class LlmSetupStatus()
Which LLM credentials are configured — presence, never values.
The server returns masked fingerprints only. A field here that looked like a key would misrepresent what the endpoint is willing to disclose.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
llm_provider | str | '' | |
gateway_url | str | '' | |
openai_key_env | `str | None` | None |
openai_key_present | bool | False | |
anthropic_key_present | bool | False | |
assistant_engine | str | '' | |
openai_key_fingerprint | `str | None` | None |
anthropic_key_fingerprint | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
RuntimeSettingsSummary
class RuntimeSettingsSummary()
Data model returned by the SDK for runtime settings summary records.
Dataclass fields
| Field | Type | Default |
|---|---|---|
total | int | 0 |
live_editable | int | 0 |
environment_managed | int | 0 |
configured | int | 0 |
defaults | int | 0 |
secret_sources | int | 0 |
extra | dict[str, Any] | field(default_factory=dict) |
RuntimeSettings
class RuntimeSettings()
Grouped inventory of runtime configuration knobs.
Dataclass fields
| Field | Type | Default |
|---|---|---|
summary | RuntimeSettingsSummary | field(default_factory=RuntimeSettingsSummary) |
groups | list[dict[str, Any]] | field(default_factory=list) |
extra | dict[str, Any] | field(default_factory=dict) |
Project
class Project()
A project/workspace.
`file_count is present on list responses and absent on detail ones — the server computes it with one grouped query for the list only. None` means "not reported here", which is why it is not defaulted to 0.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
project_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
owner | str | '' | |
status | str | '' | |
storage_backend | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
file_count | `int | None` | None |
access_role | `str | None` | None |
permissions | list[str] | field(default_factory=list) | |
extra | dict[str, Any] | field(default_factory=dict) |
ProjectMember
class ProjectMember()
A user's active or inactive membership in a project.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
member_id | str | '' | |
project_id | str | '' | |
user_id | str | '' | |
role | str | 'viewer' | |
status | str | 'active' | |
created_by | str | '' | |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
ProjectFile
class ProjectFile()
One stored file.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
file_id | str | '' | |
file_ref | `str | None` | None |
name | str | '' | |
kind | `str | None` | None |
relative_path | `str | None` | None |
media_type | `str | None` | None |
size_bytes | `int | None` | None |
sha256 | `str | None` | None |
etag | `str | None` | None |
object_version_id | `str | None` | None |
version | `int | None` | None |
status | `str | None` | None |
storage_backend | `str | None` | None |
producer_node_id | `str | None` | None |
project_id | `str | None` | None |
workflow_run_id | `str | None` | None |
playground_run_id | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
immutable_ref | `dict[str, Any] | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
ProjectFolder
class ProjectFolder()
Data model returned by the SDK for project folder records.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
path | str | '' | |
name | `str | None` | None |
file_ref | `str | None` | None |
storage_backend | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Module caliber_sdk.models.assets
Typed models for the governed asset families: prompts, skills, tools.
Tested example
def prompt_lifecycle(
caliber: CaliberClient, *, agent_id: str = "intake-classifier"sdk/caliber-sdk/examples/prompt_lifecycle.py — executed by the SDK test suite.Public exports
CalibrationJob, Prompt, Skill, SkillRender, SkillSelection, SkillVersion, Tool
Classes
Prompt
class Prompt()
A prompt as the list/detail routes report it.
Prompts live in MLflow's registry, not CALIBER's database, so this carries a registry coordinate (`prompt_name, version, alias) rather than a CALIBER row id. template_preview` is truncated by the server; fetch the version to read the whole template.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
agent_id | str | '' | |
prompt_name | str | '' | |
version | `int | None` | None |
alias | `str | None` | None |
template_preview | `str | None` | None |
template_length | int | 0 | |
approval_id | `str | None` | None |
artifact_ref | `str | None` | None |
agent_name | `str | None` | None |
agent_enabled | `bool | None` | None |
has_prompt | `bool | None` | None |
source | `str | None` | None |
description | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Skill
class Skill()
A reusable instruction asset.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
skill_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
summary | `str | None` | None |
content | `str | None` | None |
owner | `str | None` | None |
category | `str | None` | None |
tags | list[str] | field(default_factory=list) | |
skill_metadata | dict[str, Any] | field(default_factory=dict) | |
allowed_tools | list[str] | field(default_factory=list) | |
depends_on | list[str] | field(default_factory=list) | |
status | str | '' | |
version | `int | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
SkillRender
class SkillRender()
A skill's content with variables substituted.
Dataclass fields
| Field | Type | Default |
|---|---|---|
skill_id | str | '' |
skill_name | str | '' |
rendered_content | str | '' |
original_content | str | '' |
detected_variables | list[str] | field(default_factory=list) |
unresolved_variables | list[str] | field(default_factory=list) |
variables_applied | dict[str, Any] | field(default_factory=dict) |
summary | str | '' |
word_count | int | 0 |
char_count | int | 0 |
extra | dict[str, Any] | field(default_factory=dict) |
SkillSelection
class SkillSelection()
Whether a skill would be auto-selected for a query, and why.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
skill_id | str | '' | |
skill_name | str | '' | |
is_selected | bool | False | |
selection_score | float | 0.0 | |
selection_reason | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
SkillVersion
class SkillVersion()
One immutable skill snapshot.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
skill_id | str | '' | |
version_number | int | 0 | |
content | `str | None` | None |
summary | `str | None` | None |
created_by | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Tool
class Tool()
A registered callable.
`input_schema and output_schema` stay open mappings: they are JSON Schema documents describing the caller's own function, and CALIBER stores them rather than defining them.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
tool_id | str | '' | |
name | str | '' | |
version | `str | None` | None |
description | `str | None` | None |
module_path | `str | None` | None |
callable_name | `str | None` | None |
input_schema | dict[str, Any] | field(default_factory=dict) | |
output_schema | dict[str, Any] | field(default_factory=dict) | |
side_effect_level | `str | None` | None |
requires_approval | bool | False | |
allow_in_preview | bool | True | |
secret_refs | list[str] | field(default_factory=list) | |
owner | `str | None` | None |
status | str | '' | |
deprecated_at | `str | None` | None |
successor_tool_id | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
CalibrationJob
class CalibrationJob()
One tool calibration job.
`result` is left open: it carries scorer output whose keys vary by suite, and the server is the authority on what a run measured.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
job_id | str | '' | |
tool_id | `str | None` | None |
status | str | '' | |
requested_by | `str | None` | None |
result | `dict[str, Any] | None` | None |
error | `str | None` | None |
created_at | `str | None` | None |
claimed_at | `str | None` | None |
claimed_by | `str | None` | None |
finished_at | `str | None` | None |
pass_rate | `float | None` | None |
retry_of_job_id | `str | None` | None |
resolution | `str | None` | None |
resolution_reason | `str | None` | None |
resolved_by | `str | None` | None |
resolved_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Whether the job has stopped, successfully or not.
This callable takes no public parameters.
Returns: bool
Module caliber_sdk.models.quality
Typed models for the quality surfaces: datasets, judges, evaluations.
Tested example
def build_and_score(caliber: CaliberClient, *, owner: str = "@you") -> dict[str, Any]:
"""Create a dataset, add a row, define a judge, and run an evaluation."""
dataset = caliber.datasets.create("intake-golden", owner=owner)
caliber.datasets.add_example(
dataset.dataset_id,
inputs={"ticket": "I was charged twice"},
expected={"intent": "billing"},
)
# Instructions must reference an evaluation variable. A judge with no
# variable grades nothing — it returns the same verdict every time — so
# the server rejects it rather than letting you collect meaningless scores.
judge = caliber.judges.create(
"valid-intent",
instructions="Given {{ inputs }} and {{ outputs }}, return true if intent is allowed.",
feedback_value_type="bool",
)
evaluation = caliber.evaluations.create(dataset.dataset_id, judge_id=judge.judge_id)
return {
"dataset_id": dataset.dataset_id,
"judge_id": judge.judge_id,
"evaluation_id": evaluation.evaluation_id,
}sdk/caliber-sdk/examples/evaluation.py — executed by the SDK test suite.Public exports
EvalDataset, EvalExample, Evaluation, Judge, JudgeAlignment
Classes
EvalDataset
class EvalDataset()
A versioned evaluation dataset.
The `mlflow_*` fields record the last sync to MLflow's dataset registry. They are reported rather than owned: the dataset lives here, and the sync is a separate, possibly stale, fact.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
dataset_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
owner | `str | None` | None |
tags | list[str] | field(default_factory=list) | |
status | str | '' | |
version | `int | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
mlflow_dataset_id | `str | None` | None |
mlflow_synced_at | `str | None` | None |
mlflow_synced_version | `int | None` | None |
mlflow_record_count | `int | None` | None |
mlflow_digest | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_synced() -> bool
Whether the dataset has ever been pushed to MLflow.
Not whether it is currently in sync — `mlflow_synced_version can lag version`, and conflating the two would let a caller trust stale evidence.
This callable takes no public parameters.
Returns: bool
EvalExample
class EvalExample()
One row of a dataset.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
example_id | str | '' | |
dataset_id | str | '' | |
inputs | Any | None | |
expected | Any | None | |
example_metadata | dict[str, Any] | field(default_factory=dict) | |
source_trace_id | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Judge
class Judge()
A model-backed grader.
`feedback_value_type` is what a scorecard reads: a bool judge and a numeric one are not interchangeable, and the field is how a caller knows which they have.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
judge_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
instructions | `str | None` | None |
model | `str | None` | None |
feedback_value_type | `str | None` | None |
owner | `str | None` | None |
tags | list[str] | field(default_factory=list) | |
status | str | '' | |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Evaluation
class Evaluation()
One scored run over a dataset.
`metrics and results` stay open: which scorers ran is a property of the evaluation, not of this type, and enumerating them here would go stale the first time a scorer is added.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
evaluation_id | str | '' | |
dataset_id | `str | None` | None |
name | `str | None` | None |
status | str | '' | |
target_type | `str | None` | None |
target_ref | `str | None` | None |
metrics | dict[str, Any] | field(default_factory=dict) | |
results | Any | None | |
created_by | `str | None` | None |
created_at | `str | None` | None |
completed_at | `str | None` | None |
error | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Operate on the evaluation surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
JudgeAlignment
class JudgeAlignment()
Agreement between a judge and human reviewers.
Cohen's kappa matters more than raw agreement: a judge that always says "pass" agrees with a mostly-passing sample while measuring nothing.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
judge_id | str | '' | |
agreement | `float | None` | None |
kappa | `float | None` | None |
sample_size | int | 0 | |
per_example | list[dict[str, Any]] | field(default_factory=list) | |
extra | dict[str, Any] | field(default_factory=dict) |
Module caliber_sdk.models.integrations
Typed models for the integration and data surfaces (beta tier).
Tested example
def install_ready_cookbook(caliber: CaliberClient) -> dict[str, Any]:
"""Install the first cookbook whose prerequisites are already satisfied.
Readiness is checked before installing rather than after failing: the
recipe's unmet checks name what is missing, and each one that can be fixed
carries the route that fixes it.
"""
recipes = caliber.cookbooks.list()
ready = [recipe for recipe in recipes if recipe.is_ready]
if not ready:
blocked = {
recipe.id: [check.get("label") for check in recipe.unmet_checks] for recipe in recipes
}
return {"installed": None, "blocked_by": blocked}
recipe = ready[0]
result = caliber.cookbooks.install(recipe.id, name=f"{recipe.title} (SDK)")
# Installed paused, never running: an example manifest can carry model,
# connector, or side-effect bindings an operator should review first.
workflow = result.get("workflow") if isinstance(result, dict) else None
return {
"installed": recipe.id,
"workflow_status": (workflow or {}).get("status"),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Public exports
Bucket, KnowledgeBase, McpServer, StoredObject
Classes
McpServer
class McpServer()
A managed MCP server definition.
`discovered_tools is what the server reported at last connection, not a contract: an MCP server can change its tool list, and a stale entry here means "we saw this once", which is why last_connected_at` sits beside it.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
server_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
transport | `str | None` | None |
uri | `str | None` | None |
command | `str | None` | None |
args | list[str] | field(default_factory=list) | |
env | dict[str, Any] | field(default_factory=dict) | |
headers | dict[str, Any] | field(default_factory=dict) | |
auth_type | `str | None` | None |
auth_config | dict[str, Any] | field(default_factory=dict) | |
tool_policies | dict[str, Any] | field(default_factory=dict) | |
icon | `str | None` | None |
owner | `str | None` | None |
status | str | '' | |
connection_error | `str | None` | None |
discovered_tools | list[dict[str, Any]] | field(default_factory=list) | |
last_connected_at | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_connected() -> bool
Whether the last connection attempt succeeded.
Not whether it is reachable now — that would require a probe, and :meth:McpServersAPI.test_connection is how you ask.
This callable takes no public parameters.
Returns: bool
KnowledgeBase
class KnowledgeBase()
A versioned RAG corpus.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
knowledge_base_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
owner | `str | None` | None |
status | str | '' | |
active_version_id | `str | None` | None |
embedding_model | `str | None` | None |
chunking_strategy | `str | None` | None |
document_count | `int | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Bucket
class Bucket()
One object-store bucket.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
name | str | '' | |
creation_date | `str | None` | None |
object_count | `int | None` | None |
size_bytes | `int | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
StoredObject
class StoredObject()
One object inside a bucket.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
key | str | '' | |
size | `int | None` | None |
last_modified | `str | None` | None |
etag | `str | None` | None |
content_type | `str | None` | None |
is_directory | bool | False |
Module caliber_sdk.models.operations
Typed models for the operational and agentic surfaces (beta tier).
Tested example
def plan_from_intent(caliber: CaliberClient, goal: str) -> dict[str, Any]:
"""State an intent, wait for Aria to plan it, and approve if it asks.
``wait_for_plan`` returns as soon as the plan pauses, because a paused plan
makes no further progress on its own — polling past it would burn the whole
timeout on the expected outcome.
"""
detail = caliber.aria.create_plan(goal)
settled = caliber.aria.wait_for_plan(detail.plan.plan_id, timeout=120)
if settled.plan.needs_you:
# The plan is waiting on a human decision. Approving is that decision,
# made explicitly rather than inferred from the script continuing.
caliber.aria.approve_plan(settled.plan.plan_id)
settled = caliber.aria.execute_plan(settled.plan.plan_id)
return {
"plan_id": settled.plan.plan_id,
"status": settled.plan.status,
"steps": len(settled.steps),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Public exports
AriaInteraction, AriaPlan, AriaPlanDetail, AriaPlanStep, AuditEntry, CookbookRecipe, Job, ReleaseCandidate, ReviewQueue, Trace
Classes
Job
class Job()
A durable background job (refinement, calibration, reporting).
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
job_id | str | '' | |
status | str | '' | |
kind | `str | None` | None |
agent_id | `str | None` | None |
optimizer | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
error | `str | None` | None |
result | `dict[str, Any] | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Operate on the job surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
awaits_human() -> bool
Whether the job stopped for a person rather than finishing.
A refinement job that reaches `candidate_ready` is not done — it is waiting for an operator to apply it. Treating that as terminal is how a script silently drops the human decision the loop exists for.
This callable takes no public parameters.
Returns: bool
ReviewQueue
class ReviewQueue()
A structured human-review queue.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
queue_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
owner | `str | None` | None |
status | str | '' | |
review_questions | list[dict[str, Any]] | field(default_factory=list) | |
item_count | `int | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
AriaPlan
class AriaPlan()
An Aria goal-plan: a sequence of steps awaiting approval or execution.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
plan_id | str | '' | |
session_id | `str | None` | None |
goal | str | '' | |
status | str | '' | |
autonomy | `str | None` | None |
owner | `str | None` | None |
step_count | int | 0 | |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
needs_you() -> bool
Paused awaiting a human decision — a gate, approval, or confirm.
The state the SPA badges, and the one a script must not poll past: a paused plan makes no further progress until someone answers.
This callable takes no public parameters.
Returns: bool
AriaPlanStep
class AriaPlanStep()
One step inside an Aria plan detail response.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
step_id | str | '' | |
plan_id | str | '' | |
title | str | '' | |
capability_key | `str | None` | None |
depends_on | list[str] | field(default_factory=list) | |
status | str | '' | |
result | dict[str, Any] | field(default_factory=dict) | |
evidence | dict[str, Any] | field(default_factory=dict) | |
error | `str | None` | None |
draft_id | `str | None` | None |
job_id | `str | None` | None |
approval_id | `str | None` | None |
checkpoint_id | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
AriaPlanDetail
class AriaPlanDetail()
A plan plus its steps.
Dataclass fields
| Field | Type | Default |
|---|---|---|
plan | AriaPlan | field(default_factory=AriaPlan) |
steps | list[AriaPlanStep] | field(default_factory=list) |
extra | dict[str, Any] | field(default_factory=dict) |
AriaInteraction
class AriaInteraction()
One pause/question inside an Aria plan.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
interaction_id | str | '' | |
plan_id | str | '' | |
step_id | str | '' | |
kind | str | '' | |
prompt | str | '' | |
options | list[dict[str, Any]] | field(default_factory=list) | |
evidence | dict[str, Any] | field(default_factory=dict) | |
required_scope | `str | None` | None |
status | str | '' | |
response | dict[str, Any] | field(default_factory=dict) | |
responded_by | `str | None` | None |
responded_at | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
ReleaseCandidate
class ReleaseCandidate()
A release candidate with weighted criteria and signoff.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
candidate_id | str | '' | |
name | str | '' | |
artifact_type | `str | None` | None |
artifact_ref | `str | None` | None |
version_ref | `str | None` | None |
status | str | '' | |
weighted_score | `float | None` | None |
criteria | list[dict[str, Any]] | field(default_factory=list) | |
created_by | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Trace
class Trace()
One MLflow trace as observability reports it.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
trace_id | str | '' | |
request_id | `str | None` | None |
status | `str | None` | None |
timestamp_ms | `int | None` | None |
execution_time_ms | `float | None` | None |
tags | dict[str, Any] | field(default_factory=dict) | |
extra | dict[str, Any] | field(default_factory=dict) |
AuditEntry
class AuditEntry()
One audit-log row.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
audit_id | str | '' | |
actor | str | '' | |
action | str | '' | |
entity_type | `str | None` | None |
entity_id | `str | None` | None |
details | dict[str, Any] | field(default_factory=dict) | |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
CookbookRecipe
class CookbookRecipe()
A built-in, installable example.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
id | str | '' | |
slug | str | '' | |
title | str | '' | |
summary | str | '' | |
icon | `str | None` | None |
capabilities | list[str] | field(default_factory=list) | |
prerequisites | list[str] | field(default_factory=list) | |
activation_requires_review | bool | True | |
steps | list[dict[str, Any]] | field(default_factory=list) | |
readiness | dict[str, Any] | field(default_factory=dict) | |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_ready() -> bool
Operate on the cookbook recipe surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
unmet_checks() -> list[dict[str, Any]]
Checks standing between this recipe and a clean install.
This callable takes no public parameters.
Returns: list[dict[str, Any]]
Module caliber_sdk.models.workflows
Typed models for workflows, versions, runs, deployments, and services.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
FAILED_RUN_STATES, TERMINAL_RUN_STATES, Workflow, WorkflowRun, WorkflowService, WorkflowVersion
Classes
Workflow
class Workflow()
The container. Versions hold the manifest; this holds identity and status.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
workflow_id | str | '' | |
project_id | `str | None` | None |
name | str | '' | |
description | `str | None` | None |
owner | `str | None` | None |
status | str | '' | |
default_experiment_id | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkflowVersion
class WorkflowVersion()
One immutable manifest snapshot.
`manifest and validation_report` stay open: the manifest is a structured-but-extensible document the server validates, and the report is produced by the validator rather than defined here.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
version_id | str | '' | |
workflow_id | str | '' | |
version_number | int | 0 | |
status | str | '' | |
manifest | dict[str, Any] | field(default_factory=dict) | |
manifest_hash | `str | None` | None |
compiler_version | `str | None` | None |
compiled_artifact_uri | `str | None` | None |
validation_report | `dict[str, Any] | None` | None |
compiled_bundle | Any | None | |
created_by | `str | None` | None |
created_at | `str | None` | None |
published_by | `str | None` | None |
published_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_draft() -> bool
Operate on the workflow version surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
WorkflowRun
class WorkflowRun()
One execution.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
workflow_run_id | str | '' | |
workflow_id | str | '' | |
project_id | `str | None` | None |
workflow_version_id | `str | None` | None |
deployment_alias | `str | None` | None |
mlflow_run_id | `str | None` | None |
trace_id | `str | None` | None |
session_id | `str | None` | None |
status | str | '' | |
source | `str | None` | None |
priority | `int | None` | None |
queued_at | `str | None` | None |
started_at | `str | None` | None |
completed_at | `str | None` | None |
claimed_by | `str | None` | None |
error | `str | None` | None |
output | Any | None | |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Operate on the workflow run surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
succeeded() -> bool
Operate on the workflow run surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
WorkflowService
class WorkflowService()
A workflow published as an externally invocable HTTP service.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
service_id | str | '' | |
workflow_id | str | '' | |
alias | `str | None` | None |
input_schema | dict[str, Any] | field(default_factory=dict) | |
output_schema | dict[str, Any] | field(default_factory=dict) | |
enabled | bool | False | |
auth_required | bool | True | |
rate_limit_per_minute | `int | None` | None |
cors_allowed_origins | list[str] | field(default_factory=list) | |
endpoint | `str | None` | None |
created_by | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
token_count | int | 0 | |
extra | dict[str, Any] | field(default_factory=dict) |
Module caliber_sdk.models.errors
Typed views over CALIBER's two error body shapes.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_api.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
ErrorBody, FieldError
Classes
FieldError
class FieldError()
One entry of a structured validation failure.
Dataclass fields
| Field | Type | Default |
|---|---|---|
loc | tuple[Any, ...] | () |
msg | str | '' |
type | str | '' |
Properties
field() -> str
Dotted path of the offending field, or `<body>` for whole-body errors.
This callable takes no public parameters.
Returns: str
Methods
from_payload(payload) -> FieldError
Operate on the field error surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | positional-or-keyword | Any | — |
Returns: FieldError
ErrorBody
class ErrorBody()
`{"detail", "status_code"}, plus errors` when present.
Dataclass fields
| Field | Type | Default |
|---|---|---|
detail | str | '' |
status_code | int | 0 |
errors | list[FieldError] | field(default_factory=list) |
Methods
from_payload(payload) -> ErrorBody
Operate on the error body surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | positional-or-keyword | Any | — |
Returns: ErrorBody
Async client
Module caliber_sdk.aio
Asynchronous client for the CALIBER management API.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
AsyncCaliberClient, AsyncTransport, wait_for, wait_for_terminal_state
Module caliber_sdk.aio.client
The async client, and an honest statement of what it covers.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
AsyncCaliberClient, AsyncCapabilitiesAPI, AsyncEventsAPI, AsyncJobsAPI, AsyncMeAPI, AsyncRawAPI, AsyncWorkflowRunsAPI
Classes
AsyncCaliberClient
class AsyncCaliberClient(base_url: str | None = None, *, token: str | None = None, user: str | None = None, proxy_secret: str | None = None, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, verify: bool | str = True, http_client: httpx.AsyncClient | None = None)
An asynchronous connection to one CALIBER deployment.
Constructed exactly like :class:caliber_sdk.CaliberClient, including the same environment fallbacks and the same credential precedence -- a token beats a trusted header, because the token is a real credential and the header is only an assertion.
Usage example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Constructor
__init__(base_url: str | None = None, *, token: str | None = None, user: str | None = None, proxy_secret: str | None = None, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, verify: bool | str = True, http_client: httpx.AsyncClient | None = None) -> None
Operate on the caliber client surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
base_url | positional-or-keyword | `str | None` | None |
token | keyword-only | `str | None` | None |
user | keyword-only | `str | None` | None |
proxy_secret | keyword-only | `str | None` | None |
auth | keyword-only | `AuthProvider | None` | None |
project | keyword-only | `str | None` | None |
timeout | keyword-only | float | 30.0 | |
max_retries | keyword-only | int | 2 | |
verify | keyword-only | `bool | str` | True |
http_client | keyword-only | `httpx.AsyncClient | None` | None |
Returns: None
Raises:
Attributes
| Attribute | Type | Notes |
|---|---|---|
raw | AsyncRawAPI | Low-level route access through the SDK transport. |
me | AsyncMeAPI | The caller identity surface. |
capabilities_api | AsyncCapabilitiesAPI | Runtime stability tiers and deployment capabilities. |
workflows | AsyncWorkflowRunsAPI | Workflow registry plus versions, runs, and services. |
jobs | AsyncJobsAPI | Long-running background jobs. |
events | AsyncEventsAPI | Server-sent event stream. |
Methods
aclose() -> None
Operate on the caliber client surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: None
__aenter__() -> AsyncCaliberClient
Return this instance so it can be used inside an async context manager.
This callable takes no public parameters.
Returns: AsyncCaliberClient
__aexit__(*_: object) -> None
Close any owned resources when leaving the async context manager.
| Parameter | Kind | Type | Default |
|---|---|---|---|
_ | var-positional | object | — |
Returns: None
AsyncRawAPI
class AsyncRawAPI()
Any endpoint, with the SDK's auth, retries, and typed errors.
The reason the typed coverage here can stay narrow without the client being limiting: nothing in CALIBER is unreachable from an async caller.
Methods
get(path: str, **kwargs) -> Any
Fetch one record from the low-level management API routes surface identified by path.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
post(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
put(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
patch(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
delete(path: str, **kwargs) -> Any
Delete a record on the low-level management API routes surface and return the server acknowledgement.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
download(path: str, **kwargs) -> bytes
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: bytes
Raises:
paginate(path: str, *, params: Mapping[str, Any] | None = None, limit: int = 100) -> AsyncIterator[Any]
Not a coroutine: an async generator, so it is iterated rather than awaited.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
limit | keyword-only | int | 100 |
Returns: AsyncIterator[Any]
Raises:
AsyncMeAPI
class AsyncMeAPI()
Typed access to the caller identity surface.
Methods
get() -> Identity
Reports identity rather than requiring it: a bad credential returns an anonymous identity, not an exception.
This callable takes no public parameters.
Returns: Identity
Raises:
AsyncCapabilitiesAPI
class AsyncCapabilitiesAPI()
Typed access to the runtime capabilities surface.
Methods
get() -> Capabilities
Fetch one record from the runtime capabilities surface identified by id.
This callable takes no public parameters.
Returns: Capabilities
Raises:
AsyncWorkflowRunsAPI
class AsyncWorkflowRunsAPI()
Submit runs and await them.
The surface async is for on the request side: forty concurrent `submit_and_wait` calls are forty coroutines rather than forty threads.
Related APIs: WorkflowsAPI, WorkflowVersionsAPI, WorkflowServicesAPI
Methods
submit(*, workflow_version_id: str | None = None, workflow_id: str | None = None, alias: str | None = None, input = None, idempotency_key: str | None = None, **options) -> WorkflowRun
Create a new execution run on the server and return its initial state.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
workflow_version_id | keyword-only | `str | None` | None |
workflow_id | keyword-only | `str | None` | None |
alias | keyword-only | `str | None` | None |
input | keyword-only | Any | None | |
idempotency_key | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: WorkflowRun
Raises:
get(run_id: str) -> WorkflowRun
Fetch one record from the workflow runs surface identified by run_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: WorkflowRun
Raises:
list(workflow_id: str, *, status: str | None = None) -> list[WorkflowRun]
Runs of one workflow.
Scoped because the server has no unscoped listing: `/workflow-runs` is POST-only. An earlier SDK method implying otherwise returned 405.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
workflow_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
Returns: list[WorkflowRun]
Raises:
cancel(run_id: str) -> WorkflowRun
Operate on the workflow runs surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: WorkflowRun
Raises:
wait(run_id: str, *, timeout: float = 900.0, raise_on_failure: bool = True, **options) -> WorkflowRun
Poll until the targeted run or job reaches a terminal state, then return the final record.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
raise_on_failure | keyword-only | bool | True |
options | var-keyword | Any | — |
Returns: WorkflowRun
Raises:
AsyncJobsAPI
class AsyncJobsAPI()
Background jobs, and waiting on ones that stop for a person.
Methods
get(job_id: str) -> Job
Fetch one record from the background jobs surface identified by job_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
Returns: Job
Raises:
list(*, status: str | None = None) -> list[Job]
Return the current collection of background jobs, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Job]
Raises:
wait(job_id: str, *, timeout: float = 900.0, **options) -> Job
Return when the job finishes or stops for a human.
`candidate_ready` is a resting state: applying the candidate is a person's decision, so the job will never advance on its own and polling past it would spend the whole timeout on the expected outcome.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: Job
Raises:
AsyncEventsAPI
class AsyncEventsAPI()
The reason this module exists.
Methods
stream(**params) -> AsyncIterator[str]
Yield raw server-sent-event lines as they arrive.
Unparsed on purpose: the event vocabulary grows with the server, and a decoder compiled into this SDK would reject events added after it shipped -- exactly when a consumer most needs to see them.
Returns an async iterator rather than a coroutine, so it is used with `async for` and never awaited.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: AsyncIterator[str]
Raises:
Module caliber_sdk.aio.transport
Asynchronous transport, sharing every decision with the synchronous one.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
AsyncTransport
Classes
AsyncTransport
class AsyncTransport(base_url: str, *, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, backoff_factor: float = 0.5, verify: bool | str = True, user_agent: str | None = None, http_client: httpx.AsyncClient | None = None)
Asynchronous HTTP transport against one CALIBER deployment.
Constructor
__init__(base_url: str, *, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, backoff_factor: float = 0.5, verify: bool | str = True, user_agent: str | None = None, http_client: httpx.AsyncClient | None = None) -> None
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
base_url | positional-or-keyword | str | — | |
auth | keyword-only | `AuthProvider | None` | None |
project | keyword-only | `str | None` | None |
timeout | keyword-only | float | 30.0 | |
max_retries | keyword-only | int | 2 | |
backoff_factor | keyword-only | float | 0.5 | |
verify | keyword-only | `bool | str` | True |
user_agent | keyword-only | `str | None` | None |
http_client | keyword-only | `httpx.AsyncClient | None` | None |
Returns: None
Raises:
Attributes
| Attribute | Type | Notes |
|---|---|---|
base_url | Any | — |
auth | Any | Session inspection plus token and account sub-resources. |
project | Any | — |
max_retries | Any | — |
backoff_factor | Any | — |
Methods
aclose() -> None
Close the underlying client, but only one we created.
A caller who passed their own client owns its lifetime; closing it here would break the next thing that used it.
This callable takes no public parameters.
Returns: None
__aenter__() -> AsyncTransport
Return this instance so it can be used inside an async context manager.
This callable takes no public parameters.
Returns: AsyncTransport
__aexit__(*_: object) -> None
Close any owned resources when leaving the async context manager.
| Parameter | Kind | Type | Default |
|---|---|---|---|
_ | var-positional | object | — |
Returns: None
url_for(path: str) -> str
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
Returns: str
bootstrap_csrf() -> str | None
Fetch a CSRF token up front so browser-style authenticated writes can reuse it.
This callable takes no public parameters.
Returns: str | None
request(method: str, path: str, *, params: Mapping[str, Any] | None = None, json = None, headers: Mapping[str, str] | None = None, files = None, data: Mapping[str, Any] | None = None, timeout: float | None = None, _csrf_retry: bool = True) -> Response
Perform one API call, returning the unwrapped payload.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
method | positional-or-keyword | str | — | |
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
json | keyword-only | Any | None | |
headers | keyword-only | `Mapping[str, str] | None` | None |
files | keyword-only | Any | None | |
data | keyword-only | `Mapping[str, Any] | None` | None |
timeout | keyword-only | `float | None` | None |
_csrf_retry | keyword-only | bool | True |
Returns: Response
Raises:
get(path: str, **kwargs) -> Response
Fetch one record from the transport surface identified by path.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
post(path: str, **kwargs) -> Response
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
put(path: str, **kwargs) -> Response
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
patch(path: str, **kwargs) -> Response
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
delete(path: str, **kwargs) -> Response
Delete a record on the transport surface and return the server acknowledgement.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
download(path: str, **kwargs) -> bytes
Fetch raw bytes: no envelope, no decoding.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: bytes
Raises:
stream_lines(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | None = None) -> AsyncIterator[str]
Yield lines from a server-sent-events endpoint.
The method this whole module exists for. No default timeout: a stream staying open is the success case, not a hang.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
timeout | keyword-only | `float | None` | None |
Returns: AsyncIterator[str]
Raises:
paginate(path: str, *, params: Mapping[str, Any] | None = None, limit: int = 100) -> AsyncIterator[Any]
Yield items across `limit/offset` pages.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
limit | keyword-only | int | 100 |
Returns: AsyncIterator[Any]
Raises:
Module caliber_sdk.aio.waiters
Async waiters, holding the same polling policy as the synchronous ones.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
DEFAULT_BACKOFF, DEFAULT_INTERVAL, DEFAULT_MAX_INTERVAL, DEFAULT_TIMEOUT, WaitFailed, WaitTimeout, wait_for, wait_for_terminal_state
Functions
wait_for(poll: Callable[[], Awaitable[T]], *, is_done: Callable[[T], bool], timeout: float = DEFAULT_TIMEOUT, interval: float = DEFAULT_INTERVAL, max_interval: float = DEFAULT_MAX_INTERVAL, backoff: float = DEFAULT_BACKOFF) -> T
Poll until `is_done` or the timeout expires.
A waiter never decides what "finished" means -- the caller supplies the predicate, because only they know whether a `failed` run is a successful outcome for their script.
| Parameter | Kind | Type | Default |
|---|---|---|---|
poll | positional-or-keyword | Callable[[], Awaitable[T]] | — |
is_done | keyword-only | Callable[[T], bool] | — |
timeout | keyword-only | float | DEFAULT_TIMEOUT |
interval | keyword-only | float | DEFAULT_INTERVAL |
max_interval | keyword-only | float | DEFAULT_MAX_INTERVAL |
backoff | keyword-only | float | DEFAULT_BACKOFF |
Returns: T
Raises:
ValueErrorWaitTimeout
wait_for_terminal_state(poll: Callable[[], Awaitable[Any]], *, terminal: frozenset[str] = TERMINAL_STATES, failure: frozenset[str] = FAILURE_STATES, raise_on_failure: bool = True, **options) -> Any
Poll until a payload reports a terminal status.
`raise_on_failure` defaults to True because a script that waited for work and got a failure almost always wants to stop there.
| Parameter | Kind | Type | Default |
|---|---|---|---|
poll | positional-or-keyword | Callable[[], Awaitable[Any]] | — |
terminal | keyword-only | frozenset[str] | TERMINAL_STATES |
failure | keyword-only | frozenset[str] | FAILURE_STATES |
raise_on_failure | keyword-only | bool | True |
options | var-keyword | Any | — |
Returns: Any
Raises: