Skip to main content

types.ts

Source: sdks/typescript/packages/sdk/src/types.ts. Back to the TypeScript SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Type alias Classification​

Data classification level: public, internal, confidential, restricted or secret.

Definition: "public" \| "internal" \| "confidential" \| "restricted" \| "secret".

Type alias Effort​

Reasoning effort level: none, low, medium, high or max.

Definition: "none" \| "low" \| "medium" \| "high" \| "max".

Type alias EFFORTS​

Reasoning effort levels in increasing order: none, low, medium, high, max.

Definition: readonly Effort[].

Type alias Modality​

Modality: text, vision, image, audio, video, embedding, code or document.

Definition: "text" \| "vision" \| "image" \| "audio" \| "video" \| "embedding" \| "code" \| "document".

Type alias RiskLevel​

Risk level: minimal, limited, high or unacceptable.

Definition: "minimal" \| "limited" \| "high" \| "unacceptable".

Type alias AssetStatus​

Lifecycle status of an asset: draft, approved, restricted, deprecated or blocked.

Definition: "draft" \| "approved" \| "restricted" \| "deprecated" \| "blocked".

Type alias Environment​

Deployment environment: dev, test, staging or prod.

Definition: "dev" \| "test" \| "staging" \| "prod".

Type alias RunState​

State of a run, such as pending, running, waiting_approval, succeeded, failed or timed_out.

Definition: \| "pending" \| "running" \| "waiting_approval" \| "waiting_input" \| "suspended" \| "succeeded" \| "failed" \| "cancelled" \| "timed_out".

Type alias Labels​

Key-value labels (Record<string, string>).

Definition: Record<string, string>.

Interface Money​

Amount of money: exact decimal amount and ISO 4217 currency.

Fields:

NameTypeRequiredDescription
amountstringyesExact decimal amount serialized as a string.
currencystringyesISO 4217 currency code.

Interface Metadata​

Metadata of a manifest: name, tenant, project, environment, version, owner and labels.

Fields:

NameTypeRequiredDescription
namestringyesName of the asset.
tenantstringnoTenant slug.
projectstringnoIdentifier of the project the results are restricted to.
environmentEnvironmentnoEnvironment of the asset (Environment).
versionstringyesVersion of the asset.
ownerstringyesOwner of the asset.
descriptionstringnoDescription of the asset.
labelsLabelsnoLabels of the host as a map of strings, replacing the current ones, for example {"zone": "a"}.
annotationsLabelsnoAnnotations of the alert; summary and description feed the incident.

Interface Budget​

Consumption limits: cost, tokens, requests, tool calls and duration, over a period.

Fields:

NameTypeRequiredDescription
max_costMoneynoMaximum cost (Money).
max_input_tokensnumbernoMaximum number of input tokens.
max_output_tokensnumbernoMaximum number of output tokens.
max_reasoning_tokensnumbernoMaximum number of reasoning tokens.
max_requestsnumbernoMaximum number of requests.
max_tool_callsnumbernoMaximum number of tool calls.
max_duration_secondsnumbernoMaximum duration in seconds.
period"request" | "run" | "hour" | "day" | "month"noPeriod the limits apply to: request, run, hour, day or month.

Interface ResourceLimits​

Resource limits: CPU, memory, GPU, timeout and maximum number of steps.

Fields:

NameTypeRequiredDescription
cpustringnoCPU limit.
memorystringnoMemory limit.
gpunumbernoNumber of GPUs.
timeout_secondsnumbernoTimeout in seconds.
max_stepsnumbernoMaximum number of steps.

Interface Signature​

Signature of an artifact: digest, cosign bundle, signer and date.

Fields:

NameTypeRequiredDescription
digeststringyesSHA-256 of the evidence (commands, recording), at most 100 characters.
cosign_bundlestringnoCosign bundle of the signature.
signerstringnoName of the publisher key that signed (1 to 200 characters).
issued_atstringnoDate and time of the signature (ISO 8601).

Interface Actor​

Who performed an action: user, service, agent or system, with its tenant and authentication method.

Fields:

NameTypeRequiredDescription
kind"user" | "service" | "agent" | "system"yesKind of actor: user, service, agent or system.
idstringyesIdentifier of the actor.
tenant_idstring | nullnoTenant of the agent. Default default.
displaystringnoDisplay name of the actor.
auth_method"oidc" | "password" | "api_key" | "spiffe" | "dev" | "internal"noHow the actor authenticated: oidc, password, api_key, spiffe, dev or internal.
spiffe_idstringnoSPIFFE ID of the workload, spiffe://<trust domain>/<path>, unique on the platform.
ipstringnoIP address of the host. Empty: the source address of the request is used.

Interface Trace​

Trace context: trace, span and parent span identifiers.

Fields:

NameTypeRequiredDescription
trace_idstringnoW3C trace id, 32 lowercase hexadecimal characters, to correlate the event with a trace.
span_idstringnoIdentifier of the span.
parent_span_idstringnoIdentifier of the parent span.

Interface Provenance​

Where the content of a memory item comes from.

Fields:

NameTypeRequiredDescription
source_type"user_input" | "system" | "tool" | "rag" | "memory" | "connector" | "model" | "file" | "media"yesKind of source, for example rag, conversation or tool.
source_idstringyesIdentifier of the source object.
uristringnoURI of the source.
versionstringnoVersion of the source.
retrieved_atstringnoDate and time the source was retrieved (ISO 8601).
classificationClassificationnoClassification of the source.
hashstringnoDigest of the source content, for example sha256:....

Interface ContractError​

Error recorded in a contract: code, message, retryable flag, step and time.

Fields:

NameTypeRequiredDescription
codestringyesCode of the control, 1 to 64 characters: a catalogue code such as EAI-GOV-01, or a custom one. Unique in the tenant.
messagestringyesStatus message (up to 2000 characters).
retryablebooleannoWhether the operation can be retried.
step_idstringnoIdentifier of the step that failed.
atstringnoDate and time the price is taken at, ISO 8601; default now.

