Skip to main content
You are here: Releases

2.1 API Changelog

Enhanced Features

1. Improved Billing Granularity

  • Enhanced timezone support for accurate billing across regions

  • More precise date-time formatting for billing queries

  • Additional billing breakdown options (GPUaaS pools, shared storage)

  • Monthly comparison functionality

2. Pod Service Management

  • Complete service exposure workflow for GPU pods

  • Status monitoring for service exposure operations

  • Full CRUD operations for exposed pod services

3. Enhanced Team Management

  • More comprehensive team creation response

  • API key management integrated into team member data

  • Better policy and workspace information in team responses

New API Endpoints

Billing

Timezone Support for Billing Endpoints

All billing endpoints now include timezone parameter support and enhanced date-time formatting:

  • Enhanced Team Billing

    • GET /team-billing/{team_id}/{start_date}/{end_date}/{interval}/{timezone}

    • New Parameters: timezone (path parameter, enum: local, utc, defaults to utc in implementation)

    • Updated Parameters:

      • start_date, end_date: Now expect format YYYY-MM-DDTHH:MM:SS

      • interval: Now validates enum values (monthly, weekly, daily, hourly)

  • Enhanced Workspace Billing

    • GET /workspace-billing/{workspace_id}/{start_date}/{end_date}/{interval}/{timezone}

    • New Parameters: timezone (path parameter, enum: local, utc, defaults to utc in implementation)

    • Updated Parameters: Same date-time format and interval validation as team billing

  • Enhanced Team Billing Grouped by Workspace

    • GET /team-billing/group-by-workspace/{team_id}/{start_date}/{end_date}/{interval}/{timezone}

    • New Parameters: timezone (path parameter, enum: local, utc, defaults to utc in implementation)

New Billing Endpoints

  • GPUaaS Pool Billing

    • GET /team-billing/gpuaas-pool/{team_id}/{start_date}/{end_date}/{interval}/{region_id}/{timezone}

    • Get GPUaaS pool billing for a specific team within a date-time range, interval, region, and timezone

  • Shared Storage Billing

    • GET /team-billing/shared-storage/{team_id}/{start_date}/{end_date}/{interval}/{region_id}/{timezone}

    • Get shared storage billing for a specific team within a date-time range, interval, region, and timezone

  • Monthly Billing Comparison

    • GET /team-billing/monthly-comparison/{team_id}/{start_month}/{end_month}

    • Compare billing data between two specified months

GPUaaS Pool Management

New Pool Subscription Endpoints

  • All Teams Pool Subscriptions

    • GET /gpuaas/pool-subscriptions/all

    • Retrieve pool subscriptions across all teams with pagination

    • Example Request:

      curl -X GET \ "https://api.hostedai.com/api/gpuaas/pool-subscriptions/all?metric_window=last_24h&page=1&limit=10" \ -H "Authorization: Bearer YOUR_API_KEY"

    • Example Response:

      { "data": [ { "subscription_id": "sub_12345", "team_id": "550e8400-e29b-41d4-a716-446655440000", "pool_name": "GPU-A100-Pool-1", "status": "active", "vgpus_allocated": 8, "metrics": { "cpu_usage": 75.2, "memory_usage": 68.5, "gpu_utilization": 92.1 } } ], "pagination": { "page": 1, "limit": 10, "total": 25 } }

Enhanced Pool Information Endpoints

  • Pool Subscription by GPUaaS ID (Updated)

    • GET /gpuaas/pool-subscription (changed from /gpuaas/{gpuaas_id}/pool-subscription)

    • Parameters:

      • team_id (required)

      • gpuaas_id (optional, moved to query parameter)

      • metric_window (optional)

  • Pool Connection Information (Updated)

    • GET /gpuaas/connection-info (changed from /gpuaas/{gpuaas_id}/connection-info)

    • Parameters:

      • team_id (required)

      • gpuaas_id (optional, moved to query parameter)

      • search (optional)

Pod Service Management

