> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wistx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Design Architecture

> Design and initialize DevOps/infrastructure/SRE/platform engineering projects

Design and initialize DevOps/infrastructure/SRE/platform engineering projects with intelligent context from templates, compliance requirements, security knowledge, and best practices.

<ParamField body="action" type="string" required>
  Action to perform: `initialize`, `design`, `review`, `optimize`
</ParamField>

<ParamField body="project_type" type="string">
  Type of project: `terraform`, `kubernetes`, `devops`, `platform`
</ParamField>

<ParamField body="project_name" type="string">
  Name of the project (required for initialize action)
</ParamField>

<ParamField body="architecture_type" type="string">
  Architecture pattern: `microservices`, `serverless`, `monolith`
</ParamField>

<ParamField body="cloud_provider" type="string">
  Cloud provider: `aws`, `gcp`, `azure`, `multi-cloud`
</ParamField>

<ParamField body="compliance_standards" type="string[]">
  Compliance standards to include (e.g., `["PCI-DSS", "HIPAA"]`)
</ParamField>

<ParamField body="requirements" type="object">
  Project requirements dictionary
</ParamField>

<ParamField body="existing_architecture" type="string">
  Existing architecture code/documentation (for review/optimize actions)
</ParamField>

<ParamField body="output_directory" type="string" default=".">
  Directory to create project
</ParamField>

<ParamField body="template_id" type="string">
  Template ID from MongoDB registry
</ParamField>

<ParamField body="github_url" type="string">
  GitHub repository URL for template
</ParamField>

<ParamField body="user_template" type="object">
  User-provided template dictionary
</ParamField>

<ParamField body="include_compliance" type="boolean" default="true">
  Include compliance requirements context
</ParamField>

<ParamField body="include_security" type="boolean" default="true">
  Include security knowledge context
</ParamField>

<ParamField body="include_best_practices" type="boolean" default="true">
  Include best practices from knowledge base
</ParamField>

## Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.wistx.ai/v1/architecture/design" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "action": "initialize",
      "project_type": "terraform",
      "project_name": "my-infrastructure",
      "cloud_provider": "aws",
      "compliance_standards": ["PCI-DSS"],
      "include_compliance": true,
      "include_security": true,
      "include_best_practices": true
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.wistx.ai/v1/architecture/design"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
  }
  data = {
      "action": "initialize",
      "project_type": "terraform",
      "project_name": "my-infrastructure",
      "cloud_provider": "aws",
      "compliance_standards": ["PCI-DSS"],
      "include_compliance": True,
      "include_security": True,
      "include_best_practices": True
  }

  response = requests.post(url, json=data, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.wistx.ai/v1/architecture/design", {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      action: "initialize",
      project_type: "terraform",
      project_name: "my-infrastructure",
      cloud_provider: "aws",
      compliance_standards: ["PCI-DSS"],
      include_compliance: true,
      include_security: true,
      include_best_practices: true
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "net/http"
  )

  func main() {
      url := "https://api.wistx.ai/v1/architecture/design"
      data := map[string]interface{}{
          "action": "initialize",
          "project_type": "terraform",
          "project_name": "my-infrastructure",
          "cloud_provider": "aws",
          "compliance_standards": []string{"PCI-DSS"},
          "include_compliance": true,
          "include_security": true,
          "include_best_practices": true,
      }
      
      jsonData, _ := json.Marshal(data)
      req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
      req.Header.Set("Content-Type", "application/json")
      
      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()
  }
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'

  uri = URI('https://api.wistx.ai/v1/architecture/design')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri.path)
  request['Authorization'] = 'Bearer YOUR_API_KEY'
  request['Content-Type'] = 'application/json'
  request.body = {
    action: "initialize",
    project_type: "terraform",
    project_name: "my-infrastructure",
    cloud_provider: "aws",
    compliance_standards: ["PCI-DSS"],
    include_compliance: true,
    include_security: true,
    include_best_practices: true
  }.to_json

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

  ```php PHP theme={null}
  <?php

  $url = "https://api.wistx.ai/v1/architecture/design";
  $data = [
      "action" => "initialize",
      "project_type" => "terraform",
      "project_name" => "my-infrastructure",
      "cloud_provider" => "aws",
      "compliance_standards" => ["PCI-DSS"],
      "include_compliance" => true,
      "include_security" => true,
      "include_best_practices" => true
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer YOUR_API_KEY",
      "Content-Type: application/json"
  ]);

  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ```

  ```java Java theme={null}
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.URI;
  import java.nio.charset.StandardCharsets;

  HttpClient client = HttpClient.newHttpClient();
  String json = "{\"action\":\"initialize\",\"project_type\":\"terraform\",\"project_name\":\"my-infrastructure\",\"cloud_provider\":\"aws\",\"compliance_standards\":[\"PCI-DSS\"],\"include_compliance\":true,\"include_security\":true,\"include_best_practices\":true}";

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.wistx.ai/v1/architecture/design"))
      .header("Authorization", "Bearer YOUR_API_KEY")
      .header("Content-Type", "application/json")
      .POST(HttpRequest.BodyPublishers.ofString(json))
      .build();

  HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```
</CodeGroup>

## Response Example

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "data": {
      "action": "initialize",
      "project_name": "my-infrastructure",
      "architecture": {
        "structure": {
          "modules": ["vpc", "rds", "ecs"],
          "environments": ["dev", "prod"]
        },
        "files": ["main.tf", "variables.tf", "outputs.tf"]
      },
      "templates": [
        {
          "template_id": "terraform-aws-base",
          "name": "AWS Base Infrastructure"
        }
      ],
      "compliance_context": {
        "standards": ["PCI-DSS"],
        "controls": 45
      },
      "security_context": {
        "best_practices": ["encryption at rest", "network isolation"]
      },
      "best_practices": [
        {
          "title": "Use VPC for network isolation",
          "description": "Create VPC with private subnets"
        }
      ],
      "recommendations": [
        "Enable encryption for RDS instances",
        "Use IAM roles instead of access keys"
      ],
      "output_files": [
        {
          "path": "main.tf",
          "size": 1024
        }
      ]
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123,
      "query_time_ms": 1200
    }
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Invalid request parameters",
      "details": "project_type and project_name are required for initialize"
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123
    }
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": {
      "code": "UNAUTHORIZED",
      "message": "Invalid or expired token"
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123
    }
  }
  ```

  ```json 429 Too Many Requests theme={null}
  {
    "error": {
      "code": "QUOTA_EXCEEDED",
      "message": "Query quota exceeded",
      "details": {
        "limit_type": "queries_per_month",
        "current": 1000,
        "limit": 1000
      }
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123
    }
  }
  ```

  ```json 500 Internal Server Error theme={null}
  {
    "error": {
      "code": "INTERNAL_ERROR",
      "message": "An unexpected error occurred"
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123
    }
  }
  ```

  ```json 503 Service Unavailable theme={null}
  {
    "error": {
      "code": "DATABASE_ERROR",
      "message": "Database connection failed"
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123
    }
  }
  ```
</ResponseExample>

## Rate Limits

* **Professional**: 2,000 queries/month
* **Team**: 10,000 queries/month
* **Enterprise**: Unlimited queries/month


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.