Interface AgentSpec​

Specification of an agent: runtime, models, tools, permissions, autonomy and budgets.

Fields:

NameTypeRequiredDescription
descriptionstringyesDescription of the agent.
purposestringnoUse of the target. Default backup.
risk_levelRiskLevelnoRisk level of the agent (RiskLevel).
identity{ spiffe_id?: string; service_account?: string }noWorkload identity of the agent: SPIFFE ID and service account.
runtime{ engine: "langgraph" | "temporal" | "custom"; entrypoint?: string; image?: string; sandbox?: "none" | "gvisor" | "kata" | "wasm"; limits?: ResourceLimits; }yesExecution engine (langgraph, temporal, custom), entry point, image, sandbox and resource limits.
modelsArray<{ model_id: string; role: "primary" | "fallback" | "summarizer" | "embedding" | "judge" | "vision" | "speech"; effort?: Effort; max_output_tokens?: number; }>yesModels used by the agent, each with its role (primary, fallback, judge...), effort and output token limit.
toolsArray<{ ref: string; scopes?: string[]; requires_approval?: boolean }>noTools its external agents may invoke (names or patterns such as crm.*).
mcp_serversArray<{ ref: string; tools?: string[] }>noMCP servers its external agents may call (names or patterns).
skillsstring[]noReferences of the skills of the agent.
connectorsArray<{ ref: string; scopes?: string[] }>noConnectors used by the agent, each with its reference and scopes.
knowledge_basesstring[]noReferences of the knowledge bases the agent can query.
channelsstring[]noReferences of the channels that expose the agent.
memory{ session?: boolean; persistent?: boolean; ttl_days?: number }noMemory of the agent: session memory, persistent memory and retention in days (ttl_days).
permissions{ data_classification_max: Classification; allowed_regions?: string[]; scopes?: string[] }yesPermissions the token is limited to, for example ["cluster:read", "operations:read"]; each must be held by you. Null (default): every permission you hold.
autonomy{ level: "assisted" | "supervised" | "autonomous"; max_steps?: number; max_subagents?: number; max_depth?: number; human_approval_for?: string[]; }yesAutonomy of the agent: level (assisted, supervised, autonomous), step, subagent and depth limits, actions that need a human approval.
subagentsstring[]noReferences of the agents this agent can delegate to.
budgetsBudgetnoSpending and consumption limits of the agent (Budget).
schedulesArray<{ cron: string; timezone?: string; input?: Record<string, unknown> }>noScheduled runs of the agent: cron expression, time zone and input.
triggersArray<{ subject: string; filter?: string }>noEvent subjects that start the agent, with an optional filter.
evaluation{ suites?: string[]; block_on_failure?: boolean }noEvaluation suites of the agent and whether a failure blocks it (block_on_failure).
observability{ trace_sampling?: number; log_prompts?: "none" | "hashed" | "redacted" | "full" }noTrace sampling rate and prompt logging mode (none, hashed, redacted, full).

Type alias AgentManifest​

Manifest of kind Agent: apiVersion enterprise-ai.io/v1, metadata and a spec of type AgentSpec.

Definition: ManifestBase<"Agent", AgentSpec>.

Interface RangeParam​

Range of a model parameter: supported flag, minimum, maximum and default.

Fields:

NameTypeRequiredDescription
supportedbooleanyesWhether the model supports the parameter.
minnumbernoMinimum value.
maxnumbernoMaximum value.
defaultnumbernoValue used when none is given.

Type alias ModelCapability​

Capability of a model, such as chat, tools, streaming, embeddings or reasoning.

Definition: \| "chat" \| "completion" \| "tools" \| "parallel_tools" \| "json_mode" \| "json_schema" \| "streaming" \| "embeddings" \| "rerank" \| "vision_input" \| "image_generation" \| "image_edit" \| "audio_input" \| "audio_output" \| "stt" \| "tts" \| "video_input" \| "video_generation" \| "realtime" \| "batch" \| "prompt_caching" \| "reasoning" \| "fine_tuning" \| "code".

Interface ModelSpec​

Specification of a model: provider, modalities, capabilities, limits, reasoning, data residency and status.

Fields:

NameTypeRequiredDescription
model_idstringyesModel of the call, matched against the model patterns of the price cards.
provider| "openai" | "anthropic" | "google_ai_studio" | "vertex_ai" | "azure_openai" | "azure_ai_foundry"yesProvider of the model, such as openai, anthropic, mistral, ollama or vllm.
provider_model_idstringyesIdentifier of the model at the provider.
deployment_idstringyesModel deployment running on the GPU during the sample.
modalities{ input: Modality[]; output: Modality[] }yesInput and output modalities (Modality).
capabilitiesModelCapability[]yesCapabilities of the target, for example verified object_lock and retention for immutable backups.
context_windownumberyesSize of the context window in tokens.
max_output_tokensnumberyesMaximum number of output tokens.
reasoning_modesEffort[]yesSupported reasoning effort levels (Effort).
reasoning{ native_parameter?: "none" | "reasoning_effort" | "thinking_budget_tokens" | "thinking_budget" | "always_on"; mapping?: Partial<Record<Effort, unknown>>; budget_tokens?: Partial<Record<Effort, number>>; default_effort?: Effort; unsupported_effort_policy?: "reject" | "nearest_lower" | "nearest_supported" | "compatible_profile"; compatible_profile?: string; reasoning_tokens_billing?: "included_in_output" | "separate" | "not_billed" | "not_exposed"; }noReasoning support: native parameter, mapping and token budget per effort, default effort and billing of reasoning tokens.
parameters{ temperature?: RangeParam; top_p?: RangeParam; response_formats?: Array<"text" | "json_object" | "json_schema">; tool_choice?: Array<"auto" | "none" | "required" | "named">; max_images_per_request?: number; image_detail?: Array<"low" | "high" | "auto">; unsupported_parameter_policy?: "reject" | "drop_with_warning"; }noParameters of the operation.
supports_cachingbooleanyesWhether the model supports prompt caching.
supports_batchbooleanyesWhether the model supports batch processing.
supports_streamingbooleanyesWhether the model supports streaming.
data_residency{ regions: string[]; jurisdiction?: string; on_premises?: boolean }yesData residency: regions, jurisdiction and on-premises flag.
data_classification_maxClassificationyesHighest data classification the model may receive.
pricing_versionstringyesVersion of the price card applied to the model.
quality_profileRecord<stringyesQuality profile of the model.
status"approved" | "restricted" | "deprecated" | "blocked"yesStatus: approved, restricted, deprecated or blocked.
adapterstringnoAdapter used to call the model.
litellm{ model?: string; api_base?: string; api_key_ref?: string; api_version?: string; extra?: Record<string, unknown> }noLiteLLM settings: model, API base, API key reference, API version and extra settings.
retention{ provider_retention_days?: number; zero_data_retention?: boolean; used_for_training?: boolean }noData retention.
fallbacksstring[]noModels used in fallback.
tagsstring[]noTags of the model.

