models.go (package eai)
Source: sdks/go/models.go. Back to the Go SDK reference index.
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.
Model Money
Money is a decimal string amount with an ISO 4217 currency.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
Amount (amount) | string | yes | Exact decimal amount serialized as a string, for example 12.50. |
Currency (currency) | string | yes | ISO 4217 currency code, for example EUR. |
Model UsagePricing
UsagePricing is the price applicable at call time.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
PriceCardID (price_card_id) | *string | no | Price card used, omitted when nil. |
PricingVersion (pricing_version) | string | yes | Version of the pricing used. |
Currency (currency) | string | yes | ISO 4217 currency code, for example EUR. |
EffectiveAt (effective_at) | time.Time | yes | Time from which the price applies. |
ReasoningBilling (reasoning_billing) | string | no | How reasoning tokens are billed: included_in_output (default), separate, not_billed or not_exposed. |
AllocationPolicyID (allocation_policy_id) | *string | no | Cost allocation policy applied, omitted when nil. |
Model UsageCost
UsageCost holds estimated, measured and billed costs (each may be null).
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
Estimated (estimated) | *Money | no | Money is a decimal string amount with an ISO 4217 currency. |
Measured (measured) | *Money | no | Money is a decimal string amount with an ISO 4217 currency. |
Billed (billed) | *Money | no | Money is a decimal string amount with an ISO 4217 currency. |
Model UsageEvent
UsageEvent is the Usage Event v1 contract (contracts/v1/usage-event.schema.json).
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
SchemaVersion (schema_version) | string | yes | Contract version 1.<minor>; minor bumps stay backward compatible. |
EventID (event_id) | string | yes | Identifier of the event, used to deduplicate it (event_id). |
OccurredAt (occurred_at) | time.Time | yes | Time the usage happened. |
TenantID (tenant_id) | string | yes | Tenant of the agent. Default default. |
ProjectID (project_id) | *string | no | Identifier of the project, the workspace of a tenant that owns agents, knowledge bases, quotas and secrets. |
Environment (environment) | *string | no | Environment of the consumption, omitted when nil. |
AgentID (agent_id) | *string | no | Agent that consumed, nil when none. |
SessionID (session_id) | *string | no | Session of the consumption, nil when none. |
RunID (run_id) | *string | no | Run that consumed, omitted when nil. |
TaskID (task_id) | *string | no | Task of the consumption, nil when none. |
RequestID (request_id) | *string | no | Platform request identifier, omitted when nil. |
ProviderRequestID (provider_request_id) | *string | no | Request identifier given by the provider, omitted when nil. |
TraceID (trace_id) | *string | no | W3C trace id, 32 lowercase hexadecimal characters, to correlate the event with a trace. |
UsageType (usage_type) | string | yes | Kind of consumption, for example llm, reasoning, embeddings, tool or gpu_local. |
Provider (provider) | string | yes | Provider that served the call, never empty. |
ModelID (model_id) | string | yes | Model of the call, matched against the model patterns of the price cards. |
DeploymentID (deployment_id) | *string | no | Model deployment running on the GPU during the sample. |
Region (region) | string | yes | Processing region, for example eu-west-1 or on-prem-paris. |
Units (units) | map[string]float64 | yes | Consumed units by name, for example input_tokens, output_tokens, images; at least one. |
Pricing (pricing) | UsagePricing | yes | UsagePricing is the price applicable at call time. |
Cost (cost) | UsageCost | yes | UsageCost holds estimated, measured and billed costs (each may be null). |
Status (status) | string | no | Cost status: estimated, measured or reconciled. |
Source (source) | string | yes | Component that emitted the event: gateway, litellm, adapter, runtime, tool_gateway, connector_hub, sandbox, gpu_exporter or import. |
Labels (labels) | map[string]string | no | Labels of the host as a map of strings, replacing the current ones, for example {"zone": "a"}. |
Model AuditEvent
AuditEvent is the Audit Event v1 contract (contracts/v1/audit-event.schema.json).
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
SchemaVersion (schema_version) | string | yes | Contract version 1.<minor>; minor bumps stay backward compatible. |
EventID (event_id) | string | yes | Identifier of the audit event (event_id). |
Sequence (sequence) | int64 | yes | Ordered steps of the failover, as free objects. |
OccurredAt (occurred_at) | time.Time | yes | Time the audited action happened. |
TenantID (tenant_id) | string | yes | Tenant of the agent. Default default. |
Actor (actor) | json.RawMessage | yes | Raw JSON of the actor: kind (user, service, agent, system) and id. |
Action (action) | string | yes | Audited action as domain.verb, for example model.invoke or agent.suspend. |
Resource (resource) | json.RawMessage | yes | Raw JSON of the resource acted on: type, id and optional name. |
Decision (decision) | json.RawMessage | no | approve or reject. |
Outcome (outcome) | string | yes | Result of the action: success, failure or error. |
Evidence (evidence) | json.RawMessage | no | Evidence of the measures (logs, timestamps, screenshots references...). |
Classification (classification) | string | no | Data classification: public, internal, confidential, restricted or secret. |
PrevHash (prev_hash) | string | yes | SHA-256 hash (64 hex characters) of the previous event of the chain. |
Hash (hash) | string | yes | Digest of the source content, for example sha256:.... |
Model ExecutionContract
ExecutionContract is the Execution Contract v1 of a run (contracts/v1/execution-contract.schema.json).
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
SchemaVersion (schema_version) | string | yes | Contract version 1.<minor>; minor bumps stay backward compatible. |
RunID (run_id) | string | yes | Identifier of the run (run_id). |
TenantID (tenant_id) | string | yes | Tenant of the agent. Default default. |
ProjectID (project_id) | *string | no | Identifier of the project, the workspace of a tenant that owns agents, knowledge bases, quotas and secrets. |
SessionID (session_id) | *string | no | Session of the run, nil when absent. |
ParentRunID (parent_run_id) | *string | no | Run that started this one as a sub-agent, nil for a root run. |
Depth (depth) | *int | no | Depth of the run in the sub-agent tree, 0 or more; nil when absent. |
Agent (agent) | json.RawMessage | yes | Raw JSON of the agent: name and semantic version. |
Task (task) | json.RawMessage | no | Raw JSON of the task: task_id, objective and input. |
State (state) | string | yes | State of the run: pending, running, waiting_approval, waiting_input, suspended, succeeded, failed, cancelled or timed_out. |
Steps (steps) | []json.RawMessage | yes | Raw JSON of the steps, each with step_id, kind and state. |
Budgets (budgets) | json.RawMessage | yes | Raw JSON of the budgets: limits and what was consumed. |
Errors (errors) | []json.RawMessage | no | Raw JSON of the errors met by the run. |
RetryPolicy (retry_policy) | json.RawMessage | no | Retry policy: max_attempts (1 or more, default 3) and backoff_seconds (0 or more, default 2). |
Resume (resume) | json.RawMessage | no | Raw JSON of the resume settings: checkpoint_id and strategy. |
Trace (trace) | json.RawMessage | no | Raw JSON of the trace context: trace_id, span_id, parent_span_id. |
CreatedAt (created_at) | *time.Time | no | Creation time of the run, nil when absent. |
UpdatedAt (updated_at) | *time.Time | no | Last update time of the run, nil when absent. |
Model PolicyDecision
PolicyDecision is the decision part of the Policy Contract v1.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
Allow (allow) | bool | yes | true when the policy allows the request. |
DecisionID (decision_id) | string | yes | Identifier of the decision, to find it in the audit trail. |
PolicyID (policy_id) | string | no | Policy the candidate replaces; null to add it to the active set. |
PolicyVersion (policy_version) | string | no | Version of the policy that decided. |
Engine (engine) | string | no | Auto (default), HPA or KEDA. |
Reasons (reasons) | []string | yes | Reasons given for the decision. |
Obligations (obligations) | []json.RawMessage | no | Obligations added to the decision when this allow rule applies. |
EvaluatedAt (evaluated_at) | *time.Time | no | Evaluation time, nil when absent. |
Model PolicyContract
PolicyContract is the Policy Contract v1 (request plus optional decision).
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
SchemaVersion (schema_version) | string | yes | Contract version 1.<minor>; minor bumps stay backward compatible. |
Request (request) | json.RawMessage | yes | Raw JSON of the request: subject, resource, action and context. |
Decision (decision) | *PolicyDecision | no | approve or reject. |
Model Metadata
Metadata is the manifest metadata (common.schema.json#/$defs/metadata).
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
Name (name) | string | yes | Stable DNS-like name of the asset. |
Tenant (tenant) | string | no | Tenant slug. |
Project (project) | string | no | Identifier of the project the results are restricted to. |
Environment (environment) | string | no | Target environment: dev, test, staging or prod. |
Version (version) | string | yes | Semantic version of the asset. |
Owner (owner) | string | yes | Accountable owner, team id or e-mail. |
Description (description) | string | no | Free description, up to 4000 characters. |
Labels (labels) | map[string]string | no | Labels of the host as a map of strings, replacing the current ones, for example {"zone": "a"}. |
Annotations (annotations) | map[string]string | no | Annotations of the alert; summary and description feed the incident. |
Model Manifest
Manifest is any v1 manifest (Agent, Model, Tool, Skill, Plugin, Connector, Channel).
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
APIVersion (apiVersion) | string | yes | API version of the manifest, enterprise-ai.io/v1 (the APIVersion constant). |
Kind (kind) | string | yes | Kind of the manifest (Agent, Model, Tool...); ContractForKind gives its contract. |
Metadata (metadata) | Metadata | yes | Free key-value pairs stored with the object and returned as they are; the platform never interprets them. |
Spec (spec) | json.RawMessage | yes | Specification: sites (value per site) and health_check with its url, both required. |
Type alias ModelManifest
ModelManifest is a Model Manifest v1.
Definition: = Manifest.
Type alias ToolManifest
ToolManifest is a Tool Manifest v1.
Definition: = Manifest.
Model ChatMessage
ChatMessage is an OpenAI compatible message.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
Role (role) | string | yes | Role of the author, for example system, user or assistant. |
Content (content) | any | yes | Content of the message: a string or OpenAI compatible content parts. |
Name (name) | string | no | Optional name of the author of the message. |
Model EaiExtension
EaiExtension is the eai body field of gateway calls.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
Effort (effort) | Effort | no | Effort is the normalized reasoning effort (common.schema.json#/$defs/effort), translated per model by the Capability Resolver. |
AgentID (agent_id) | string | no | Agent making the call (agent_id). |
SessionID (session_id) | string | no | Session the call belongs to (session_id). |
RunID (run_id) | string | no | Run the call belongs to (run_id). |
TaskID (task_id) | string | no | Task the call belongs to (task_id). |
DataClassification (data_classification) | string | no | Classification of the data sent (data_classification), for example confidential. |
Purpose (purpose) | string | no | Use of the target. Default backup. |
RegionAllow (region_allow) | []string | no | Processing regions the call may use (region_allow). |
FallbackPolicy (fallback_policy) | string | no | Fallback policy the gateway applies when the model is unavailable (fallback_policy). |
Model ChatRequest
ChatRequest is the body of POST /v1/gateway/chat/completions.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
Model (model) | string | yes | Model alias of the gateway that answers the request. |
Messages (messages) | []ChatMessage | yes | Conversation sent to the model, in order. |
Temperature (temperature) | *float64 | no | Sampling temperature, omitted when nil. |
MaxTokens (max_tokens) | *int | no | Maximum output tokens; when set, it is the output assumed for the worst case. |
Tools (tools) | []map[string]any | no | Tools its external agents may invoke (names or patterns such as crm.*). |
Stream (stream) | bool | no | Stream the answer as Server-Sent Events; ChatCompletions forces it to false, ChatCompletionsStream to true. |
Eai (eai) | *EaiExtension | no | EaiExtension is the eai body field of gateway calls. |
Model ChatResponse
ChatResponse is a chat completion with the gateway headers.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
Raw | json.RawMessage | yes | Raw JSON body of the answer. |
Model | string | yes | Model that produced the answer. |
Content | string | yes | Text of choices[0].message.content. |
FinishReason | string | yes | finish_reason of the first choice. |
Usage | map[string]any | yes | Usage counters added to the budget consumption, for example input_tokens, output_tokens. |
DecisionID | string | yes | Policy decision identifier, from the X-EAI-Decision-Id response header. |
CostEstimated | string | yes | Value of the X-EAI-Cost-Estimated response header. |
CostMeasured | string | yes | Value of the X-EAI-Cost-Measured response header. |
Model ChatChunk
ChatChunk is one streamed chunk.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
Raw | json.RawMessage | yes | Raw JSON data of the Server-Sent Event. |
Delta | string | yes | Text of choices[0].delta.content in this chunk. |
FinishReason | string | yes | finish_reason of the first choice, empty until the last chunk. |
Usage | map[string]any | yes | Usage counters added to the budget consumption, for example input_tokens, output_tokens. |