API Reference

RESTful API for programmatic infrastructure management

Authentication

All API requests require authentication using Bearer tokens.

curl -H "Authorization: Bearer YOUR_API_KEY" \
     https://api.infralogic.dev/v1/resources

Endpoints

GET /v1/resources

List all infrastructure resources

Response

{
  "resources": [
    {
      "id": "res_abc123",
      "type": "aws_instance",
      "status": "running",
      "ai_optimized": true,
      "cost_monthly": 145.50
    }
  ],
  "total": 47
}
POST /v1/resources

Create a new resource with AI optimization

Request Body

{
  "type": "aws_instance",
  "config": {
    "ami": "ami-0c55b159cbfafe1f0",
    "region": "us-east-1"
  },
  "ai_optimize": true,
  "optimization_goals": ["cost", "performance"]
}
GET /v1/agents

List active AI agents

Response

{
  "agents": [
    {
      "id": "agent_cost_opt",
      "name": "Cost Optimizer",
      "status": "active",
      "savings_monthly": 2340.00,
      "last_action": "2026-03-24T10:30:00Z"
    }
  ]
}
POST /v1/agents/execute

Trigger an agent action

Request Body

{
  "agent_id": "agent_cost_opt",
  "action": "analyze",
  "target_resources": ["res_abc123"]
}
POST /v1/deployments

Create a new deployment

Request Body

{
  "repository": "github.com/org/infra",
  "branch": "main",
  "ai_enabled": true,
  "auto_rollback": true
}
GET /v1/monitoring/metrics

Get real-time metrics

Query Parameters

  • resource_id - Filter by resource
  • timeframe - 1h, 24h, 7d, 30d

Rate Limits

  • Starter: 1,000 requests/hour
  • Professional: 10,000 requests/hour
  • Enterprise: Unlimited

SDKs

Node.js

npm install @infralogic/sdk

Python

pip install infralogic

Go

go get infralogic.dev/sdk