Type alias ModelManifest​

Manifest of kind Model with a spec of type ModelSpec.

Definition: ManifestBase<"Model", ModelSpec>.

Interface ToolSpec​

Specification of a tool: action, input and output schemas, endpoint, scopes, classification and risk.

Fields:

NameTypeRequiredDescription
descriptionstringyesDescription of the tool.
action"read" | "write" | "delete" | "execute" | "communicate" | "payment"yesKind of action: read, write, delete, execute, communicate or payment.
input_schemaRecord<stringyesJSON Schema of the input.
output_schemaRecord<stringnoJSON Schema of the output.
endpoint{ type: "http" | "grpc" | "mcp" | "python" | "sandbox" | "builtin"; url?: string; method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; mcp_server?: string; handler?: string; timeout_seconds?: number; }yesEndpoint of the tool: type (http, grpc, mcp, python, sandbox, builtin), URL, method, MCP server, handler and timeout.
scopes_requiredstring[]yesScopes required to call the tool.
data_classificationClassificationyesClassification of the data handled by the tool.
side_effectsbooleannoWhether the tool has side effects.
idempotentbooleannoWhether repeating a call gives the same result.
requires_approvalbooleannoWhether a call needs a human approval.
risk_levelRiskLevelnoRisk level of the tool (RiskLevel).
rate_limit{ requests_per_minute?: number }noRate limit in requests per minute.
sandbox_profile"none" | "gvisor" | "kata" | "wasm"noSandbox of the tool: none, gvisor, kata or wasm.
credential_refstringnoReference of the credential in the secret store; the credential itself is never sent.
cost{ unit?: "call" | "second"; price?: Money }noCost of the tool: unit (call or second) and price (Money).

Type alias ToolManifest​

Manifest of kind Tool with a spec of type ToolSpec.

Definition: ManifestBase<"Tool", ToolSpec>.

Interface SkillSpec​

Specification of a skill: instructions, entry point, dependencies, permissions and artifact.

Fields:

NameTypeRequiredDescription
descriptionstringyesDescription of the skill.
instructionsstringyesInstructions of the skill.
entrypointstringnoEntry point of the skill.
dependenciesArray<{ ref: string; version?: string; optional?: boolean }>noDependencies of the skill: reference, version and optional flag.
permissions{ scopes?: string[]; data_classification_max: Classification; network?: boolean; filesystem?: "none" | "read" | "write"; }yesPermissions the token is limited to, for example ["cluster:read", "operations:read"]; each must be held by you. Null (default): every permission you hold.
artifact{ oci_ref?: string; git_ref?: string; digest?: string }noArtifact of the skill: OCI reference, Git reference and digest.
signatureSignaturenoSignature of the archive digest by a trusted publisher.
compatible_runtimesstring[]noRuntimes the skill is compatible with.

Type alias SkillManifest​

Manifest of kind Skill with a spec of type SkillSpec.

Definition: ManifestBase<"Skill", SkillSpec>.

Interface PluginSpec​

Specification of a plugin: signed OCI artifact, capabilities, sandbox and permissions.

Fields:

NameTypeRequiredDescription
descriptionstringyesDescription of the plugin.
artifact{ oci_ref: string; digest: string; media_type?: string }yesOCI artifact of the plugin: reference, digest and media type.
signatureSignatureyesSignature of the archive digest by a trusted publisher.
capabilitiesArray<{ type: "tool" | "connector" | "channel" | "model_adapter" | "evaluator" | "ui_extension" | "policy"; name: string; }>yesCapabilities of the target, for example verified object_lock and retention for immutable backups.
sandbox{ runtime: "gvisor" | "kata" | "wasm" | "none"; network: "deny_all" | "egress_allowlist" | "cluster_only"; egress_allowlist?: string[]; read_only_rootfs?: boolean; limits?: ResourceLimits; }yesSandbox of the plugin: runtime, network policy, egress allowlist, read-only root filesystem and limits.
permissions{ scopes?: string[]; data_classification_max?: Classification }noPermissions the token is limited to, for example ["cluster:read", "operations:read"]; each must be held by you. Null (default): every permission you hold.
min_platform_versionstringnoMinimum platform version required.

Type alias PluginManifest​

Manifest of kind Plugin with a spec of type PluginSpec.

Definition: ManifestBase<"Plugin", PluginSpec>.

Interface ConnectorSpec​

Specification of a connector to an external system: authentication, resources, synchronization and webhooks.

Fields:

