Introduction
Talos Linux exposes a comprehensive gRPC API for all system operations. The API provides complete control over node lifecycle, configuration, monitoring, and cluster management. Alltalosctl commands interact with Talos nodes through this gRPC API.
API Services
The Talos API is organized into three main services:MachineService
The primary service for node operations including:- Configuration management
- System lifecycle (reboot, shutdown, upgrade)
- Container and process management
- System monitoring and stats
- etcd cluster management
- File operations
ClusterService
Cluster-wide operations:- Health checks across multiple nodes
- Cluster validation
InspectService
Internal inspection and debugging:- Controller runtime dependencies
- Resource graphs
Authentication
Talos uses mutual TLS (mTLS) for API authentication. Each API request must include a valid client certificate signed by the Talos CA.Client Certificates
Client certificates are generated during cluster bootstrap and stored in thetalosconfig file. The certificate includes:
- Subject: Identifies the client
- Roles: Defines permissions (os:admin, os:reader, etc.)
- TTL: Certificate validity period (default: 365 days)
Generating Client Certificates
You can generate additional client certificates using the API:Connection
Endpoints
The API is exposed on port50000 by default. When connecting to a cluster, you can target:
- Specific node:
10.0.0.1:50000 - Control plane endpoint: Use the cluster endpoint from
talosconfig - Load balanced: Through a load balancer (recommended for production)
Transport Security
All API communication uses TLS 1.3 with strong cipher suites:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
Client Libraries
Official Go Client
The official Talos client library is written in Go:Using talosctl as a Client
Thetalosctl CLI tool is built on the Go client library and can be used as a reference implementation:
Building Custom Clients
You can build clients in any language that supports gRPC:- Get the proto definitions: Clone the Talos repository
- Generate code: Use
protocwith your language plugin - Implement authentication: Load client certificate and CA
- Create gRPC channel: Connect with TLS credentials
Request/Response Patterns
Unary RPCs
Most API methods use unary request-response:Server Streaming
Some methods stream data back to the client:Client Streaming
Upload operations use client streaming:Common Types
All API responses include metadata and common types. See Common Types for details.Error Handling
gRPC Status Codes
The API uses standard gRPC status codes:OK(0): SuccessCANCELLED(1): Operation cancelledINVALID_ARGUMENT(3): Invalid request parametersDEADLINE_EXCEEDED(4): Request timeoutNOT_FOUND(5): Resource not foundPERMISSION_DENIED(7): Insufficient permissionsUNAVAILABLE(14): Service unavailable
Error Details
Errors include additional context in the metadata:Multi-Node Requests
Many API calls can target multiple nodes simultaneously:API Versioning
The Talos API follows semantic versioning:- Major version: Breaking changes (reflected in proto package)
- Minor version: Backward-compatible additions
- Patch version: Backward-compatible fixes
Deprecation Policy
Deprecated methods include annotations indicating when they will be removed:Rate Limiting
The API does not enforce rate limiting, but clients should:- Implement exponential backoff on errors
- Avoid polling; use streaming RPCs where available
- Batch operations when possible
- Respect UNAVAILABLE status codes