New Pod Service Exposure APIs

  • Expose Pod Service

    • POST /pods/expose-service

    • Expose services running in GPU pods

    • Example Request:

      curl -X POST \ https://api.hostedai.com/api/pods/expose-service \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "pod_name": "gpu-training-pod-123", "service_name": "jupyter-notebook", "port": 8888, "protocol": "HTTP", "external_port": 443, "ssl_enabled": true }'

  • Get Pod Service Exposure Status

    • GET /pods/expose-service/status

    • Check the status of service exposure operations

    • Example Request:

      curl -X GET \ https://api.hostedai.com/api/pods/expose-service/status \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "service_id": "svc_789012", "pod_name": "gpu-training-pod-123" }'

  • Update Exposed Pod Service

    • PUT /pods/update-exposed-service

    • Modify configuration of exposed pod services

    • Example Request:

      curl -X PUT \ https://api.hostedai.com/api/pods/update-exposed-service \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "service_id": "svc_789012", "external_port": 8443, "ssl_enabled": false }'

  • Delete Exposed Pod Service

    • DELETE /pods/delete-exposed-service/{id}

    • Remove service exposure for specified pod service

    • Example Request:

      curl -X DELETE \ https://api.hostedai.com/api/pods/delete-exposed-service/svc_789012 \ -H "Authorization: Bearer YOUR_API_KEY"

Enhanced Pod Logs

  • Pod Logs (Updated)

    • GET /logs/pods (changed from /logs/pods/{gpuaas_id})

    • Parameters: Moved gpuaas_id to query parameter for more flexible filtering

Team Management

Enhanced Team Creation

  • Create Team (Enhanced Response)

    • POST /team

    • Enhanced Response: Now includes additional team member details, API keys, policy information, and workspace data

    • New Response Fields:

      • Expanded team member information including API keys

      • Enhanced policy information

      • Complete workspace details

Team Member API Key Management

  • Enhanced Team Member Data

    • Team member objects now include:

      • api_key: API key for team members

      • api_token: Boolean indicating if API token is available

      • expiry_date: API key expiration date

      • ip_whitelist: IP whitelist configuration

Modified API Endpoints

Parameter Changes

Billing Endpoints

All billing endpoints now enforce stricter parameter validation:

  • Interval Parameter: Now validates against enum values (monthly, weekly, daily, hourly)

  • Timezone Parameter: New required parameter with enum values (local, utc)

  • Date Format: Enhanced to support full date-time format YYYY-MM-DDTHH%3AMM%3ASS

Response Format Changes

Team Management

  • Team Creation Response: Enhanced with additional member, policy, and workspace information

  • Team Update Response: Now returns updated team object instead of status code only

URL Structure Changes

GPUaaS Endpoints

  • Pool Subscription: Path parameter gpuaas_id moved to optional query parameter

  • Connection Info: Path parameter gpuaas_id moved to optional query parameter

  • Refresh Connections: Parameters moved from path to query parameters

  • Pod Logs: Parameter gpuaas_id moved from path to query parameter

Removed API Endpoints

⚠️ Deprecated: The following endpoints have been removed and are no longer available:

GPUaaS Pool Management (Path Parameter Versions)

  • GET /gpuaas/{gpuaas_id}/pool-subscriptionRemoved

    • Replacement: GET /gpuaas/pool-subscription?team_id={team_id}&gpuaas_id={gpuaas_id}

  • GET /gpuaas/{gpuaas_id}/connection-infoRemoved

    • Replacement: GET /gpuaas/connection-info?team_id={team_id}&gpuaas_id={gpuaas_id}

Pod Logs (Path Parameter Version)

  • GET /logs/pods/{gpuaas_id}Removed

    • Replacement: GET /logs/pods?gpuaas_id={gpuaas_id}

Modified API Endpoints

Enhanced Billing Endpoints with Timezone Support

Team Billing (URL Structure Changed)

  • Old URL: GET /team-billing/{team_id}/{start_date}/{end_date}/{interval}

  • New URL: GET /team-billing/{team_id}/{start_date}/{end_date}/{interval}/{timezone}

New Example Request:

curl -X GET \ "https://api.hostedai.com/api/team-billing/550e8400-e29b-41d4-a716-446655440000/2024-10-01T00%3A00%3A00/2024-10-31T23%3A59%3A59/daily/utc" \ -H "Authorization: Bearer YOUR_API_KEY"

Key Changes Explained:

  • Optional timezone parameter added: Choose between utc or local (defaults to utc if not provided)

  • Enhanced date format: Now supports full datetime YYYY-MM-DDTHH:MM:SS (URL encoded as YYYY-MM-DDTHH%3AMM%3ASS)

  • Strict interval validation: Must be one of monthly, weekly, daily, hourly

  • User context: When timezone=local, uses the authenticated user's configured timezone

Workspace Billing (URL Structure Changed)

  • Old URL: GET /workspace-billing/{workspace_id}/{start_date}/{end_date}/{interval}

  • New URL: GET /workspace-billing/{workspace_id}/{start_date}/{end_date}/{interval}/{timezone}

New Example Request:

curl -X GET \ "https://api.hostedai.com/api/workspace-billing/ws-123/2024-10-01T00%3A00%3A00/2024-10-31T23%3A59%3A59/monthly/local" \ -H "Authorization: Bearer YOUR_API_KEY"

GPUaaS Pool Management (Parameter Structure Changed)

Pool Subscription Lookup

  • Old URL: GET /gpuaas/{gpuaas_id}/pool-subscription

  • New URL: GET /gpuaas/pool-subscription

Old Example Request (No longer works):

curl -X GET \ "https://api.hostedai.com/api/gpuaas/12345/pool-subscription?team_id=550e8400-e29b-41d4-a716-446655440000&metric_window=last_24h" \ -H "Authorization: Bearer YOUR_API_KEY"

New Example Request:

curl -X GET \ "https://api.hostedai.com/api/gpuaas/pool-subscription?team_id=550e8400-e29b-41d4-a716-446655440000&gpuaas_id=12345&metric_window=last_24h" \ -H "Authorization: Bearer YOUR_API_KEY"

Key Changes Explained:

  • Parameter location changed: gpuaas_id moved from URL path to query parameter

  • Optional gpuaas_id: Now optional - if omitted, returns subscriptions for all GPUaaS pools for the team

  • Enhanced filtering: Better support for team-based and cross-pool queries

Pool Connection Information

  • Old URL: GET /gpuaas/{gpuaas_id}/connection-info

  • New URL: GET /gpuaas/connection-info

Old Example Request (No longer works):

curl -X GET \ "https://api.hostedai.com/api/gpuaas/12345/connection-info?team_id=550e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer YOUR_API_KEY"

New Example Request:

curl -X GET \ "https://api.hostedai.com/api/gpuaas/connection-info?team_id=550e8400-e29b-41d4-a716-446655440000&gpuaas_id=12345&search=jupyter" \ -H "Authorization: Bearer YOUR_API_KEY"

Team Management (Response Format Changed)

Team Creation Response

Example Request (Same):

curl -X POST \ https://api.hostedai.com/api/team \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Development Team", "description": "Main development team for AI projects" }'

Old Response Format (No longer returned):

{ "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Development Team", "description": "Main development team for AI projects", "created_at": "2024-10-31T10:00:00Z" }

New Response Format:

{ "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Development Team", "description": "Main development team for AI projects", "created_at": "2024-10-31T10:00:00Z", "status": "active", "is_suspended": false, "has_pool_subscription": true, "members": [ { "email": "admin@company.com", "name": "Admin User", "api_key": "ak_7890123456789", "api_token": true, "expiry_date": "2025-10-31T10:00:00Z", "ip_whitelist": "192.168.1.0/24" } ], "policy_info": { "policy_id": "pol_123", "policy_name": "Standard GPU Policy" }, "workspaces": [ { "id": "ws_456", "name": "Default Workspace" } ] }

Key Changes Explained:

  • Enhanced member information: Now includes API key details, expiry dates, and IP whitelisting

  • Policy details: Complete policy information included

  • Workspace information: All associated workspaces listed

  • Status fields: Team status and suspension information included