NameTypeRequiredDescription
descriptionstringnoDescription of the connector.
systemstringyesExternal system the connector reaches.
base_urlstringnoBase URL of the external system.
auth{ type: "oauth2" | "api_key" | "service_account" | "basic" | "mtls" | "none"; authorization_url?: string; token_url?: string; oauth_scopes?: string[]; credential_ref?: string; delegation?: "service" | "on_behalf_of_user"; }yesAuthentication with the system: type (oauth2, api_key, mtls...), OAuth URLs and scopes, credential reference and delegation.
scopesstring[]noScopes requested; must include openid. Default openid, profile, email.
resourcesArray<{ name: string; operations: Array<"read" | "write" | "delete" | "subscribe">; classification?: Classification; }>yesResources exposed by the connector, with their operations and classification.
sync{ mode?: "none" | "pull" | "push" | "cdc"; schedule?: string; incremental?: boolean }noSynchronization: mode (none, pull, push, cdc), schedule and incremental sync.
webhooks{ enabled?: boolean; signature?: "hmac_sha256" | "none"; secret_ref?: string }noInbound webhooks: enabled, signature (hmac_sha256 or none) and secret reference.
rate_limit{ requests_per_minute?: number }noRate limit in requests per minute.
data_residencystringnoData residency of the connected system.

Type alias ConnectorManifest​

Manifest of kind Connector with a spec of type ConnectorSpec.

Definition: ManifestBase<"Connector", ConnectorSpec>.

Interface ChannelSpec​

Specification of a channel: type, agent, authentication, transport, limits, sessions and DLP.

Fields:

NameTypeRequiredDescription
type"web" | "mobile" | "email" | "slack" | "teams" | "whatsapp" | "sms" | "voice" | "api"yesType of channel: web, mobile, email, slack, teams, whatsapp, sms, voice or api.
agent_refstringnoAgent that answers on the channel, as <kind>:<name>, for example agent:support.
auth{ type: "oidc" | "api_key" | "signed_webhook" | "anonymous"; secret_ref?: string }yesAuthentication of the channel (oidc, api_key, signed_webhook, anonymous) and its secret reference.
transport{ protocol: "https" | "websocket" | "webrtc" | "smtp" | "sip"; endpoint?: string }yesstdio, streamable_http or sse; default: stdio with a command, else streamable_http.
limits{ max_message_bytes?: number; rate_per_minute?: number; max_session_minutes?: number; max_concurrent_sessions?: number; }yesLimits of the channel: message size, rate per minute, session duration and concurrent sessions.
sessions{ ttl_minutes?: number; persistence?: "none" | "session" | "persistent" }noSession lifetime in minutes and persistence (none, session, persistent).
dlp{ inbound?: "off" | "detect" | "mask" | "block"; outbound?: "off" | "detect" | "mask" | "block" }noDLP mode per direction, each off, detect, mask or block. Default {inbound: detect, outbound: mask}.

Type alias ChannelManifest​

Manifest of kind Channel with a spec of type ChannelSpec.

Definition: ManifestBase<"Channel", ChannelSpec>.

Type alias Manifest​

Any v1 manifest: Agent, Model, Tool, Skill, Plugin, Connector or Channel.

Definition: \| AgentManifest \| ModelManifest \| ToolManifest \| SkillManifest \| PluginManifest \| ConnectorManifest \| ChannelManifest.

Type alias ManifestKind​

kind of a manifest: Agent, Model, Tool, Skill, Plugin, Connector or Channel.

Definition: Manifest["kind"].

Interface ExecutionStep​

Step of a run: kind, state, timing, tokens, cost and error.

Fields:

NameTypeRequiredDescription
step_idstringyesIdentifier of the step.
kind"plan" | "act" | "verify" | "recover" | "model_call" | "tool_call" | "subagent" | "approval" | "checkpoint"yesKind of step: plan, act, verify, recover, model_call, tool_call, subagent, approval or checkpoint.
namestringnoName of the step.
state"pending" | "running" | "succeeded" | "failed" | "skipped" | "cancelled"yesState of the step: pending, running, succeeded, failed, skipped or cancelled.
started_atstringnoStart date and time (ISO 8601).
ended_atstringnoEnd date and time (ISO 8601).
attemptnumbernoAttempt number, from 1 (default 1). Compared with retry_policy.max_attempts.
input_refstringnoReference of the step input (stored elsewhere, not the content).
output_refstringnoReference of the step output.
tokensnumbernoNumber of tokens consumed by the step.
costMoneynoCost of the step (Money).
errorContractErrornoError of the step (ContractError).

Interface ExecutionContract​

Execution contract (execution-contract) of an agent run: state, steps, budgets, errors and resume.

Fields:

NameTypeRequiredDescription
schema_versionstringyesVersion of the contract schema followed by the document.
run_idstringyesIdentifier of the run.
tenant_idstringyesTenant of the agent. Default default.
project_idstring | nullnoIdentifier of the project, the workspace of a tenant that owns agents, knowledge bases, quotas and secrets.
session_idstring | nullnoIdentifier of the session.
parent_run_idstring | nullnoIdentifier of the parent run, for a subagent run.
depthnumbernoDepth of the run in the delegation tree.
agent{ name: string; version: string }yesName and version of the agent.
task{ task_id?: string; objective?: string; input?: unknown }noTask of the run: identifier, objective and input.
stateRunStateyesState of the run (RunState).
stepsExecutionStep[]yesSteps of the run (ExecutionStep).
budgets{ limits: Budget; consumed?: { cost?: Money; input_tokens?: number; output_tokens?: number; reasoning_tokens?: number; requests?: number; tool_calls?: number; duration_seconds?: number; }; }yesBudget limits of the run and what was consumed.
errorsContractError[]noErrors of the run (ContractError).
retry_policy{ max_attempts?: number; backoff_seconds?: number }noRetry policy: max_attempts (1 or more, default 3) and backoff_seconds (0 or more, default 2).
resume{ checkpoint_id?: string | null; strategy?: "from_last_checkpoint" | "restart_step" | "restart_run" }noResume point: checkpoint and strategy (from_last_checkpoint, restart_step, restart_run).
traceTracenoTrace context of the run (Trace).
created_atstringnoCreation date and time (ISO 8601).
updated_atstringnoDate and time of the last update (ISO 8601).

