AiGateway and AiGatewayClass Reference

This reference covers all fields of the AiGateway and AiGatewayClass custom resources in the runtime.agentic-layer.ai API group.

AiGateway

AiGateway declares a desired AI model gateway instance. A gateway implementation operator (selected via AiGatewayClass) reconciles the resource and creates the underlying workload.

spec

Field Description

aiGatewayClassName

string — Optional. Name of the AiGatewayClass that selects the implementation operator for this gateway. Only required when multiple AI gateway classes are registered in the cluster. If omitted, the sole installed implementation is used.

port

integer (1–65535) — Optional. Port on which the AI gateway will be exposed. Default: 80.

aiModels

[]AiModel — Required. Minimum one entry. List of AI models to be made available through the gateway. See spec.aiModels fields below.

env

[]corev1.EnvVar — Optional. Environment variables injected into the AI gateway container. Can carry configuration values, credentials, or feature flags.

envFrom

[]corev1.EnvFromSource — Optional. Sources (ConfigMaps, Secrets) from which environment variables are loaded into the AI gateway container.

guardrails

[]corev1.ObjectReference — Optional. Guard resources applied to requests through this gateway. Guards are evaluated in the order they are listed.

commonMetadata

EmbeddedMetadata — Optional. Labels and annotations applied to the Deployment and Service created for this gateway, as well as the pod template. See commonMetadata / podMetadata fields below.

podMetadata

EmbeddedMetadata — Optional. Labels and annotations applied only to the pod template of the Deployment. See commonMetadata / podMetadata fields below.

spec.aiModels

Each entry in spec.aiModels configures one model that the gateway makes available to callers.

Field Description

aiModels[].name

string — Required. Identifier for the AI model (e.g. gpt-4, claude-3-opus). Minimum length: 1.

aiModels[].provider

string — Required. AI provider that hosts this model (e.g. openai, anthropic, azure, gemini). Minimum length: 1.

spec.commonMetadata / spec.podMetadata fields

Both commonMetadata and podMetadata share the same EmbeddedMetadata structure.

Field Description

labels

map[string]string — Key/value pairs applied as Kubernetes labels to the target resources.

annotations

map[string]string — Key/value pairs applied as Kubernetes annotations to the target resources.

status

Field Description

conditions

[]metav1.Condition — Latest observations of the gateway’s state. Inspect type, status, reason, and message fields for troubleshooting.

AiGatewayClass

AiGatewayClass is a cluster-scoped resource that registers a named implementation controller for AiGateway. Each AiGateway that sets spec.aiGatewayClassName to the name of an AiGatewayClass will be reconciled by the controller identified in that class.

spec

Field Description

controller

string — Required. The fully-qualified name of the controller that reconciles AiGateway resources claiming this class. Follows the format <domain>/<name> (e.g. agentic-layer.ai/litellm). An implementation operator watches for AiGatewayClass resources whose spec.controller value matches the operator’s own controller name.

status

Field Description

conditions

[]metav1.Condition — Latest observations of the gateway class’s state. Inspect type, status, reason, and message fields for troubleshooting.