This document describes the API for uploading and downloading Agent as Code tool binaries, following the Terraform release pattern.
The Agent as Code Binary API provides a Terraform-like interface for distributing binary releases of the agent-as-code CLI tool. It supports versioned releases with platform and architecture specific binaries.
Following the Terraform release pattern:
Terraform:
https://releases.hashicorp.com/terraform/1.12.2/terraform_1.12.2_windows_386.zip
Agent as Code: We have our own binary creating process as a common build for all OS.
https://api.myagentregistry.com/binary/releases/agent-as-code/MAJOR/MINOR/agent_as_code_VERSION_PLATFORM_ARCH.zip
windows- Microsoft Windowslinux- Linux distributionsdarwin- macOS
amd64- 64-bit x86 processorsarm64- 64-bit ARM processors386- 32-bit x86 processors (legacy)
Get a list of all available versions.
GET /binary/releases/agent-as-code/versionsResponse:
{
"success": true,
"versions": ["1.0.0", "1.1.0", "1.12.2"],
"count": 3
}Get all files available for a specific major.minor version.
GET /binary/releases/agent-as-code/{major}/{minor}/Example:
GET /binary/releases/agent-as-code/1/12/Response:
{
"success": true,
"major": 1,
"minor": 12,
"files": [
{
"filename": "agent_as_code_1.12.2_windows_amd64.zip",
"version": "1.12.2",
"platform": "windows",
"architecture": "amd64",
"size": 15728640,
"last_modified": "2024-01-15T10:30:00Z",
"download_url": "/binary/releases/agent-as-code/1/12/agent_as_code_1.12.2_windows_amd64.zip"
},
{
"filename": "agent_as_code_1.12.2_linux_amd64.zip",
"version": "1.12.2",
"platform": "linux",
"architecture": "amd64",
"size": 14857216,
"last_modified": "2024-01-15T10:30:00Z",
"download_url": "/binary/releases/agent-as-code/1/12/agent_as_code_1.12.2_linux_amd64.zip"
},
{
"filename": "agent_as_code_1.12.2_darwin_arm64.zip",
"version": "1.12.2",
"platform": "darwin",
"architecture": "arm64",
"size": 14234624,
"last_modified": "2024-01-15T10:30:00Z",
"download_url": "/binary/releases/agent-as-code/1/12/agent_as_code_1.12.2_darwin_arm64.zip"
}
],
"count": 3
}Download a specific binary release.
GET /binary/releases/agent-as-code/{major}/{minor}/agent_as_code_{version}_{platform}_{arch}.zipExamples:
GET /binary/releases/agent-as-code/1/12/agent_as_code_1.12.2_windows_amd64.zip
GET /binary/releases/agent-as-code/1/12/agent_as_code_1.12.2_linux_amd64.zip
GET /binary/releases/agent-as-code/1/12/agent_as_code_1.12.2_darwin_arm64.zipResponse:
{
"success": true,
"filename": "agent_as_code_1.12.2_windows_amd64.zip",
"content_type": "application/zip",
"content_length": 15728640,
"metadata": {
"version": "1.12.2",
"platform": "windows",
"architecture": "amd64",
"checksum": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"uploaded_at": "2024-01-15T10:30:00Z"
},
"file_data": "UEsDBBQAAAAIAA...", // Base64 encoded zip file
"checksum": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}Upload a new binary release. Requires authentication via Cognito JWT Bearer token.
POST /binary/releases/agent-as-code/{major}/{minor}/upload
Authorization: Bearer <token>
Content-Type: application/jsonRequest Body:
{
"version": "1.12.2",
"platform": "windows",
"architecture": "amd64",
"file_data": "UEsDBBQAAAAIAA...", // Base64 encoded zip file
"filename": "agent_as_code_1.12.2_windows_amd64.zip", // Optional, auto-generated if not provided
"checksum": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" // Optional, auto-calculated if not provided
}Response:
{
"success": true,
"message": "Binary uploaded successfully",
"release": {
"version": "1.12.2",
"major": 1,
"minor": 12,
"patch": 2,
"platform": "windows",
"architecture": "amd64",
"filename": "agent_as_code_1.12.2_windows_amd64.zip",
"s3_key": "releases/1/12/2/agent_as_code_1.12.2_windows_amd64.zip",
"file_size": 15728640,
"content_type": "application/zip",
"uploaded_at": "2024-01-15T10:30:00Z",
"checksum": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"download_url": "/binary/releases/agent-as-code/1/12/agent_as_code_1.12.2_windows_amd64.zip"
}
}Bucket: agent-as-code-{account}-{region}
releases/{major}/{minor}/{patch}/agent_as_code_{version}_{platform}_{arch}.zip
Examples:
releases/1/12/2/agent_as_code_1.12.2_windows_amd64.zip
releases/1/12/2/agent_as_code_1.12.2_linux_amd64.zip
releases/1/12/2/agent_as_code_1.12.2_darwin_arm64.zip
- Downloads: Public access (no authentication required)
- Uploads: Requires authentication via Cognito JWT token:
Bearer <cognito-jwt-token>
{
"error": "Bad Request",
"message": "Missing required fields: version, platform, architecture"
}{
"error": "Unauthorized",
"message": "Authentication token required for binary uploads"
}{
"error": "Not Found",
"message": "Binary not found"
}{
"error": "Internal Server Error",
"message": "Failed to upload binary: <details>"
}# Download latest version for current platform
curl -o agent_as_code.zip \
"https://api.myagentregistry.com/binary/releases/agent-as-code/1/12/agent_as_code_1.12.2_linux_amd64.zip"
# Extract and install
unzip agent_as_code.zip
chmod +x agent_as_code
sudo mv agent_as_code /usr/local/bin/# Upload new binary release
curl -X POST \
-H "Authorization: Bearer <your-token>" \
-H "Content-Type: application/json" \
-d '{
"version": "1.12.2",
"platform": "linux",
"architecture": "amd64",
"file_data": "'$(base64 -w 0 agent_as_code_1.12.2_linux_amd64.zip)'"
}' \
"https://api.myagentregistry.com/binary/releases/agent-as-code/1/12/upload"This API is designed to be consumed by:
- Agent as Code CLI: For self-updating functionality
- Package managers: Homebrew, apt, yum, etc.
- CI/CD pipelines: For automated builds and releases
- Installation scripts: For easy setup on various platforms
- Public Downloads: All binary downloads are publicly accessible to support easy installation
- Authenticated Uploads: Only authenticated users can upload new releases
- Checksum Verification: All binaries include SHA256 checksums for integrity verification
- S3 Security: Proper IAM policies and bucket policies ensure secure storage
- Rate Limiting: API Gateway provides built-in rate limiting and throttling