Type alias ContextSegmentType​

Type of a context segment: system, prompt, history, tool_result, rag_document, memory, image, audio, video or file.

Definition: \| "system" \| "prompt" \| "history" \| "tool_result" \| "rag_document" \| "memory" \| "image" \| "audio" \| "video" \| "file".

Interface ContextSegment​

Segment of a context: type, tokens, classification, provenance and compression.

Fields:

NameTypeRequiredDescription
segment_idstringyesIdentifier of the segment.
typeContextSegmentTypeyesType of the segment (ContextSegmentType).
role"system" | "user" | "assistant" | "tool"noRole of the segment: system, user, assistant or tool.
prioritynumbernoPriority of the segment: the higher ones are kept first when the budget is short.
tokensnumberyesNumber of tokens of the segment.
original_tokensnumbernoNumber of tokens before compression.
classificationClassificationyesData classification, from public to secret.
provenanceProvenancenoSigned in-toto Statement v1 with a SLSA v1 predicate: {statement, signature: {value, signer}}.
includedbooleanyesWhether the segment is included in the context sent to the model.
compression"none" | "truncated" | "summarized" | "selected" | "deduplicated" | "dropped"noCompression applied: none, truncated, summarized, selected, deduplicated or dropped.
cacheablebooleannoWhether the segment can be served from the prompt cache.

Interface ContextContract​

Context contract (context-contract): token budget and segments of the context sent to a model.

Fields:

NameTypeRequiredDescription
schema_versionstringyesVersion of the contract schema followed by the document.
context_idstringyesIdentifier of the context.
tenant_idstringyesTenant of the agent. Default default.
model_idstringyesModel of the call, matched against the model patterns of the price cards.
budget{ window: number; output_reserved: number; reasoning_reserved: number; safety_margin: number; context_budget: number; used: number; estimator?: string; }yesToken budget: window, reserves for output and reasoning, safety margin, context budget and tokens used.
segmentsContextSegment[]yesSegments of the context (ContextSegment).
classification_maxClassificationyesHighest classification of the segments of the context.
compression_actionsstring[]noCompression actions applied to fit the budget.
cache{ prefix_tokens?: number; cache_key?: string }noPrompt cache: prefix tokens and cache key.
created_atstringnoCreation date and time (ISO 8601).

Interface MemoryContract​

Memory contract (memory-contract): an agent memory entry with its scope, classification, access list and retention.

Fields:

NameTypeRequiredDescription
schema_versionstringyesVersion of the contract schema followed by the document.
memory_idstringyesExisting item to update (new version). Omit it to create an item.
tenant_idstringyesTenant of the agent. Default default.
scope{ type: "session" | "agent" | "user" | "project" | "tenant"; id: string }yesWhat is backed up (clusters, services, data sets), as an object.
kind"episodic" | "semantic" | "procedural" | "preference" | "fact"yesKind of memory: episodic, semantic, procedural, preference or fact.
contentstringnoContent of the memory entry.
content_refstringnoReference to content stored elsewhere (not searchable).
embedding_refstringnoReference of the embedding of the entry.
classificationClassificationyesData classification, from public to secret.
acl{ readers: string[]; writers: string[]; owners?: string[] }yesAccess list: readers, writers and owners.
ttl_secondsnumber | nullnoLifetime in seconds. Once it has elapsed, the item expires and is no longer accepted.
expires_atstring | nullnoDate and time (ISO 8601, UTC) after which the item is no longer valid.
write{ written_by?: Actor; source?: Provenance; written_at?: string }noWrite information: author (Actor), source (Provenance) and date.
deletion{ deletable?: boolean; legal_hold?: boolean; deleted_at?: string | null }noDeletion: deletable flag, legal hold and deletion date.
versionnumbernoVersion number of the entry.

Type alias UsageType​

Type of usage, such as llm, reasoning, embeddings, tool, connector, gpu_local or sandbox.

Definition: \| "llm" \| "reasoning" \| "prompt_cache" \| "vision" \| "image_generation" \| "video_generation" \| "stt" \| "tts" \| "voice_live" \| "embeddings" \| "reranking" \| "tool" \| "connector" \| "gpu_local" \| "rag" \| "sandbox".

Interface UsageUnits​

Units consumed: tokens, media, requests, compute, storage and transfer.

Fields:

NameTypeRequiredDescription
input_tokensnumbernoInput tokens.
output_tokensnumbernoOutput tokens.
reasoning_tokensnumbernoExplicit reasoning tokens, at least 0; overrides the reserve of reasoning_effort.
cached_input_tokensnumbernoInput tokens served from the cache.
cache_write_tokensnumbernoTokens written to the prompt cache.
cache_read_tokensnumbernoTokens read from the prompt cache.
imagesnumbernoNumber of images.
image_sizestringnoSize of the generated images.
image_qualitystringnoQuality of the generated images.
video_secondsnumbernoSeconds of video.
video_resolutionstringnoResolution of the video.
video_fpsnumbernoFrames per second of the video.
video_modestringnoVideo generation mode.
audio_secondsnumbernoSeconds of audio.
audio_tokensnumbernoAudio tokens.
charactersnumbernoCharacters processed.
sessionsnumbernoNumber of sessions.
requestsnumbernoNumber of requests.
documentsnumbernoDocuments processed.
tool_callsnumbernoNumber of tool calls.
duration_msnumbernoDuration in milliseconds.
bytes_transferrednumbernoBytes transferred.
sync_jobsnumbernoSynchronization jobs.
gpu_secondsnumbernoGPU seconds.
gpu_memory_gb_secondsnumbernoGPU memory in gigabyte-seconds.
energy_whnumbernoEnergy in watt-hours.
cpu_secondsnumbernoCPU seconds.
memory_gb_secondsnumbernoMemory in gigabyte-seconds.
storage_gb_hoursnumbernoStorage in gigabyte-hours.
embedding_tokensnumbernoEmbedding tokens.
retrieval_queriesnumbernoRetrieval queries.

