> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.agentmachines.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.agentmachines.io/_mcp/server.

# Create a service

POST https://api.agentmachines.app/apis/serving.agentmachines.app/v1/namespaces/{namespace}/services
Content-Type: application/json

Creates a service from an Agent Machines service manifest.

Reference: https://docs.agentmachines.io/api-reference/agent-machines-admin-api/services/create-service

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: agentmachines-v3-wasm-openapi
  version: 1.0.0
paths:
  /apis/serving.agentmachines.app/v1/namespaces/{namespace}/services:
    post:
      operationId: create-service
      summary: Create a service
      description: Creates a service from an Agent Machines service manifest.
      tags:
        - subpackage_services
      parameters:
        - name: namespace
          in: path
          description: Project, organization, or tenant namespace that owns the service.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: The created service.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentMachinesService'
        '400':
          description: The request is malformed or fails validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The caller does not have permission to access the resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentMachinesService'
servers:
  - url: https://api.agentmachines.app
    description: Agent Machines control plane
components:
  schemas:
    AgentMachinesServiceApiVersion:
      type: string
      enum:
        - serving.agentmachines.app/v1
      description: Agent Machines service API version.
      title: AgentMachinesServiceApiVersion
    AgentMachinesServiceKind:
      type: string
      enum:
        - Service
      description: Resource kind.
      title: AgentMachinesServiceKind
    ServiceLabels:
      type: object
      properties:
        api.agentmachines.app/location:
          type: string
          description: Region or placement location for the service.
      description: Labels attached to a service.
      title: ServiceLabels
    ServiceAnnotationsApiAgentmachinesAppLaunchStage:
      type: string
      enum:
        - ALPHA
        - BETA
        - GA
      description: Launch stage for preview or generally available features.
      title: ServiceAnnotationsApiAgentmachinesAppLaunchStage
    ServiceAnnotationsApiAgentmachinesAppIngress:
      type: string
      enum:
        - all
        - internal
        - internal-and-load-balancing
      description: Ingress policy.
      title: ServiceAnnotationsApiAgentmachinesAppIngress
    ServiceAnnotationsApiAgentmachinesAppInvokerIamDisabled:
      type: string
      enum:
        - 'true'
        - 'false'
      description: Whether invoker IAM checks are disabled.
      title: ServiceAnnotationsApiAgentmachinesAppInvokerIamDisabled
    ServiceAnnotationsApiAgentmachinesAppIapEnabled:
      type: string
      enum:
        - 'true'
        - 'false'
      description: Whether identity-aware proxy is enabled.
      title: ServiceAnnotationsApiAgentmachinesAppIapEnabled
    ServiceAnnotationsApiAgentmachinesAppScalingMode:
      type: string
      enum:
        - automatic
        - manual
      description: Scaling mode for the service.
      title: ServiceAnnotationsApiAgentmachinesAppScalingMode
    ServiceAnnotations:
      type: object
      properties:
        api.agentmachines.app/custom-audiences:
          type: string
          description: JSON array string of accepted audiences.
        api.agentmachines.app/launch-stage:
          $ref: >-
            #/components/schemas/ServiceAnnotationsApiAgentmachinesAppLaunchStage
          description: Launch stage for preview or generally available features.
        api.agentmachines.app/description:
          type: string
          description: Human-readable service description.
        api.agentmachines.app/ingress:
          $ref: '#/components/schemas/ServiceAnnotationsApiAgentmachinesAppIngress'
          description: Ingress policy.
        api.agentmachines.app/binary-authorization:
          type: string
          description: Binary authorization policy name.
        api.agentmachines.app/binary-authorization-breakglass:
          type: string
          description: Justification for bypassing binary authorization.
        api.agentmachines.app/minScale:
          type: string
          description: Minimum service-level instance count.
        api.agentmachines.app/maxScale:
          type: string
          description: Maximum service-level instance count.
        api.agentmachines.app/function-target:
          type: string
          description: Function entry point for function-style services.
        api.agentmachines.app/invoker-iam-disabled:
          $ref: >-
            #/components/schemas/ServiceAnnotationsApiAgentmachinesAppInvokerIamDisabled
          description: Whether invoker IAM checks are disabled.
        api.agentmachines.app/iap-enabled:
          $ref: '#/components/schemas/ServiceAnnotationsApiAgentmachinesAppIapEnabled'
          description: Whether identity-aware proxy is enabled.
        api.agentmachines.app/scalingMode:
          $ref: >-
            #/components/schemas/ServiceAnnotationsApiAgentmachinesAppScalingMode
          description: Scaling mode for the service.
        api.agentmachines.app/manualInstanceCount:
          type: string
          description: Number of instances when manual scaling is enabled.
      description: Service-level Agent Machines annotations.
      title: ServiceAnnotations
    ObjectMeta:
      type: object
      properties:
        name:
          type: string
          description: Resource name.
        namespace:
          type: string
          description: Namespace, project, or tenant that owns the resource.
        labels:
          $ref: '#/components/schemas/ServiceLabels'
        annotations:
          $ref: '#/components/schemas/ServiceAnnotations'
        generateName:
          type: string
          description: Optional prefix used by the server when generating a name.
        uid:
          type: string
        resourceVersion:
          type: string
        generation:
          type: integer
          format: int64
        creationTimestamp:
          type: string
          format: date-time
        deletionTimestamp:
          type: string
          format: date-time
        finalizers:
          type: array
          items:
            type: string
      required:
        - name
        - namespace
      description: Metadata common to persisted Agent Machines resources.
      title: ObjectMeta
    RevisionAnnotationsApiAgentmachinesAppCpuThrottling:
      type: string
      enum:
        - 'true'
        - 'false'
      description: Whether CPU is throttled outside request handling.
      title: RevisionAnnotationsApiAgentmachinesAppCpuThrottling
    RevisionAnnotationsApiAgentmachinesAppStartupCpuBoost:
      type: string
      enum:
        - 'true'
        - 'false'
      description: Whether startup CPU boost is enabled.
      title: RevisionAnnotationsApiAgentmachinesAppStartupCpuBoost
    RevisionAnnotationsApiAgentmachinesAppSessionAffinity:
      type: string
      enum:
        - 'true'
        - 'false'
      description: Whether clients should be routed to the same instance when possible.
      title: RevisionAnnotationsApiAgentmachinesAppSessionAffinity
    RevisionAnnotationsApiAgentmachinesAppExecutionEnvironment:
      type: string
      enum:
        - gen1
        - gen2
      description: Execution environment generation.
      title: RevisionAnnotationsApiAgentmachinesAppExecutionEnvironment
    RevisionAnnotationsApiAgentmachinesAppVpcAccessEgress:
      type: string
      enum:
        - all-traffic
        - private-ranges-only
      description: Egress policy for VPC access.
      title: RevisionAnnotationsApiAgentmachinesAppVpcAccessEgress
    RevisionAnnotationsApiAgentmachinesAppGpuZonalRedundancyDisabled:
      type: string
      enum:
        - 'true'
        - 'false'
      description: Whether GPU zonal redundancy is disabled.
      title: RevisionAnnotationsApiAgentmachinesAppGpuZonalRedundancyDisabled
    RevisionAnnotations:
      type: object
      properties:
        autoscaling.agentmachines.app/minScale:
          type: string
          description: Minimum instances for a revision.
        autoscaling.agentmachines.app/maxScale:
          type: string
          description: Maximum instances for a revision.
        api.agentmachines.app/scaling-cpu-target:
          type: string
          description: Target average CPU utilization percentage.
        api.agentmachines.app/scaling-concurrency-target:
          type: string
          description: Target concurrent requests per instance.
        api.agentmachines.app/cpu-throttling:
          $ref: >-
            #/components/schemas/RevisionAnnotationsApiAgentmachinesAppCpuThrottling
          description: Whether CPU is throttled outside request handling.
        api.agentmachines.app/startup-cpu-boost:
          $ref: >-
            #/components/schemas/RevisionAnnotationsApiAgentmachinesAppStartupCpuBoost
          description: Whether startup CPU boost is enabled.
        api.agentmachines.app/sessionAffinity:
          $ref: >-
            #/components/schemas/RevisionAnnotationsApiAgentmachinesAppSessionAffinity
          description: Whether clients should be routed to the same instance when possible.
        api.agentmachines.app/cloudsql-instances:
          type: string
          description: Comma-separated Cloud SQL-style connection names.
        api.agentmachines.app/execution-environment:
          $ref: >-
            #/components/schemas/RevisionAnnotationsApiAgentmachinesAppExecutionEnvironment
          description: Execution environment generation.
        api.agentmachines.app/vpc-access-connector:
          type: string
          description: Serverless VPC connector name.
        api.agentmachines.app/vpc-access-egress:
          $ref: >-
            #/components/schemas/RevisionAnnotationsApiAgentmachinesAppVpcAccessEgress
          description: Egress policy for VPC access.
        api.agentmachines.app/network-interfaces:
          type: string
          description: JSON array string describing network interfaces.
        api.agentmachines.app/encryption-key:
          type: string
          description: Customer-managed encryption key resource name.
        api.agentmachines.app/container-dependencies:
          type: string
          description: JSON object string describing container startup order.
        api.agentmachines.app/base-images:
          type: string
          description: JSON object string mapping container names to base images.
        api.agentmachines.app/gpu-zonal-redundancy-disabled:
          $ref: >-
            #/components/schemas/RevisionAnnotationsApiAgentmachinesAppGpuZonalRedundancyDisabled
          description: Whether GPU zonal redundancy is disabled.
      description: Revision-level Agent Machines annotations.
      title: RevisionAnnotations
    RevisionTemplateMeta:
      type: object
      properties:
        name:
          type: string
          description: Optional revision name.
        labels:
          type: object
          additionalProperties:
            type: string
        annotations:
          $ref: '#/components/schemas/RevisionAnnotations'
      description: Metadata applied to a generated revision.
      title: RevisionTemplateMeta
    NodeSelector:
      type: object
      properties:
        api.agentmachines.app/accelerator:
          type: string
          description: Accelerator type requested by the revision.
      description: Placement constraints for revision instances.
      title: NodeSelector
    ContainerPortName:
      type: string
      enum:
        - http1
        - h2c
      description: Port protocol name.
      title: ContainerPortName
    ContainerPort:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/ContainerPortName'
          description: Port protocol name.
        containerPort:
          type: integer
      required:
        - containerPort
      description: Exposed container port.
      title: ContainerPort
    SecretKeySelector:
      type: object
      properties:
        name:
          type: string
          description: Secret name.
        key:
          type: string
          description: Secret version or alias.
        optional:
          type: boolean
      required:
        - name
        - key
      description: Selects a version from a secret.
      title: SecretKeySelector
    EnvVarSource:
      type: object
      properties:
        secretKeyRef:
          $ref: '#/components/schemas/SecretKeySelector'
      description: Source for an environment variable value.
      title: EnvVarSource
    EnvVar:
      type: object
      properties:
        name:
          type: string
          description: Environment variable name.
        value:
          type: string
          description: Literal environment variable value.
        valueFrom:
          $ref: '#/components/schemas/EnvVarSource'
      required:
        - name
      description: Environment variable.
      title: EnvVar
    ResourceRequirementsLimits:
      type: object
      properties:
        cpu:
          type: string
          description: CPU limit.
        memory:
          type: string
          description: Memory limit.
        nvidia.com/gpu:
          type: string
          description: Number of GPUs requested.
      description: Resource limits keyed by resource name.
      title: ResourceRequirementsLimits
    ResourceRequirements:
      type: object
      properties:
        limits:
          $ref: '#/components/schemas/ResourceRequirementsLimits'
          description: Resource limits keyed by resource name.
      description: Container resource requirements.
      title: ResourceRequirements
    VolumeMount:
      type: object
      properties:
        name:
          type: string
        mountPath:
          type: string
      required:
        - name
        - mountPath
      description: Mount point for a named volume.
      title: VolumeMount
    HTTPHeader:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
      required:
        - name
        - value
      title: HTTPHeader
    HTTPGetAction:
      type: object
      properties:
        path:
          type: string
          default: /
        port:
          type: integer
        httpHeaders:
          type: array
          items:
            $ref: '#/components/schemas/HTTPHeader'
      required:
        - port
      description: HTTP probe handler.
      title: HTTPGetAction
    TCPSocketAction:
      type: object
      properties:
        port:
          type: integer
      required:
        - port
      description: TCP probe handler.
      title: TCPSocketAction
    GRPCAction:
      type: object
      properties:
        service:
          type: string
          description: Optional gRPC service name.
        port:
          type: integer
      required:
        - port
      description: gRPC probe handler.
      title: GRPCAction
    Probe:
      type: object
      properties:
        httpGet:
          $ref: '#/components/schemas/HTTPGetAction'
        tcpSocket:
          $ref: '#/components/schemas/TCPSocketAction'
        grpc:
          $ref: '#/components/schemas/GRPCAction'
        initialDelaySeconds:
          type: integer
        timeoutSeconds:
          type: integer
        successThreshold:
          type: integer
        failureThreshold:
          type: integer
        periodSeconds:
          type: integer
      description: >
        Startup, liveness, or readiness probe. Configure one handler per probe:
        httpGet, tcpSocket, or grpc.
      title: Probe
    Container:
      type: object
      properties:
        image:
          type: string
          description: Container image reference.
        name:
          type: string
          description: Optional container name. Generated if omitted.
        command:
          type: array
          items:
            type: string
          description: Entrypoint command.
        args:
          type: array
          items:
            type: string
          description: Command arguments.
        workingDir:
          type: string
          description: Working directory inside the container.
        ports:
          type: array
          items:
            $ref: '#/components/schemas/ContainerPort'
        env:
          type: array
          items:
            $ref: '#/components/schemas/EnvVar'
        resources:
          $ref: '#/components/schemas/ResourceRequirements'
        volumeMounts:
          type: array
          items:
            $ref: '#/components/schemas/VolumeMount'
        startupProbe:
          $ref: '#/components/schemas/Probe'
        livenessProbe:
          $ref: '#/components/schemas/Probe'
        readinessProbe:
          $ref: '#/components/schemas/Probe'
      required:
        - image
      description: Application or sidecar container.
      title: Container
    KeyToPath:
      type: object
      properties:
        key:
          type: string
          description: Secret version or key.
        path:
          type: string
          description: Relative file path inside the volume.
      required:
        - key
        - path
      title: KeyToPath
    SecretVolumeSource:
      type: object
      properties:
        secretName:
          type: string
          description: Secret name.
        items:
          type: array
          items:
            $ref: '#/components/schemas/KeyToPath'
      required:
        - secretName
      description: Secret-backed volume.
      title: SecretVolumeSource
    EmptyDirVolumeSourceMedium:
      type: string
      enum:
        - Memory
      description: Storage medium.
      title: EmptyDirVolumeSourceMedium
    EmptyDirVolumeSource:
      type: object
      properties:
        sizeLimit:
          type: string
          description: Maximum size of the volume.
        medium:
          $ref: '#/components/schemas/EmptyDirVolumeSourceMedium'
          description: Storage medium.
      description: Ephemeral in-memory or disk-backed volume.
      title: EmptyDirVolumeSource
    CsiVolumeSourceDriver:
      type: string
      enum:
        - gcsfuse.api.agentmachines.app
      description: CSI driver name.
      title: CsiVolumeSourceDriver
    CSIVolumeAttributes:
      type: object
      properties:
        bucketName:
          type: string
          description: Bucket or object store container name.
        mountOptions:
          type: string
          description: Comma-separated mount options.
      description: Driver-specific attributes for the CSI volume.
      title: CSIVolumeAttributes
    CSIVolumeSource:
      type: object
      properties:
        driver:
          $ref: '#/components/schemas/CsiVolumeSourceDriver'
          description: CSI driver name.
        readOnly:
          type: boolean
          description: Whether the mounted volume is read-only.
        volumeAttributes:
          $ref: '#/components/schemas/CSIVolumeAttributes'
      required:
        - driver
      description: CSI-backed volume.
      title: CSIVolumeSource
    NFSVolumeSource:
      type: object
      properties:
        server:
          type: string
          description: NFS server IP address or hostname.
        path:
          type: string
          description: Export path on the NFS server.
        readonly:
          type: boolean
          description: Whether the mounted NFS volume is read-only.
      required:
        - server
        - path
      description: NFS-backed volume.
      title: NFSVolumeSource
    Volume:
      type: object
      properties:
        name:
          type: string
        secret:
          $ref: '#/components/schemas/SecretVolumeSource'
        emptyDir:
          $ref: '#/components/schemas/EmptyDirVolumeSource'
        csi:
          $ref: '#/components/schemas/CSIVolumeSource'
        nfs:
          $ref: '#/components/schemas/NFSVolumeSource'
      required:
        - name
      description: Named volume. Exactly one volume source should be set.
      title: Volume
    RevisionSpec:
      type: object
      properties:
        containerConcurrency:
          type: integer
          description: >-
            Maximum concurrent requests per instance. Use 0 for platform
            default.
        timeoutSeconds:
          type: integer
          description: Request timeout in seconds.
        nodeSelector:
          $ref: '#/components/schemas/NodeSelector'
        serviceAccountName:
          type: string
          description: Service account identity used by instances.
        containers:
          type: array
          items:
            $ref: '#/components/schemas/Container'
          description: Ordered list of application and sidecar containers.
        volumes:
          type: array
          items:
            $ref: '#/components/schemas/Volume'
          description: Volumes available to containers.
        runtimeClassName:
          type: string
          description: Runtime class or base image update setting.
      required:
        - containers
      description: Runtime configuration for one generated service revision.
      title: RevisionSpec
    RevisionTemplate:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/RevisionTemplateMeta'
        spec:
          $ref: '#/components/schemas/RevisionSpec'
      required:
        - spec
      description: Template used to create new immutable revisions.
      title: RevisionTemplate
    TrafficTarget:
      type: object
      properties:
        percent:
          type: integer
          description: Percentage of traffic routed to this target.
        latestRevision:
          type: boolean
          description: Route traffic to the latest ready revision.
        revisionName:
          type: string
          description: Route traffic to a named revision.
        tag:
          type: string
          description: Optional stable tag for this traffic target.
        url:
          type: string
          format: uri
      description: Traffic allocation target.
      title: TrafficTarget
    ServiceSpec:
      type: object
      properties:
        template:
          $ref: '#/components/schemas/RevisionTemplate'
        traffic:
          type: array
          items:
            $ref: '#/components/schemas/TrafficTarget'
          description: Traffic allocation across revisions and tags.
      required:
        - template
      description: Desired service state.
      title: ServiceSpec
    ConditionStatus:
      type: string
      enum:
        - 'True'
        - 'False'
        - Unknown
      title: ConditionStatus
    Condition:
      type: object
      properties:
        type:
          type: string
        status:
          $ref: '#/components/schemas/ConditionStatus'
        reason:
          type: string
        message:
          type: string
        lastTransitionTime:
          type: string
          format: date-time
      description: Condition describing reconciliation or readiness.
      title: Condition
    Addressable:
      type: object
      properties:
        url:
          type: string
          format: uri
      description: Addressable service endpoint.
      title: Addressable
    ServiceStatus:
      type: object
      properties:
        observedGeneration:
          type: integer
          format: int64
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
        url:
          type: string
          format: uri
        address:
          $ref: '#/components/schemas/Addressable'
        latestCreatedRevisionName:
          type: string
        latestReadyRevisionName:
          type: string
        traffic:
          type: array
          items:
            $ref: '#/components/schemas/TrafficTarget'
      description: Observed state of a service.
      title: ServiceStatus
    AgentMachinesService:
      type: object
      properties:
        apiVersion:
          $ref: '#/components/schemas/AgentMachinesServiceApiVersion'
          description: Agent Machines service API version.
        kind:
          $ref: '#/components/schemas/AgentMachinesServiceKind'
          description: Resource kind.
        metadata:
          $ref: '#/components/schemas/ObjectMeta'
        spec:
          $ref: '#/components/schemas/ServiceSpec'
        status:
          $ref: '#/components/schemas/ServiceStatus'
      required:
        - apiVersion
        - kind
        - metadata
        - spec
      description: Top-level Agent Machines service manifest.
      title: AgentMachinesService
    ErrorError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        status:
          type: string
        details:
          type: array
          items:
            type: object
            additionalProperties:
              description: Any type
      required:
        - code
        - message
      title: ErrorError
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorError'
      required:
        - error
      description: Error response body.
      title: Error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "apiVersion": "serving.agentmachines.app/v1",
  "kind": "Service",
  "metadata": {
    "name": "web",
    "namespace": "project-123456",
    "labels": {
      "api.agentmachines.app/location": "us-central1"
    },
    "annotations": {
      "api.agentmachines.app/custom-audiences": "[\"dashboard\",\"internal\"]",
      "api.agentmachines.app/launch-stage": "GA",
      "api.agentmachines.app/description": "Public web service",
      "api.agentmachines.app/ingress": "all",
      "api.agentmachines.app/binary-authorization": "default",
      "api.agentmachines.app/binary-authorization-breakglass": "emergency rollout",
      "api.agentmachines.app/minScale": "0",
      "api.agentmachines.app/maxScale": "20",
      "api.agentmachines.app/function-target": "handler",
      "api.agentmachines.app/invoker-iam-disabled": "false",
      "api.agentmachines.app/iap-enabled": "false",
      "api.agentmachines.app/scalingMode": "automatic",
      "api.agentmachines.app/manualInstanceCount": "0"
    }
  },
  "spec": {
    "template": {
      "spec": {
        "containers": [
          {
            "image": "registry.example.com/project/web:latest",
            "name": "web",
            "command": [
              "/app/server"
            ],
            "args": [
              "--port",
              "8080"
            ],
            "workingDir": "/app",
            "ports": [
              {
                "containerPort": 8080,
                "name": "http1"
              }
            ],
            "env": [
              {
                "name": "ENVIRONMENT",
                "value": "production"
              }
            ],
            "resources": {
              "limits": {
                "cpu": "1",
                "memory": "512Mi",
                "nvidia.com/gpu": "1"
              }
            },
            "volumeMounts": [
              {
                "name": "cache",
                "mountPath": "/cache"
              }
            ],
            "startupProbe": {
              "httpGet": {
                "port": 8080,
                "path": "/healthz/startup",
                "httpHeaders": [
                  {
                    "name": "X-Probe",
                    "value": "startup"
                  }
                ]
              },
              "initialDelaySeconds": 2,
              "timeoutSeconds": 5,
              "failureThreshold": 6,
              "periodSeconds": 10
            },
            "livenessProbe": {
              "httpGet": {
                "port": 8080,
                "path": "/healthz/live"
              },
              "initialDelaySeconds": 5,
              "timeoutSeconds": 5,
              "failureThreshold": 3,
              "periodSeconds": 10
            },
            "readinessProbe": {
              "httpGet": {
                "port": 8080,
                "path": "/healthz/ready"
              },
              "timeoutSeconds": 5,
              "successThreshold": 1,
              "failureThreshold": 3,
              "periodSeconds": 10
            }
          },
          {
            "image": "registry.example.com/project/proxy:latest",
            "name": "proxy"
          }
        ],
        "containerConcurrency": 80,
        "timeoutSeconds": 300,
        "nodeSelector": {
          "api.agentmachines.app/accelerator": "nvidia-l4"
        },
        "serviceAccountName": "service-account@example.iam",
        "volumes": [
          {
            "name": "app-secret",
            "secret": {
              "secretName": "api-token",
              "items": [
                {
                  "key": "latest",
                  "path": "token"
                }
              ]
            }
          },
          {
            "name": "cache",
            "emptyDir": {
              "sizeLimit": "512Mi",
              "medium": "Memory"
            }
          },
          {
            "name": "assets",
            "csi": {
              "driver": "gcsfuse.api.agentmachines.app",
              "readOnly": true,
              "volumeAttributes": {
                "bucketName": "app-assets",
                "mountOptions": "implicit-dirs,uid=1000"
              }
            }
          },
          {
            "name": "shared",
            "nfs": {
              "server": "10.0.0.10",
              "path": "/exports/shared",
              "readonly": true
            }
          }
        ],
        "runtimeClassName": "base-image-update"
      },
      "metadata": {
        "name": "web-00001",
        "annotations": {
          "autoscaling.agentmachines.app/minScale": "0",
          "autoscaling.agentmachines.app/maxScale": "10",
          "api.agentmachines.app/scaling-cpu-target": "60",
          "api.agentmachines.app/scaling-concurrency-target": "80",
          "api.agentmachines.app/cpu-throttling": "true",
          "api.agentmachines.app/startup-cpu-boost": "true",
          "api.agentmachines.app/sessionAffinity": "false",
          "api.agentmachines.app/cloudsql-instances": "project:region:instance",
          "api.agentmachines.app/execution-environment": "gen2",
          "api.agentmachines.app/vpc-access-connector": "connector-name",
          "api.agentmachines.app/vpc-access-egress": "private-ranges-only",
          "api.agentmachines.app/network-interfaces": "[{\"network\":\"default\",\"subnetwork\":\"default\"}]",
          "api.agentmachines.app/encryption-key": "projects/project/locations/global/keyRings/ring/cryptoKeys/key",
          "api.agentmachines.app/container-dependencies": "{\"web\":[\"proxy\"]}",
          "api.agentmachines.app/base-images": "{\"\":\"debian12\"}",
          "api.agentmachines.app/gpu-zonal-redundancy-disabled": "false"
        }
      }
    },
    "traffic": [
      {
        "percent": 90,
        "latestRevision": true
      },
      {
        "percent": 10,
        "revisionName": "web-00001"
      },
      {
        "revisionName": "web-00001",
        "tag": "stable"
      }
    ]
  }
}
```

**Response**

```json
{
  "apiVersion": "serving.agentmachines.app/v1",
  "kind": "Service",
  "metadata": {
    "name": "web",
    "namespace": "project-123456",
    "labels": {
      "api.agentmachines.app/location": "us-central1"
    },
    "annotations": {
      "api.agentmachines.app/custom-audiences": "[\"dashboard\",\"internal\"]",
      "api.agentmachines.app/launch-stage": "GA",
      "api.agentmachines.app/description": "string",
      "api.agentmachines.app/ingress": "all",
      "api.agentmachines.app/binary-authorization": "string",
      "api.agentmachines.app/binary-authorization-breakglass": "string",
      "api.agentmachines.app/minScale": "string",
      "api.agentmachines.app/maxScale": "string",
      "api.agentmachines.app/function-target": "string",
      "api.agentmachines.app/invoker-iam-disabled": "true",
      "api.agentmachines.app/iap-enabled": "true",
      "api.agentmachines.app/scalingMode": "automatic",
      "api.agentmachines.app/manualInstanceCount": "string"
    },
    "generateName": "string",
    "uid": "string",
    "resourceVersion": "string",
    "generation": 1,
    "creationTimestamp": "2024-01-15T09:30:00Z",
    "deletionTimestamp": "2024-01-15T09:30:00Z",
    "finalizers": [
      "string"
    ]
  },
  "spec": {
    "template": {
      "spec": {
        "containers": [
          {
            "image": "registry.example.com/project/web:latest",
            "name": "web",
            "command": [
              "string"
            ],
            "args": [
              "string"
            ],
            "workingDir": "string",
            "ports": [
              {
                "containerPort": 1,
                "name": "http1"
              }
            ],
            "env": [
              {
                "name": "string",
                "value": "string",
                "valueFrom": {
                  "secretKeyRef": {
                    "name": "string",
                    "key": "string",
                    "optional": true
                  }
                }
              }
            ],
            "resources": {
              "limits": {
                "cpu": "1",
                "memory": "512Mi",
                "nvidia.com/gpu": "1"
              }
            },
            "volumeMounts": [
              {
                "name": "string",
                "mountPath": "string"
              }
            ],
            "startupProbe": {
              "httpGet": {
                "port": 1,
                "path": "/",
                "httpHeaders": [
                  {
                    "name": "string",
                    "value": "string"
                  }
                ]
              },
              "tcpSocket": {
                "port": 1
              },
              "grpc": {
                "port": 1,
                "service": "string"
              },
              "initialDelaySeconds": 1,
              "timeoutSeconds": 1,
              "successThreshold": 1,
              "failureThreshold": 1,
              "periodSeconds": 1
            },
            "livenessProbe": {
              "httpGet": {
                "port": 1,
                "path": "/",
                "httpHeaders": [
                  {
                    "name": "string",
                    "value": "string"
                  }
                ]
              },
              "tcpSocket": {
                "port": 1
              },
              "grpc": {
                "port": 1,
                "service": "string"
              },
              "initialDelaySeconds": 1,
              "timeoutSeconds": 1,
              "successThreshold": 1,
              "failureThreshold": 1,
              "periodSeconds": 1
            },
            "readinessProbe": {
              "httpGet": {
                "port": 1,
                "path": "/",
                "httpHeaders": [
                  {
                    "name": "string",
                    "value": "string"
                  }
                ]
              },
              "tcpSocket": {
                "port": 1
              },
              "grpc": {
                "port": 1,
                "service": "string"
              },
              "initialDelaySeconds": 1,
              "timeoutSeconds": 1,
              "successThreshold": 1,
              "failureThreshold": 1,
              "periodSeconds": 1
            }
          }
        ],
        "containerConcurrency": 1,
        "timeoutSeconds": 1,
        "nodeSelector": {
          "api.agentmachines.app/accelerator": "nvidia-l4"
        },
        "serviceAccountName": "string",
        "volumes": [
          {
            "name": "string",
            "secret": {
              "secretName": "string",
              "items": [
                {
                  "key": "string",
                  "path": "string"
                }
              ]
            },
            "emptyDir": {
              "sizeLimit": "512Mi",
              "medium": "Memory"
            },
            "csi": {
              "driver": "gcsfuse.api.agentmachines.app",
              "readOnly": true,
              "volumeAttributes": {
                "bucketName": "string",
                "mountOptions": "implicit-dirs,uid=1000"
              }
            },
            "nfs": {
              "server": "string",
              "path": "string",
              "readonly": true
            }
          }
        ],
        "runtimeClassName": "string"
      },
      "metadata": {
        "name": "web-00001",
        "labels": {},
        "annotations": {
          "autoscaling.agentmachines.app/minScale": "string",
          "autoscaling.agentmachines.app/maxScale": "string",
          "api.agentmachines.app/scaling-cpu-target": "string",
          "api.agentmachines.app/scaling-concurrency-target": "string",
          "api.agentmachines.app/cpu-throttling": "true",
          "api.agentmachines.app/startup-cpu-boost": "true",
          "api.agentmachines.app/sessionAffinity": "true",
          "api.agentmachines.app/cloudsql-instances": "string",
          "api.agentmachines.app/execution-environment": "gen1",
          "api.agentmachines.app/vpc-access-connector": "string",
          "api.agentmachines.app/vpc-access-egress": "all-traffic",
          "api.agentmachines.app/network-interfaces": "string",
          "api.agentmachines.app/encryption-key": "string",
          "api.agentmachines.app/container-dependencies": "string",
          "api.agentmachines.app/base-images": "string",
          "api.agentmachines.app/gpu-zonal-redundancy-disabled": "true"
        }
      }
    },
    "traffic": [
      {
        "percent": 1,
        "latestRevision": true,
        "revisionName": "string",
        "tag": "string",
        "url": "string"
      }
    ]
  },
  "status": {
    "observedGeneration": 1,
    "conditions": [
      {
        "type": "string",
        "status": "True",
        "reason": "string",
        "message": "string",
        "lastTransitionTime": "2024-01-15T09:30:00Z"
      }
    ],
    "url": "string",
    "address": {
      "url": "string"
    },
    "latestCreatedRevisionName": "string",
    "latestReadyRevisionName": "string",
    "traffic": [
      {
        "percent": 1,
        "latestRevision": true,
        "revisionName": "string",
        "tag": "string",
        "url": "string"
      }
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.agentmachines.app/apis/serving.agentmachines.app/v1/namespaces/project-123456/services"

payload = {
    "apiVersion": "serving.agentmachines.app/v1",
    "kind": "Service",
    "metadata": {
        "name": "web",
        "namespace": "project-123456",
        "labels": { "api.agentmachines.app/location": "us-central1" },
        "annotations": {
            "api.agentmachines.app/custom-audiences": "[\"dashboard\",\"internal\"]",
            "api.agentmachines.app/launch-stage": "GA",
            "api.agentmachines.app/description": "Public web service",
            "api.agentmachines.app/ingress": "all",
            "api.agentmachines.app/binary-authorization": "default",
            "api.agentmachines.app/binary-authorization-breakglass": "emergency rollout",
            "api.agentmachines.app/minScale": "0",
            "api.agentmachines.app/maxScale": "20",
            "api.agentmachines.app/function-target": "handler",
            "api.agentmachines.app/invoker-iam-disabled": "false",
            "api.agentmachines.app/iap-enabled": "false",
            "api.agentmachines.app/scalingMode": "automatic",
            "api.agentmachines.app/manualInstanceCount": "0"
        }
    },
    "spec": {
        "template": {
            "spec": {
                "containers": [
                    {
                        "image": "registry.example.com/project/web:latest",
                        "name": "web",
                        "command": ["/app/server"],
                        "args": ["--port", "8080"],
                        "workingDir": "/app",
                        "ports": [
                            {
                                "containerPort": 8080,
                                "name": "http1"
                            }
                        ],
                        "env": [
                            {
                                "name": "ENVIRONMENT",
                                "value": "production"
                            }
                        ],
                        "resources": { "limits": {
                                "cpu": "1",
                                "memory": "512Mi",
                                "nvidia.com/gpu": "1"
                            } },
                        "volumeMounts": [
                            {
                                "name": "cache",
                                "mountPath": "/cache"
                            }
                        ],
                        "startupProbe": {
                            "httpGet": {
                                "port": 8080,
                                "path": "/healthz/startup",
                                "httpHeaders": [
                                    {
                                        "name": "X-Probe",
                                        "value": "startup"
                                    }
                                ]
                            },
                            "initialDelaySeconds": 2,
                            "timeoutSeconds": 5,
                            "failureThreshold": 6,
                            "periodSeconds": 10
                        },
                        "livenessProbe": {
                            "httpGet": {
                                "port": 8080,
                                "path": "/healthz/live"
                            },
                            "initialDelaySeconds": 5,
                            "timeoutSeconds": 5,
                            "failureThreshold": 3,
                            "periodSeconds": 10
                        },
                        "readinessProbe": {
                            "httpGet": {
                                "port": 8080,
                                "path": "/healthz/ready"
                            },
                            "timeoutSeconds": 5,
                            "successThreshold": 1,
                            "failureThreshold": 3,
                            "periodSeconds": 10
                        }
                    },
                    {
                        "image": "registry.example.com/project/proxy:latest",
                        "name": "proxy"
                    }
                ],
                "containerConcurrency": 80,
                "timeoutSeconds": 300,
                "nodeSelector": { "api.agentmachines.app/accelerator": "nvidia-l4" },
                "serviceAccountName": "service-account@example.iam",
                "volumes": [
                    {
                        "name": "app-secret",
                        "secret": {
                            "secretName": "api-token",
                            "items": [
                                {
                                    "key": "latest",
                                    "path": "token"
                                }
                            ]
                        }
                    },
                    {
                        "name": "cache",
                        "emptyDir": {
                            "sizeLimit": "512Mi",
                            "medium": "Memory"
                        }
                    },
                    {
                        "name": "assets",
                        "csi": {
                            "driver": "gcsfuse.api.agentmachines.app",
                            "readOnly": True,
                            "volumeAttributes": {
                                "bucketName": "app-assets",
                                "mountOptions": "implicit-dirs,uid=1000"
                            }
                        }
                    },
                    {
                        "name": "shared",
                        "nfs": {
                            "server": "10.0.0.10",
                            "path": "/exports/shared",
                            "readonly": True
                        }
                    }
                ],
                "runtimeClassName": "base-image-update"
            },
            "metadata": {
                "name": "web-00001",
                "annotations": {
                    "autoscaling.agentmachines.app/minScale": "0",
                    "autoscaling.agentmachines.app/maxScale": "10",
                    "api.agentmachines.app/scaling-cpu-target": "60",
                    "api.agentmachines.app/scaling-concurrency-target": "80",
                    "api.agentmachines.app/cpu-throttling": "true",
                    "api.agentmachines.app/startup-cpu-boost": "true",
                    "api.agentmachines.app/sessionAffinity": "false",
                    "api.agentmachines.app/cloudsql-instances": "project:region:instance",
                    "api.agentmachines.app/execution-environment": "gen2",
                    "api.agentmachines.app/vpc-access-connector": "connector-name",
                    "api.agentmachines.app/vpc-access-egress": "private-ranges-only",
                    "api.agentmachines.app/network-interfaces": "[{\"network\":\"default\",\"subnetwork\":\"default\"}]",
                    "api.agentmachines.app/encryption-key": "projects/project/locations/global/keyRings/ring/cryptoKeys/key",
                    "api.agentmachines.app/container-dependencies": "{\"web\":[\"proxy\"]}",
                    "api.agentmachines.app/base-images": "{\"\":\"debian12\"}",
                    "api.agentmachines.app/gpu-zonal-redundancy-disabled": "false"
                }
            }
        },
        "traffic": [
            {
                "percent": 90,
                "latestRevision": True
            },
            {
                "percent": 10,
                "revisionName": "web-00001"
            },
            {
                "revisionName": "web-00001",
                "tag": "stable"
            }
        ]
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.agentmachines.app/apis/serving.agentmachines.app/v1/namespaces/project-123456/services';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"apiVersion":"serving.agentmachines.app/v1","kind":"Service","metadata":{"name":"web","namespace":"project-123456","labels":{"api.agentmachines.app/location":"us-central1"},"annotations":{"api.agentmachines.app/custom-audiences":"[\"dashboard\",\"internal\"]","api.agentmachines.app/launch-stage":"GA","api.agentmachines.app/description":"Public web service","api.agentmachines.app/ingress":"all","api.agentmachines.app/binary-authorization":"default","api.agentmachines.app/binary-authorization-breakglass":"emergency rollout","api.agentmachines.app/minScale":"0","api.agentmachines.app/maxScale":"20","api.agentmachines.app/function-target":"handler","api.agentmachines.app/invoker-iam-disabled":"false","api.agentmachines.app/iap-enabled":"false","api.agentmachines.app/scalingMode":"automatic","api.agentmachines.app/manualInstanceCount":"0"}},"spec":{"template":{"spec":{"containers":[{"image":"registry.example.com/project/web:latest","name":"web","command":["/app/server"],"args":["--port","8080"],"workingDir":"/app","ports":[{"containerPort":8080,"name":"http1"}],"env":[{"name":"ENVIRONMENT","value":"production"}],"resources":{"limits":{"cpu":"1","memory":"512Mi","nvidia.com/gpu":"1"}},"volumeMounts":[{"name":"cache","mountPath":"/cache"}],"startupProbe":{"httpGet":{"port":8080,"path":"/healthz/startup","httpHeaders":[{"name":"X-Probe","value":"startup"}]},"initialDelaySeconds":2,"timeoutSeconds":5,"failureThreshold":6,"periodSeconds":10},"livenessProbe":{"httpGet":{"port":8080,"path":"/healthz/live"},"initialDelaySeconds":5,"timeoutSeconds":5,"failureThreshold":3,"periodSeconds":10},"readinessProbe":{"httpGet":{"port":8080,"path":"/healthz/ready"},"timeoutSeconds":5,"successThreshold":1,"failureThreshold":3,"periodSeconds":10}},{"image":"registry.example.com/project/proxy:latest","name":"proxy"}],"containerConcurrency":80,"timeoutSeconds":300,"nodeSelector":{"api.agentmachines.app/accelerator":"nvidia-l4"},"serviceAccountName":"service-account@example.iam","volumes":[{"name":"app-secret","secret":{"secretName":"api-token","items":[{"key":"latest","path":"token"}]}},{"name":"cache","emptyDir":{"sizeLimit":"512Mi","medium":"Memory"}},{"name":"assets","csi":{"driver":"gcsfuse.api.agentmachines.app","readOnly":true,"volumeAttributes":{"bucketName":"app-assets","mountOptions":"implicit-dirs,uid=1000"}}},{"name":"shared","nfs":{"server":"10.0.0.10","path":"/exports/shared","readonly":true}}],"runtimeClassName":"base-image-update"},"metadata":{"name":"web-00001","annotations":{"autoscaling.agentmachines.app/minScale":"0","autoscaling.agentmachines.app/maxScale":"10","api.agentmachines.app/scaling-cpu-target":"60","api.agentmachines.app/scaling-concurrency-target":"80","api.agentmachines.app/cpu-throttling":"true","api.agentmachines.app/startup-cpu-boost":"true","api.agentmachines.app/sessionAffinity":"false","api.agentmachines.app/cloudsql-instances":"project:region:instance","api.agentmachines.app/execution-environment":"gen2","api.agentmachines.app/vpc-access-connector":"connector-name","api.agentmachines.app/vpc-access-egress":"private-ranges-only","api.agentmachines.app/network-interfaces":"[{\"network\":\"default\",\"subnetwork\":\"default\"}]","api.agentmachines.app/encryption-key":"projects/project/locations/global/keyRings/ring/cryptoKeys/key","api.agentmachines.app/container-dependencies":"{\"web\":[\"proxy\"]}","api.agentmachines.app/base-images":"{\"\":\"debian12\"}","api.agentmachines.app/gpu-zonal-redundancy-disabled":"false"}}},"traffic":[{"percent":90,"latestRevision":true},{"percent":10,"revisionName":"web-00001"},{"revisionName":"web-00001","tag":"stable"}]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.agentmachines.app/apis/serving.agentmachines.app/v1/namespaces/project-123456/services"

	payload := strings.NewReader("{\n  \"apiVersion\": \"serving.agentmachines.app/v1\",\n  \"kind\": \"Service\",\n  \"metadata\": {\n    \"name\": \"web\",\n    \"namespace\": \"project-123456\",\n    \"labels\": {\n      \"api.agentmachines.app/location\": \"us-central1\"\n    },\n    \"annotations\": {\n      \"api.agentmachines.app/custom-audiences\": \"[\\\"dashboard\\\",\\\"internal\\\"]\",\n      \"api.agentmachines.app/launch-stage\": \"GA\",\n      \"api.agentmachines.app/description\": \"Public web service\",\n      \"api.agentmachines.app/ingress\": \"all\",\n      \"api.agentmachines.app/binary-authorization\": \"default\",\n      \"api.agentmachines.app/binary-authorization-breakglass\": \"emergency rollout\",\n      \"api.agentmachines.app/minScale\": \"0\",\n      \"api.agentmachines.app/maxScale\": \"20\",\n      \"api.agentmachines.app/function-target\": \"handler\",\n      \"api.agentmachines.app/invoker-iam-disabled\": \"false\",\n      \"api.agentmachines.app/iap-enabled\": \"false\",\n      \"api.agentmachines.app/scalingMode\": \"automatic\",\n      \"api.agentmachines.app/manualInstanceCount\": \"0\"\n    }\n  },\n  \"spec\": {\n    \"template\": {\n      \"spec\": {\n        \"containers\": [\n          {\n            \"image\": \"registry.example.com/project/web:latest\",\n            \"name\": \"web\",\n            \"command\": [\n              \"/app/server\"\n            ],\n            \"args\": [\n              \"--port\",\n              \"8080\"\n            ],\n            \"workingDir\": \"/app\",\n            \"ports\": [\n              {\n                \"containerPort\": 8080,\n                \"name\": \"http1\"\n              }\n            ],\n            \"env\": [\n              {\n                \"name\": \"ENVIRONMENT\",\n                \"value\": \"production\"\n              }\n            ],\n            \"resources\": {\n              \"limits\": {\n                \"cpu\": \"1\",\n                \"memory\": \"512Mi\",\n                \"nvidia.com/gpu\": \"1\"\n              }\n            },\n            \"volumeMounts\": [\n              {\n                \"name\": \"cache\",\n                \"mountPath\": \"/cache\"\n              }\n            ],\n            \"startupProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/startup\",\n                \"httpHeaders\": [\n                  {\n                    \"name\": \"X-Probe\",\n                    \"value\": \"startup\"\n                  }\n                ]\n              },\n              \"initialDelaySeconds\": 2,\n              \"timeoutSeconds\": 5,\n              \"failureThreshold\": 6,\n              \"periodSeconds\": 10\n            },\n            \"livenessProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/live\"\n              },\n              \"initialDelaySeconds\": 5,\n              \"timeoutSeconds\": 5,\n              \"failureThreshold\": 3,\n              \"periodSeconds\": 10\n            },\n            \"readinessProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/ready\"\n              },\n              \"timeoutSeconds\": 5,\n              \"successThreshold\": 1,\n              \"failureThreshold\": 3,\n              \"periodSeconds\": 10\n            }\n          },\n          {\n            \"image\": \"registry.example.com/project/proxy:latest\",\n            \"name\": \"proxy\"\n          }\n        ],\n        \"containerConcurrency\": 80,\n        \"timeoutSeconds\": 300,\n        \"nodeSelector\": {\n          \"api.agentmachines.app/accelerator\": \"nvidia-l4\"\n        },\n        \"serviceAccountName\": \"service-account@example.iam\",\n        \"volumes\": [\n          {\n            \"name\": \"app-secret\",\n            \"secret\": {\n              \"secretName\": \"api-token\",\n              \"items\": [\n                {\n                  \"key\": \"latest\",\n                  \"path\": \"token\"\n                }\n              ]\n            }\n          },\n          {\n            \"name\": \"cache\",\n            \"emptyDir\": {\n              \"sizeLimit\": \"512Mi\",\n              \"medium\": \"Memory\"\n            }\n          },\n          {\n            \"name\": \"assets\",\n            \"csi\": {\n              \"driver\": \"gcsfuse.api.agentmachines.app\",\n              \"readOnly\": true,\n              \"volumeAttributes\": {\n                \"bucketName\": \"app-assets\",\n                \"mountOptions\": \"implicit-dirs,uid=1000\"\n              }\n            }\n          },\n          {\n            \"name\": \"shared\",\n            \"nfs\": {\n              \"server\": \"10.0.0.10\",\n              \"path\": \"/exports/shared\",\n              \"readonly\": true\n            }\n          }\n        ],\n        \"runtimeClassName\": \"base-image-update\"\n      },\n      \"metadata\": {\n        \"name\": \"web-00001\",\n        \"annotations\": {\n          \"autoscaling.agentmachines.app/minScale\": \"0\",\n          \"autoscaling.agentmachines.app/maxScale\": \"10\",\n          \"api.agentmachines.app/scaling-cpu-target\": \"60\",\n          \"api.agentmachines.app/scaling-concurrency-target\": \"80\",\n          \"api.agentmachines.app/cpu-throttling\": \"true\",\n          \"api.agentmachines.app/startup-cpu-boost\": \"true\",\n          \"api.agentmachines.app/sessionAffinity\": \"false\",\n          \"api.agentmachines.app/cloudsql-instances\": \"project:region:instance\",\n          \"api.agentmachines.app/execution-environment\": \"gen2\",\n          \"api.agentmachines.app/vpc-access-connector\": \"connector-name\",\n          \"api.agentmachines.app/vpc-access-egress\": \"private-ranges-only\",\n          \"api.agentmachines.app/network-interfaces\": \"[{\\\"network\\\":\\\"default\\\",\\\"subnetwork\\\":\\\"default\\\"}]\",\n          \"api.agentmachines.app/encryption-key\": \"projects/project/locations/global/keyRings/ring/cryptoKeys/key\",\n          \"api.agentmachines.app/container-dependencies\": \"{\\\"web\\\":[\\\"proxy\\\"]}\",\n          \"api.agentmachines.app/base-images\": \"{\\\"\\\":\\\"debian12\\\"}\",\n          \"api.agentmachines.app/gpu-zonal-redundancy-disabled\": \"false\"\n        }\n      }\n    },\n    \"traffic\": [\n      {\n        \"percent\": 90,\n        \"latestRevision\": true\n      },\n      {\n        \"percent\": 10,\n        \"revisionName\": \"web-00001\"\n      },\n      {\n        \"revisionName\": \"web-00001\",\n        \"tag\": \"stable\"\n      }\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.agentmachines.app/apis/serving.agentmachines.app/v1/namespaces/project-123456/services")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"apiVersion\": \"serving.agentmachines.app/v1\",\n  \"kind\": \"Service\",\n  \"metadata\": {\n    \"name\": \"web\",\n    \"namespace\": \"project-123456\",\n    \"labels\": {\n      \"api.agentmachines.app/location\": \"us-central1\"\n    },\n    \"annotations\": {\n      \"api.agentmachines.app/custom-audiences\": \"[\\\"dashboard\\\",\\\"internal\\\"]\",\n      \"api.agentmachines.app/launch-stage\": \"GA\",\n      \"api.agentmachines.app/description\": \"Public web service\",\n      \"api.agentmachines.app/ingress\": \"all\",\n      \"api.agentmachines.app/binary-authorization\": \"default\",\n      \"api.agentmachines.app/binary-authorization-breakglass\": \"emergency rollout\",\n      \"api.agentmachines.app/minScale\": \"0\",\n      \"api.agentmachines.app/maxScale\": \"20\",\n      \"api.agentmachines.app/function-target\": \"handler\",\n      \"api.agentmachines.app/invoker-iam-disabled\": \"false\",\n      \"api.agentmachines.app/iap-enabled\": \"false\",\n      \"api.agentmachines.app/scalingMode\": \"automatic\",\n      \"api.agentmachines.app/manualInstanceCount\": \"0\"\n    }\n  },\n  \"spec\": {\n    \"template\": {\n      \"spec\": {\n        \"containers\": [\n          {\n            \"image\": \"registry.example.com/project/web:latest\",\n            \"name\": \"web\",\n            \"command\": [\n              \"/app/server\"\n            ],\n            \"args\": [\n              \"--port\",\n              \"8080\"\n            ],\n            \"workingDir\": \"/app\",\n            \"ports\": [\n              {\n                \"containerPort\": 8080,\n                \"name\": \"http1\"\n              }\n            ],\n            \"env\": [\n              {\n                \"name\": \"ENVIRONMENT\",\n                \"value\": \"production\"\n              }\n            ],\n            \"resources\": {\n              \"limits\": {\n                \"cpu\": \"1\",\n                \"memory\": \"512Mi\",\n                \"nvidia.com/gpu\": \"1\"\n              }\n            },\n            \"volumeMounts\": [\n              {\n                \"name\": \"cache\",\n                \"mountPath\": \"/cache\"\n              }\n            ],\n            \"startupProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/startup\",\n                \"httpHeaders\": [\n                  {\n                    \"name\": \"X-Probe\",\n                    \"value\": \"startup\"\n                  }\n                ]\n              },\n              \"initialDelaySeconds\": 2,\n              \"timeoutSeconds\": 5,\n              \"failureThreshold\": 6,\n              \"periodSeconds\": 10\n            },\n            \"livenessProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/live\"\n              },\n              \"initialDelaySeconds\": 5,\n              \"timeoutSeconds\": 5,\n              \"failureThreshold\": 3,\n              \"periodSeconds\": 10\n            },\n            \"readinessProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/ready\"\n              },\n              \"timeoutSeconds\": 5,\n              \"successThreshold\": 1,\n              \"failureThreshold\": 3,\n              \"periodSeconds\": 10\n            }\n          },\n          {\n            \"image\": \"registry.example.com/project/proxy:latest\",\n            \"name\": \"proxy\"\n          }\n        ],\n        \"containerConcurrency\": 80,\n        \"timeoutSeconds\": 300,\n        \"nodeSelector\": {\n          \"api.agentmachines.app/accelerator\": \"nvidia-l4\"\n        },\n        \"serviceAccountName\": \"service-account@example.iam\",\n        \"volumes\": [\n          {\n            \"name\": \"app-secret\",\n            \"secret\": {\n              \"secretName\": \"api-token\",\n              \"items\": [\n                {\n                  \"key\": \"latest\",\n                  \"path\": \"token\"\n                }\n              ]\n            }\n          },\n          {\n            \"name\": \"cache\",\n            \"emptyDir\": {\n              \"sizeLimit\": \"512Mi\",\n              \"medium\": \"Memory\"\n            }\n          },\n          {\n            \"name\": \"assets\",\n            \"csi\": {\n              \"driver\": \"gcsfuse.api.agentmachines.app\",\n              \"readOnly\": true,\n              \"volumeAttributes\": {\n                \"bucketName\": \"app-assets\",\n                \"mountOptions\": \"implicit-dirs,uid=1000\"\n              }\n            }\n          },\n          {\n            \"name\": \"shared\",\n            \"nfs\": {\n              \"server\": \"10.0.0.10\",\n              \"path\": \"/exports/shared\",\n              \"readonly\": true\n            }\n          }\n        ],\n        \"runtimeClassName\": \"base-image-update\"\n      },\n      \"metadata\": {\n        \"name\": \"web-00001\",\n        \"annotations\": {\n          \"autoscaling.agentmachines.app/minScale\": \"0\",\n          \"autoscaling.agentmachines.app/maxScale\": \"10\",\n          \"api.agentmachines.app/scaling-cpu-target\": \"60\",\n          \"api.agentmachines.app/scaling-concurrency-target\": \"80\",\n          \"api.agentmachines.app/cpu-throttling\": \"true\",\n          \"api.agentmachines.app/startup-cpu-boost\": \"true\",\n          \"api.agentmachines.app/sessionAffinity\": \"false\",\n          \"api.agentmachines.app/cloudsql-instances\": \"project:region:instance\",\n          \"api.agentmachines.app/execution-environment\": \"gen2\",\n          \"api.agentmachines.app/vpc-access-connector\": \"connector-name\",\n          \"api.agentmachines.app/vpc-access-egress\": \"private-ranges-only\",\n          \"api.agentmachines.app/network-interfaces\": \"[{\\\"network\\\":\\\"default\\\",\\\"subnetwork\\\":\\\"default\\\"}]\",\n          \"api.agentmachines.app/encryption-key\": \"projects/project/locations/global/keyRings/ring/cryptoKeys/key\",\n          \"api.agentmachines.app/container-dependencies\": \"{\\\"web\\\":[\\\"proxy\\\"]}\",\n          \"api.agentmachines.app/base-images\": \"{\\\"\\\":\\\"debian12\\\"}\",\n          \"api.agentmachines.app/gpu-zonal-redundancy-disabled\": \"false\"\n        }\n      }\n    },\n    \"traffic\": [\n      {\n        \"percent\": 90,\n        \"latestRevision\": true\n      },\n      {\n        \"percent\": 10,\n        \"revisionName\": \"web-00001\"\n      },\n      {\n        \"revisionName\": \"web-00001\",\n        \"tag\": \"stable\"\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.agentmachines.app/apis/serving.agentmachines.app/v1/namespaces/project-123456/services")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"apiVersion\": \"serving.agentmachines.app/v1\",\n  \"kind\": \"Service\",\n  \"metadata\": {\n    \"name\": \"web\",\n    \"namespace\": \"project-123456\",\n    \"labels\": {\n      \"api.agentmachines.app/location\": \"us-central1\"\n    },\n    \"annotations\": {\n      \"api.agentmachines.app/custom-audiences\": \"[\\\"dashboard\\\",\\\"internal\\\"]\",\n      \"api.agentmachines.app/launch-stage\": \"GA\",\n      \"api.agentmachines.app/description\": \"Public web service\",\n      \"api.agentmachines.app/ingress\": \"all\",\n      \"api.agentmachines.app/binary-authorization\": \"default\",\n      \"api.agentmachines.app/binary-authorization-breakglass\": \"emergency rollout\",\n      \"api.agentmachines.app/minScale\": \"0\",\n      \"api.agentmachines.app/maxScale\": \"20\",\n      \"api.agentmachines.app/function-target\": \"handler\",\n      \"api.agentmachines.app/invoker-iam-disabled\": \"false\",\n      \"api.agentmachines.app/iap-enabled\": \"false\",\n      \"api.agentmachines.app/scalingMode\": \"automatic\",\n      \"api.agentmachines.app/manualInstanceCount\": \"0\"\n    }\n  },\n  \"spec\": {\n    \"template\": {\n      \"spec\": {\n        \"containers\": [\n          {\n            \"image\": \"registry.example.com/project/web:latest\",\n            \"name\": \"web\",\n            \"command\": [\n              \"/app/server\"\n            ],\n            \"args\": [\n              \"--port\",\n              \"8080\"\n            ],\n            \"workingDir\": \"/app\",\n            \"ports\": [\n              {\n                \"containerPort\": 8080,\n                \"name\": \"http1\"\n              }\n            ],\n            \"env\": [\n              {\n                \"name\": \"ENVIRONMENT\",\n                \"value\": \"production\"\n              }\n            ],\n            \"resources\": {\n              \"limits\": {\n                \"cpu\": \"1\",\n                \"memory\": \"512Mi\",\n                \"nvidia.com/gpu\": \"1\"\n              }\n            },\n            \"volumeMounts\": [\n              {\n                \"name\": \"cache\",\n                \"mountPath\": \"/cache\"\n              }\n            ],\n            \"startupProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/startup\",\n                \"httpHeaders\": [\n                  {\n                    \"name\": \"X-Probe\",\n                    \"value\": \"startup\"\n                  }\n                ]\n              },\n              \"initialDelaySeconds\": 2,\n              \"timeoutSeconds\": 5,\n              \"failureThreshold\": 6,\n              \"periodSeconds\": 10\n            },\n            \"livenessProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/live\"\n              },\n              \"initialDelaySeconds\": 5,\n              \"timeoutSeconds\": 5,\n              \"failureThreshold\": 3,\n              \"periodSeconds\": 10\n            },\n            \"readinessProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/ready\"\n              },\n              \"timeoutSeconds\": 5,\n              \"successThreshold\": 1,\n              \"failureThreshold\": 3,\n              \"periodSeconds\": 10\n            }\n          },\n          {\n            \"image\": \"registry.example.com/project/proxy:latest\",\n            \"name\": \"proxy\"\n          }\n        ],\n        \"containerConcurrency\": 80,\n        \"timeoutSeconds\": 300,\n        \"nodeSelector\": {\n          \"api.agentmachines.app/accelerator\": \"nvidia-l4\"\n        },\n        \"serviceAccountName\": \"service-account@example.iam\",\n        \"volumes\": [\n          {\n            \"name\": \"app-secret\",\n            \"secret\": {\n              \"secretName\": \"api-token\",\n              \"items\": [\n                {\n                  \"key\": \"latest\",\n                  \"path\": \"token\"\n                }\n              ]\n            }\n          },\n          {\n            \"name\": \"cache\",\n            \"emptyDir\": {\n              \"sizeLimit\": \"512Mi\",\n              \"medium\": \"Memory\"\n            }\n          },\n          {\n            \"name\": \"assets\",\n            \"csi\": {\n              \"driver\": \"gcsfuse.api.agentmachines.app\",\n              \"readOnly\": true,\n              \"volumeAttributes\": {\n                \"bucketName\": \"app-assets\",\n                \"mountOptions\": \"implicit-dirs,uid=1000\"\n              }\n            }\n          },\n          {\n            \"name\": \"shared\",\n            \"nfs\": {\n              \"server\": \"10.0.0.10\",\n              \"path\": \"/exports/shared\",\n              \"readonly\": true\n            }\n          }\n        ],\n        \"runtimeClassName\": \"base-image-update\"\n      },\n      \"metadata\": {\n        \"name\": \"web-00001\",\n        \"annotations\": {\n          \"autoscaling.agentmachines.app/minScale\": \"0\",\n          \"autoscaling.agentmachines.app/maxScale\": \"10\",\n          \"api.agentmachines.app/scaling-cpu-target\": \"60\",\n          \"api.agentmachines.app/scaling-concurrency-target\": \"80\",\n          \"api.agentmachines.app/cpu-throttling\": \"true\",\n          \"api.agentmachines.app/startup-cpu-boost\": \"true\",\n          \"api.agentmachines.app/sessionAffinity\": \"false\",\n          \"api.agentmachines.app/cloudsql-instances\": \"project:region:instance\",\n          \"api.agentmachines.app/execution-environment\": \"gen2\",\n          \"api.agentmachines.app/vpc-access-connector\": \"connector-name\",\n          \"api.agentmachines.app/vpc-access-egress\": \"private-ranges-only\",\n          \"api.agentmachines.app/network-interfaces\": \"[{\\\"network\\\":\\\"default\\\",\\\"subnetwork\\\":\\\"default\\\"}]\",\n          \"api.agentmachines.app/encryption-key\": \"projects/project/locations/global/keyRings/ring/cryptoKeys/key\",\n          \"api.agentmachines.app/container-dependencies\": \"{\\\"web\\\":[\\\"proxy\\\"]}\",\n          \"api.agentmachines.app/base-images\": \"{\\\"\\\":\\\"debian12\\\"}\",\n          \"api.agentmachines.app/gpu-zonal-redundancy-disabled\": \"false\"\n        }\n      }\n    },\n    \"traffic\": [\n      {\n        \"percent\": 90,\n        \"latestRevision\": true\n      },\n      {\n        \"percent\": 10,\n        \"revisionName\": \"web-00001\"\n      },\n      {\n        \"revisionName\": \"web-00001\",\n        \"tag\": \"stable\"\n      }\n    ]\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.agentmachines.app/apis/serving.agentmachines.app/v1/namespaces/project-123456/services', [
  'body' => '{
  "apiVersion": "serving.agentmachines.app/v1",
  "kind": "Service",
  "metadata": {
    "name": "web",
    "namespace": "project-123456",
    "labels": {
      "api.agentmachines.app/location": "us-central1"
    },
    "annotations": {
      "api.agentmachines.app/custom-audiences": "[\\"dashboard\\",\\"internal\\"]",
      "api.agentmachines.app/launch-stage": "GA",
      "api.agentmachines.app/description": "Public web service",
      "api.agentmachines.app/ingress": "all",
      "api.agentmachines.app/binary-authorization": "default",
      "api.agentmachines.app/binary-authorization-breakglass": "emergency rollout",
      "api.agentmachines.app/minScale": "0",
      "api.agentmachines.app/maxScale": "20",
      "api.agentmachines.app/function-target": "handler",
      "api.agentmachines.app/invoker-iam-disabled": "false",
      "api.agentmachines.app/iap-enabled": "false",
      "api.agentmachines.app/scalingMode": "automatic",
      "api.agentmachines.app/manualInstanceCount": "0"
    }
  },
  "spec": {
    "template": {
      "spec": {
        "containers": [
          {
            "image": "registry.example.com/project/web:latest",
            "name": "web",
            "command": [
              "/app/server"
            ],
            "args": [
              "--port",
              "8080"
            ],
            "workingDir": "/app",
            "ports": [
              {
                "containerPort": 8080,
                "name": "http1"
              }
            ],
            "env": [
              {
                "name": "ENVIRONMENT",
                "value": "production"
              }
            ],
            "resources": {
              "limits": {
                "cpu": "1",
                "memory": "512Mi",
                "nvidia.com/gpu": "1"
              }
            },
            "volumeMounts": [
              {
                "name": "cache",
                "mountPath": "/cache"
              }
            ],
            "startupProbe": {
              "httpGet": {
                "port": 8080,
                "path": "/healthz/startup",
                "httpHeaders": [
                  {
                    "name": "X-Probe",
                    "value": "startup"
                  }
                ]
              },
              "initialDelaySeconds": 2,
              "timeoutSeconds": 5,
              "failureThreshold": 6,
              "periodSeconds": 10
            },
            "livenessProbe": {
              "httpGet": {
                "port": 8080,
                "path": "/healthz/live"
              },
              "initialDelaySeconds": 5,
              "timeoutSeconds": 5,
              "failureThreshold": 3,
              "periodSeconds": 10
            },
            "readinessProbe": {
              "httpGet": {
                "port": 8080,
                "path": "/healthz/ready"
              },
              "timeoutSeconds": 5,
              "successThreshold": 1,
              "failureThreshold": 3,
              "periodSeconds": 10
            }
          },
          {
            "image": "registry.example.com/project/proxy:latest",
            "name": "proxy"
          }
        ],
        "containerConcurrency": 80,
        "timeoutSeconds": 300,
        "nodeSelector": {
          "api.agentmachines.app/accelerator": "nvidia-l4"
        },
        "serviceAccountName": "service-account@example.iam",
        "volumes": [
          {
            "name": "app-secret",
            "secret": {
              "secretName": "api-token",
              "items": [
                {
                  "key": "latest",
                  "path": "token"
                }
              ]
            }
          },
          {
            "name": "cache",
            "emptyDir": {
              "sizeLimit": "512Mi",
              "medium": "Memory"
            }
          },
          {
            "name": "assets",
            "csi": {
              "driver": "gcsfuse.api.agentmachines.app",
              "readOnly": true,
              "volumeAttributes": {
                "bucketName": "app-assets",
                "mountOptions": "implicit-dirs,uid=1000"
              }
            }
          },
          {
            "name": "shared",
            "nfs": {
              "server": "10.0.0.10",
              "path": "/exports/shared",
              "readonly": true
            }
          }
        ],
        "runtimeClassName": "base-image-update"
      },
      "metadata": {
        "name": "web-00001",
        "annotations": {
          "autoscaling.agentmachines.app/minScale": "0",
          "autoscaling.agentmachines.app/maxScale": "10",
          "api.agentmachines.app/scaling-cpu-target": "60",
          "api.agentmachines.app/scaling-concurrency-target": "80",
          "api.agentmachines.app/cpu-throttling": "true",
          "api.agentmachines.app/startup-cpu-boost": "true",
          "api.agentmachines.app/sessionAffinity": "false",
          "api.agentmachines.app/cloudsql-instances": "project:region:instance",
          "api.agentmachines.app/execution-environment": "gen2",
          "api.agentmachines.app/vpc-access-connector": "connector-name",
          "api.agentmachines.app/vpc-access-egress": "private-ranges-only",
          "api.agentmachines.app/network-interfaces": "[{\\"network\\":\\"default\\",\\"subnetwork\\":\\"default\\"}]",
          "api.agentmachines.app/encryption-key": "projects/project/locations/global/keyRings/ring/cryptoKeys/key",
          "api.agentmachines.app/container-dependencies": "{\\"web\\":[\\"proxy\\"]}",
          "api.agentmachines.app/base-images": "{\\"\\":\\"debian12\\"}",
          "api.agentmachines.app/gpu-zonal-redundancy-disabled": "false"
        }
      }
    },
    "traffic": [
      {
        "percent": 90,
        "latestRevision": true
      },
      {
        "percent": 10,
        "revisionName": "web-00001"
      },
      {
        "revisionName": "web-00001",
        "tag": "stable"
      }
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.agentmachines.app/apis/serving.agentmachines.app/v1/namespaces/project-123456/services");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"apiVersion\": \"serving.agentmachines.app/v1\",\n  \"kind\": \"Service\",\n  \"metadata\": {\n    \"name\": \"web\",\n    \"namespace\": \"project-123456\",\n    \"labels\": {\n      \"api.agentmachines.app/location\": \"us-central1\"\n    },\n    \"annotations\": {\n      \"api.agentmachines.app/custom-audiences\": \"[\\\"dashboard\\\",\\\"internal\\\"]\",\n      \"api.agentmachines.app/launch-stage\": \"GA\",\n      \"api.agentmachines.app/description\": \"Public web service\",\n      \"api.agentmachines.app/ingress\": \"all\",\n      \"api.agentmachines.app/binary-authorization\": \"default\",\n      \"api.agentmachines.app/binary-authorization-breakglass\": \"emergency rollout\",\n      \"api.agentmachines.app/minScale\": \"0\",\n      \"api.agentmachines.app/maxScale\": \"20\",\n      \"api.agentmachines.app/function-target\": \"handler\",\n      \"api.agentmachines.app/invoker-iam-disabled\": \"false\",\n      \"api.agentmachines.app/iap-enabled\": \"false\",\n      \"api.agentmachines.app/scalingMode\": \"automatic\",\n      \"api.agentmachines.app/manualInstanceCount\": \"0\"\n    }\n  },\n  \"spec\": {\n    \"template\": {\n      \"spec\": {\n        \"containers\": [\n          {\n            \"image\": \"registry.example.com/project/web:latest\",\n            \"name\": \"web\",\n            \"command\": [\n              \"/app/server\"\n            ],\n            \"args\": [\n              \"--port\",\n              \"8080\"\n            ],\n            \"workingDir\": \"/app\",\n            \"ports\": [\n              {\n                \"containerPort\": 8080,\n                \"name\": \"http1\"\n              }\n            ],\n            \"env\": [\n              {\n                \"name\": \"ENVIRONMENT\",\n                \"value\": \"production\"\n              }\n            ],\n            \"resources\": {\n              \"limits\": {\n                \"cpu\": \"1\",\n                \"memory\": \"512Mi\",\n                \"nvidia.com/gpu\": \"1\"\n              }\n            },\n            \"volumeMounts\": [\n              {\n                \"name\": \"cache\",\n                \"mountPath\": \"/cache\"\n              }\n            ],\n            \"startupProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/startup\",\n                \"httpHeaders\": [\n                  {\n                    \"name\": \"X-Probe\",\n                    \"value\": \"startup\"\n                  }\n                ]\n              },\n              \"initialDelaySeconds\": 2,\n              \"timeoutSeconds\": 5,\n              \"failureThreshold\": 6,\n              \"periodSeconds\": 10\n            },\n            \"livenessProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/live\"\n              },\n              \"initialDelaySeconds\": 5,\n              \"timeoutSeconds\": 5,\n              \"failureThreshold\": 3,\n              \"periodSeconds\": 10\n            },\n            \"readinessProbe\": {\n              \"httpGet\": {\n                \"port\": 8080,\n                \"path\": \"/healthz/ready\"\n              },\n              \"timeoutSeconds\": 5,\n              \"successThreshold\": 1,\n              \"failureThreshold\": 3,\n              \"periodSeconds\": 10\n            }\n          },\n          {\n            \"image\": \"registry.example.com/project/proxy:latest\",\n            \"name\": \"proxy\"\n          }\n        ],\n        \"containerConcurrency\": 80,\n        \"timeoutSeconds\": 300,\n        \"nodeSelector\": {\n          \"api.agentmachines.app/accelerator\": \"nvidia-l4\"\n        },\n        \"serviceAccountName\": \"service-account@example.iam\",\n        \"volumes\": [\n          {\n            \"name\": \"app-secret\",\n            \"secret\": {\n              \"secretName\": \"api-token\",\n              \"items\": [\n                {\n                  \"key\": \"latest\",\n                  \"path\": \"token\"\n                }\n              ]\n            }\n          },\n          {\n            \"name\": \"cache\",\n            \"emptyDir\": {\n              \"sizeLimit\": \"512Mi\",\n              \"medium\": \"Memory\"\n            }\n          },\n          {\n            \"name\": \"assets\",\n            \"csi\": {\n              \"driver\": \"gcsfuse.api.agentmachines.app\",\n              \"readOnly\": true,\n              \"volumeAttributes\": {\n                \"bucketName\": \"app-assets\",\n                \"mountOptions\": \"implicit-dirs,uid=1000\"\n              }\n            }\n          },\n          {\n            \"name\": \"shared\",\n            \"nfs\": {\n              \"server\": \"10.0.0.10\",\n              \"path\": \"/exports/shared\",\n              \"readonly\": true\n            }\n          }\n        ],\n        \"runtimeClassName\": \"base-image-update\"\n      },\n      \"metadata\": {\n        \"name\": \"web-00001\",\n        \"annotations\": {\n          \"autoscaling.agentmachines.app/minScale\": \"0\",\n          \"autoscaling.agentmachines.app/maxScale\": \"10\",\n          \"api.agentmachines.app/scaling-cpu-target\": \"60\",\n          \"api.agentmachines.app/scaling-concurrency-target\": \"80\",\n          \"api.agentmachines.app/cpu-throttling\": \"true\",\n          \"api.agentmachines.app/startup-cpu-boost\": \"true\",\n          \"api.agentmachines.app/sessionAffinity\": \"false\",\n          \"api.agentmachines.app/cloudsql-instances\": \"project:region:instance\",\n          \"api.agentmachines.app/execution-environment\": \"gen2\",\n          \"api.agentmachines.app/vpc-access-connector\": \"connector-name\",\n          \"api.agentmachines.app/vpc-access-egress\": \"private-ranges-only\",\n          \"api.agentmachines.app/network-interfaces\": \"[{\\\"network\\\":\\\"default\\\",\\\"subnetwork\\\":\\\"default\\\"}]\",\n          \"api.agentmachines.app/encryption-key\": \"projects/project/locations/global/keyRings/ring/cryptoKeys/key\",\n          \"api.agentmachines.app/container-dependencies\": \"{\\\"web\\\":[\\\"proxy\\\"]}\",\n          \"api.agentmachines.app/base-images\": \"{\\\"\\\":\\\"debian12\\\"}\",\n          \"api.agentmachines.app/gpu-zonal-redundancy-disabled\": \"false\"\n        }\n      }\n    },\n    \"traffic\": [\n      {\n        \"percent\": 90,\n        \"latestRevision\": true\n      },\n      {\n        \"percent\": 10,\n        \"revisionName\": \"web-00001\"\n      },\n      {\n        \"revisionName\": \"web-00001\",\n        \"tag\": \"stable\"\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "apiVersion": "serving.agentmachines.app/v1",
  "kind": "Service",
  "metadata": [
    "name": "web",
    "namespace": "project-123456",
    "labels": ["api.agentmachines.app/location": "us-central1"],
    "annotations": [
      "api.agentmachines.app/custom-audiences": "[\"dashboard\",\"internal\"]",
      "api.agentmachines.app/launch-stage": "GA",
      "api.agentmachines.app/description": "Public web service",
      "api.agentmachines.app/ingress": "all",
      "api.agentmachines.app/binary-authorization": "default",
      "api.agentmachines.app/binary-authorization-breakglass": "emergency rollout",
      "api.agentmachines.app/minScale": "0",
      "api.agentmachines.app/maxScale": "20",
      "api.agentmachines.app/function-target": "handler",
      "api.agentmachines.app/invoker-iam-disabled": "false",
      "api.agentmachines.app/iap-enabled": "false",
      "api.agentmachines.app/scalingMode": "automatic",
      "api.agentmachines.app/manualInstanceCount": "0"
    ]
  ],
  "spec": [
    "template": [
      "spec": [
        "containers": [
          [
            "image": "registry.example.com/project/web:latest",
            "name": "web",
            "command": ["/app/server"],
            "args": ["--port", "8080"],
            "workingDir": "/app",
            "ports": [
              [
                "containerPort": 8080,
                "name": "http1"
              ]
            ],
            "env": [
              [
                "name": "ENVIRONMENT",
                "value": "production"
              ]
            ],
            "resources": ["limits": [
                "cpu": "1",
                "memory": "512Mi",
                "nvidia.com/gpu": "1"
              ]],
            "volumeMounts": [
              [
                "name": "cache",
                "mountPath": "/cache"
              ]
            ],
            "startupProbe": [
              "httpGet": [
                "port": 8080,
                "path": "/healthz/startup",
                "httpHeaders": [
                  [
                    "name": "X-Probe",
                    "value": "startup"
                  ]
                ]
              ],
              "initialDelaySeconds": 2,
              "timeoutSeconds": 5,
              "failureThreshold": 6,
              "periodSeconds": 10
            ],
            "livenessProbe": [
              "httpGet": [
                "port": 8080,
                "path": "/healthz/live"
              ],
              "initialDelaySeconds": 5,
              "timeoutSeconds": 5,
              "failureThreshold": 3,
              "periodSeconds": 10
            ],
            "readinessProbe": [
              "httpGet": [
                "port": 8080,
                "path": "/healthz/ready"
              ],
              "timeoutSeconds": 5,
              "successThreshold": 1,
              "failureThreshold": 3,
              "periodSeconds": 10
            ]
          ],
          [
            "image": "registry.example.com/project/proxy:latest",
            "name": "proxy"
          ]
        ],
        "containerConcurrency": 80,
        "timeoutSeconds": 300,
        "nodeSelector": ["api.agentmachines.app/accelerator": "nvidia-l4"],
        "serviceAccountName": "service-account@example.iam",
        "volumes": [
          [
            "name": "app-secret",
            "secret": [
              "secretName": "api-token",
              "items": [
                [
                  "key": "latest",
                  "path": "token"
                ]
              ]
            ]
          ],
          [
            "name": "cache",
            "emptyDir": [
              "sizeLimit": "512Mi",
              "medium": "Memory"
            ]
          ],
          [
            "name": "assets",
            "csi": [
              "driver": "gcsfuse.api.agentmachines.app",
              "readOnly": true,
              "volumeAttributes": [
                "bucketName": "app-assets",
                "mountOptions": "implicit-dirs,uid=1000"
              ]
            ]
          ],
          [
            "name": "shared",
            "nfs": [
              "server": "10.0.0.10",
              "path": "/exports/shared",
              "readonly": true
            ]
          ]
        ],
        "runtimeClassName": "base-image-update"
      ],
      "metadata": [
        "name": "web-00001",
        "annotations": [
          "autoscaling.agentmachines.app/minScale": "0",
          "autoscaling.agentmachines.app/maxScale": "10",
          "api.agentmachines.app/scaling-cpu-target": "60",
          "api.agentmachines.app/scaling-concurrency-target": "80",
          "api.agentmachines.app/cpu-throttling": "true",
          "api.agentmachines.app/startup-cpu-boost": "true",
          "api.agentmachines.app/sessionAffinity": "false",
          "api.agentmachines.app/cloudsql-instances": "project:region:instance",
          "api.agentmachines.app/execution-environment": "gen2",
          "api.agentmachines.app/vpc-access-connector": "connector-name",
          "api.agentmachines.app/vpc-access-egress": "private-ranges-only",
          "api.agentmachines.app/network-interfaces": "[{\"network\":\"default\",\"subnetwork\":\"default\"}]",
          "api.agentmachines.app/encryption-key": "projects/project/locations/global/keyRings/ring/cryptoKeys/key",
          "api.agentmachines.app/container-dependencies": "{\"web\":[\"proxy\"]}",
          "api.agentmachines.app/base-images": "{\"\":\"debian12\"}",
          "api.agentmachines.app/gpu-zonal-redundancy-disabled": "false"
        ]
      ]
    ],
    "traffic": [
      [
        "percent": 90,
        "latestRevision": true
      ],
      [
        "percent": 10,
        "revisionName": "web-00001"
      ],
      [
        "revisionName": "web-00001",
        "tag": "stable"
      ]
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmachines.app/apis/serving.agentmachines.app/v1/namespaces/project-123456/services")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```