Interface UsageEvent​

Usage event (usage-event): units consumed by a call, its pricing and its estimated, measured and billed costs.

Fields:

NameTypeRequiredDescription
schema_versionstringyesVersion of the contract schema followed by the document.
event_idstringyesIdentifier of the event.
occurred_atstringyesTime the usage happened, ISO 8601.
tenant_idstringyesTenant of the agent. Default default.
project_idstring | nullnoIdentifier of the project, the workspace of a tenant that owns agents, knowledge bases, quotas and secrets.
environmentstring | nullnoEnvironment of the call.
agent_idstring | nullyesIdentifier of the agent, or null.
session_idstring | nullyesIdentifier of the session, or null.
run_idstring | nullnoIdentifier of the run.
task_idstring | nullyesIdentifier of the task, or null.
request_idstring | nullnoIdentifier of the request.
provider_request_idstring | nullnoIdentifier of the request at the provider.
trace_idstring | nullnoW3C trace id, 32 lowercase hexadecimal characters, to correlate the event with a trace.
usage_typeUsageTypeyesType of usage (UsageType).
providerstringyesProvider of the service consumed.
model_idstring | nullyesModel of the call, matched against the model patterns of the price cards.
deployment_idstring | nullnoModel deployment running on the GPU during the sample.
regionstringyesRegion where the call was processed.
unitsUsageUnitsyesUnits consumed (UsageUnits).
pricing{ price_card_id?: string | null; pricing_version: string; currency: string; effective_at: string; reasoning_billing?: "included_in_output" | "separate" | "not_billed" | "not_exposed"; allocation_policy_id?: string | null; }yesPricing applied: price card, pricing version, currency, effective date, reasoning billing and allocation policy.
cost{ estimated: Money | null; measured: Money | null; billed: Money | null }yesEstimated, measured and billed costs (Money or null).
status"estimated" | "measured" | "reconciled"noStatus of the cost: estimated, measured or reconciled.
source| "gateway" | "litellm" | "adapter" | "runtime" | "tool_gateway" | "connector_hub" | "sandbox" | "gpu_exporter" | "import"yesComponent that emitted the event, such as gateway, litellm, runtime, tool_gateway or import.
labelsLabelsnoLabels of the host as a map of strings, replacing the current ones, for example {"zone": "a"}.

Interface AuditEvent​

Audit event (audit-event contract): who did what on which resource, the policy decision and the outcome, chained by hash.

Fields:

NameTypeRequiredDescription
schema_versionstringyesVersion of the contract schema followed by the document.
event_idstringyesIdentifier of the event.
sequencenumbernoOrdered steps of the failover, as free objects.
occurred_atstringyesTime the audited action happened, ISO 8601.
tenant_idstringyesTenant of the agent. Default default.
actorActoryesAuthor of the action (Actor).
actionstringyesAction performed.
resource{ type: string; id: string; name?: string }yesResource acted upon: type, identifier and name.
decision{ result: "allow" | "deny" | "not_applicable"; policy_id?: string; decision_id?: string; reasons?: string[] }yesapprove or reject.
outcome"success" | "failure" | "error"yesOutcome of the action: success, failure or error.
evidence{ request_hash?: string; response_hash?: string; trace_id?: string; details?: Record<string, unknown>; artifacts?: Array<{ uri: string; digest: string }>; }noEvidence of the measures (logs, timestamps, screenshots references...).
classificationClassificationnoData classification, from public to secret.
prev_hashstringnoHash of the previous event of the chain.
hashstringnoDigest of the source content, for example sha256:....

Interface EvaluationContract​

Evaluation contract (evaluation-contract): target, engine, dataset, metrics with thresholds and results.

Fields:

NameTypeRequiredDescription
schema_versionstringyesVersion of the contract schema followed by the document.
evaluation_idstringyesIdentifier of the evaluation.
tenant_idstringyesTenant of the agent. Default default.
namestringnoName of the evaluation.
target{ type: "model" | "agent" | "prompt" | "rag_pipeline" | "skill" | "tool"; ref: string; version?: string }yesEvaluated target: type (model, agent, prompt, rag_pipeline, skill, tool), reference and version.
engine"ragas" | "promptfoo" | "garak" | "custom"yesAuto (default), HPA or KEDA.
kind"quality" | "regression" | "red_team" | "safety" | "cost" | "latency"noKind of evaluation: quality, regression, red_team, safety, cost or latency.
dataset{ ref: string; version?: string; size?: number; digest?: string; classification?: Classification }yesDataset reference of the cases.
metricsArray<{ name: string; threshold: number; comparator: "gte" | "lte"; weight?: number }>yesMetrics and thresholds, at least one.
resultsArray<{ metric: string; value: number; passed: boolean; samples?: number }>noResult of each metric: value, passed flag and number of samples.
status"pending" | "running" | "passed" | "failed" | "error"noStatus: pending, running, passed, failed or error.
gate{ blocking?: boolean }noGate: whether a failure blocks the target (blocking).
started_atstringnoStart date and time (ISO 8601).
finished_atstringnoEnd date and time (ISO 8601).
costMoneynoCost of the evaluation (Money).

Interface PolicyRequest​

Authorization request: subject, resource, action and context.

Fields:

NameTypeRequiredDescription
subject{ id: string; kind: "user" | "service" | "agent" | "system"; tenant_id: string | null; roles?: string[]; scopes?: string[]; groups?: string[]; clearance?: Classification; attributes?: Record<string, unknown>; }yesSubject making the request: identifier, kind, tenant, roles, scopes, groups, clearance and attributes.
resource{ type: string; id?: string; tenant_id?: string | null; attributes?: Record<string, unknown> }yesResource targeted: type, identifier, tenant and attributes.
actionstringyesAction requested.
context{ data_classification?: Classification; region?: string; purpose?: string; environment?: string; channel?: string; cost_estimate?: Money; time?: string; ip?: string; attributes?: Record<string, unknown>; }yesContext of the request: data classification, region, purpose, environment, channel, cost estimate, time and IP.

Interface PolicyDecision​

Decision of a policy: allowed or not, reasons and obligations.

Fields:

NameTypeRequiredDescription
allowbooleanyesWhether the action is allowed.
decision_idstringyesIdentifier of the decision.
policy_idstringnoPolicy the candidate replaces; null to add it to the active set.
policy_versionstringnoVersion of the policy applied.
engine"builtin" | "opa" | "openfga"noAuto (default), HPA or KEDA.
reasonsstring[]yesReasons of the decision.
obligationsArray<{ type: string; params?: Record<string, unknown> }>noObligations added to the decision when this allow rule applies.
evaluated_atstringnoDate and time of the evaluation (ISO 8601).

Interface PolicyContract​

Policy contract (policy-contract): an authorization request and its decision.

Fields:

NameTypeRequiredDescription
schema_versionstringyesVersion of the contract schema followed by the document.
requestPolicyRequestyesAuthorization request (PolicyRequest).
decisionPolicyDecisionnoapprove or reject.

Interface MultimodalContract​

Multimodal contract (multimodal-contract): a media item, the operation applied, its storage, classification and costs.

Fields:

NameTypeRequiredDescription
schema_versionstringyesVersion of the contract schema followed by the document.
media_idstringyesIdentifier of the media.
tenant_idstringyesTenant of the agent. Default default.
media_type"image" | "audio" | "video" | "document"yesType of media: image, audio, video or document.
operation| "vision_understanding" | "image_generation" | "image_edit" | "video_processing" | "video_generation" | "stt"yesOperation applied, such as vision_understanding, image_generation, stt, tts or ocr.
mime_typestringyesMedia type of the content, for example application/pdf or image/png.
size_bytesnumbernoSize of the media in bytes.
duration_secondsnumber | nullnoDuration of the media in seconds.
resolution{ width?: number; height?: number } | nullnoWidth and height of the media.
fpsnumber | nullnoFrames extracted per second (more than 0, at most 60, default 1).
sample_ratenumber | nullnoSample rate of the extracted audio, in Hz. Default 16000.
pagesnumber | nullnoNumber of pages of a document.
storage{ uri: string; encryption: "sse-kms" | "openbao-transit" | "sse-s3" | "none"; retention_days?: number; digest?: string; }yesStorage of the media: URI, encryption, retention in days and digest.
classificationClassificationyesData classification, from public to secret.
dlp{ scanned?: boolean; extracted_text_chars?: number; findings?: number; action?: "allow" | "mask" | "tokenize" | "block" }noDLP mode per direction, each off, detect, mask or block. Default {inbound: detect, outbound: mask}.
model_idstring | nullnoModel of the call, matched against the model patterns of the price cards.
costs{ estimated?: Money | null; measured?: Money | null }noEstimated and measured costs (Money).
provenanceProvenancenoSigned in-toto Statement v1 with a SLSA v1 predicate: {statement, signature: {value, signer}}.
created_atstringnoCreation date and time (ISO 8601).

Interface ContractTypes​

Maps each contract name of contracts/index.json to its TypeScript model.

Fields:

NameTypeRequiredDescription
agent-manifestAgentManifestyesModel of the agent-manifest contract: AgentManifest.
model-manifestModelManifestyesModel of the model-manifest contract: ModelManifest.
tool-manifestToolManifestyesModel of the tool-manifest contract: ToolManifest.
skill-manifestSkillManifestyesModel of the skill-manifest contract: SkillManifest.
plugin-manifestPluginManifestyesModel of the plugin-manifest contract: PluginManifest.
connector-manifestConnectorManifestyesModel of the connector-manifest contract: ConnectorManifest.
channel-manifestChannelManifestyesModel of the channel-manifest contract: ChannelManifest.
execution-contractExecutionContractyesModel of the execution-contract contract: ExecutionContract.
context-contractContextContractyesModel of the context-contract contract: ContextContract.
memory-contractMemoryContractyesModel of the memory-contract contract: MemoryContract.
usage-eventUsageEventyesModel of the usage-event contract: UsageEvent.
audit-eventAuditEventyesModel of the audit-event contract: AuditEvent.
evaluation-contractEvaluationContractyesModel of the evaluation-contract contract: EvaluationContract.
policy-contractPolicyContractyesModel of the policy-contract contract: PolicyContract.
multimodal-contractMultimodalContractyesModel of the multimodal-contract contract: MultimodalContract.

Type alias ContractName​

Name of a v1 contract, a key of ContractTypes.

Definition: keyof ContractTypes.

Interface EaiExtension​

Platform extension eai added to the OpenAI-compatible gateway bodies: effort, agent, session, run, task, data classification, purpose, allowed regions and fallback policy.

Fields:

NameTypeRequiredDescription
effortEffortnoReasoning effort requested (Effort).
agent_idstringnoIdentifier of the agent making the call.
session_idstringnoIdentifier of the session.
run_idstringnoIdentifier of the run.
task_idstringnoIdentifier of the task.
data_classificationClassificationnoClassification of the data sent in the request.
purposestringnoUse of the target. Default backup.
region_allowstring[]noRegions where the request may be processed.
fallback_policystringnoFallback policy applied when the model is not available.

Type alias ChatContentPart​

Part of a message content: text, image URL or input audio.

Definition: \| { type: "text"; text: string } \| { type: "image_url"; image_url: { url: string; detail?: "low" \| "high" \| "auto" } } \| { type: "input_audio"; input_audio: { data: string; format: string } }.

Interface ChatMessage​

Message of a conversation: role, content, name and tool calls.

Fields:

NameTypeRequiredDescription
role"system" | "user" | "assistant" | "tool" | "developer"yesRole of the author: system, user, assistant, tool or developer.
contentstring | ChatContentPart[] | nullyesContent of the message: text, a list of ChatContentPart or null.
namestringnoName of the author of the message.
tool_call_idstringnoIdentifier of the tool call this tool message answers.
tool_callsToolCall[]noTool calls requested by the assistant (ToolCall).

Interface ToolCall​

Tool call requested by a model: identifier, type function, name and arguments.

Fields:

NameTypeRequiredDescription
idstringyesIdentifier of the call.
type"function"yesType of the call, always function.
function{ name: string; arguments: string }yesFunction called: name and arguments as a JSON string.

Interface ChatCompletionRequest​

OpenAI-compatible chat completion request, with the eai extension.

Fields:

NameTypeRequiredDescription
modelstringyesModel or route alias of the gateway.
messagesChatMessage[]yesMessages of the conversation (ChatMessage).
streambooleannoWhen true, the answer is streamed as ChatCompletionChunk fragments.
temperaturenumbernoSampling temperature.
top_pnumbernoNucleus sampling probability mass.
max_tokensnumbernoMaximum output tokens; when set, it is the output assumed for the worst case.
max_completion_tokensnumbernoMaximum number of tokens of the completion, reasoning included.
toolsArray<{ type: "function"; function: { name: string; description?: string; parameters?: Record<string, unknown> } }>noTools its external agents may invoke (names or patterns such as crm.*).
tool_choice"auto" | "none" | "required" | { type: "function"; function: { name: string } }noTool selection: auto, none, required or a named function.
response_format{ type: "text" | "json_object" | "json_schema"; json_schema?: Record<string, unknown> }noExpected format of the answer: text, json_object or json_schema with its schema.
stopstring | string[]noOne or more sequences that stop the generation.
userstringnoIdentifier of the end user, sent with the request.
eaiEaiExtensionnoeai extension of the platform: effort, agent, session, run, task, data classification and routing hints.

Interface CompletionUsage​

Token usage of a completion.

Fields:

NameTypeRequiredDescription
prompt_tokensnumberyesNumber of tokens of the prompt.
completion_tokensnumberyesNumber of tokens generated.
total_tokensnumberyesTotal number of tokens (prompt and completion).
completion_tokens_details{ reasoning_tokens?: number }noDetail of the generated tokens: reasoning tokens.
prompt_tokens_details{ cached_tokens?: number }noDetail of the prompt tokens: tokens read from the cache.

Interface ChatCompletion​

OpenAI-compatible chat completion answer of the gateway.

Fields:

NameTypeRequiredDescription
idstringyesIdentifier of the completion.
object"chat.completion"yesObject checked, <type>:<id>, for example project:42.
creatednumberyesCreation time as a Unix timestamp in seconds.
modelstringyesModel that produced the answer.
choicesArray<{ index: number; message: ChatMessage; finish_reason: string | null }>yesGenerated choices: index, message and finish reason.
usageCompletionUsagenoUsage counters added to the budget consumption, for example input_tokens, output_tokens.
eaiRecord<stringnoPlatform data added by the gateway under eai.

Interface ChatCompletionChunk​

Streamed fragment (chat.completion.chunk) of a chat completion.

Fields:

NameTypeRequiredDescription
idstringyesIdentifier of the completion the fragment belongs to.
object"chat.completion.chunk"yesObject checked, <type>:<id>, for example project:42.
creatednumberyesCreation time as a Unix timestamp in seconds.
modelstringyesModel that produced the chunk.
choicesArray<{ index: number; delta: { role?: string; content?: string | null; tool_calls?: Array<Partial<ToolCall> & { index: number }> }; finish_reason: string | null; }>yesPartial choices: index, delta (role, content, tool calls) and finish reason.
usageCompletionUsage | nullnoUsage counters added to the budget consumption, for example input_tokens, output_tokens.

Interface EmbeddingRequest​

Embedding request of the gateway, with the eai extension.

Fields:

NameTypeRequiredDescription
modelstringyesEmbedding model alias of the gateway.
inputstring | string[]yesValue that was refused.
dimensionsnumbernoNumber of dimensions of the vectors.
encoding_format"float" | "base64"noEncoding of the vectors: float or base64.
eaiEaiExtensionnoeai extension of the platform: effort, agent, session, run, task, data classification and routing hints.

Interface EmbeddingResponse​

Embedding answer: one vector per input, model and token usage.

Fields:

NameTypeRequiredDescription
object"list"yesObject checked, <type>:<id>, for example project:42.
dataArray<{ object: "embedding"; index: number; embedding: number[] }>yesOne embedding per input, in the order of the inputs (index).
modelstringyesModel that computed the embeddings.
usage{ prompt_tokens: number; total_tokens: number }noUsage counters added to the budget consumption, for example input_tokens, output_tokens.

Interface RerankRequest​

Reranking request: query, documents and number of results, with the eai extension.

Fields:

NameTypeRequiredDescription
modelstringyesReranking model alias of the gateway.
querystringyesQuery the documents are ranked against.
documentsArray<string | Record<stringyesDocuments to rank, as strings or objects.
top_nnumbernoNumber of results to return.
eaiEaiExtensionnoeai extension of the platform: effort, agent, session, run, task, data classification and routing hints.

Interface RerankResponse​

Reranking answer: results and model.

Fields:

NameTypeRequiredDescription
resultsArray<{ index: number; relevance_score: number; document?: unknown }>yesRanked results: index of the document, relevance score and document.
modelstringnoModel that ranked the documents.

Interface CostEstimate​

Envelope returned by /v1/gateway/estimate and /v1/finops/estimate.

Fields:

NameTypeRequiredDescription
estimatedMoney | nullyesEstimated cost (Money), or null when it cannot be estimated.

Type alias Json​

Any JSON value.

Definition: string \| number \| boolean \| null \| Json[] \| { [key: string]: Json }.

Type alias Doc​

Generic JSON object (Record<string, unknown>).

Definition: Record<string, unknown>.