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

# API Introduction

> Getting started with GMI Cloud APIs

## Welcome to GMI Cloud API

GMI Cloud provides comprehensive APIs for managing your cloud infrastructure, including container services, AI inference, and cluster management. Our APIs are designed to be RESTful, secure, and easy to integrate into your applications.

## Before You Start

<Warning>
  **Authentication Required**: All GMI Cloud APIs require authentication. You must be logged in and have valid API credentials to use these endpoints.
</Warning>

### Step 1: Create Your Account and Login

1. **Sign up** for a GMI Cloud account at [console.gmicloud.ai](https://console.gmicloud.ai)
2. **Verify your email** and complete the registration process
3. **Login** to your account to access the console

### Step 2: Obtain API Credentials

1. Navigate to **Organization Settings** in your console
2. Go to the **API Keys** section
3. **Create a new API key** for programmatic access
4. **Save your API key** securely (it will only be shown once)

### Step 3: Set Up Authentication

All API endpoints require Bearer token authentication:

```bash theme={null}
curl -X GET "https://console.gmicloud.ai/api/endpoint" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

## Quick Start Example: Creating a Container

Here's a step-by-step example of creating a container using our APIs:

### 1. First, list available container templates

```bash theme={null}
curl -X GET "https://console.gmicloud.ai/api/v1/templates" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

### 2. Create a new container workload

<Note>
  **Required Parameters**:

  * `idc`: Default value is "us-denver-1". Use the IDC API to get other available data center locations
  * `product`: Contact sales team to confirm the correct product ID for your needs
</Note>

```bash theme={null}
curl -X POST "https://console.gmicloud.ai/api/v1/containers" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-container",
    "templateId": "b89f653f-f080-40a9-8134-02dd6d213894",
    "count": 1,
    "product": "container.h200.x1",
    "idc": "us-denver-1",
    "envs": [
      {
        "name": "SSH_KEY",
        "value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB... your-ssh-public-key"
      }
    ]
  }'
```

<Note>
  **SSH Access**: Currently, SSH keys must be provided as environment variables during container creation. There's no separate SSH key management API yet.
</Note>

### 3. Monitor the container status

```bash theme={null}
curl -X GET "https://console.gmicloud.ai/api/v1/containers/my-container-id" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

### 4. Access your running container

Once your container is running with the SSH key configured, you can connect directly:

```bash theme={null}
ssh gmi@public-ip -p 22 -i your-private-key
```

The container will use the SSH public key you provided during creation for authentication.

## Complete Workflow

<Steps>
  <Step title="Login to GMI Cloud Console">
    Access [console.gmicloud.ai](https://console.gmicloud.ai) and sign in with your credentials.
  </Step>

  <Step title="Create API Key">
    Navigate to Organization Settings → API Keys and generate a new API key.
  </Step>

  <Step title="Choose Your Service">
    Select from IAM, IaaS, or IDC service APIs based on your needs.
  </Step>

  <Step title="Make API Calls">
    Use your API key in the Authorization header to interact with our services.
  </Step>

  <Step title="Monitor and Manage">
    Track your resources through both API calls and the web console.
  </Step>
</Steps>

## Need Help?

* 🔗 **Console Access**: [console.gmicloud.ai](https://console.gmicloud.ai)
* 📧 **Support**: [Contact our support team](https://www.gmicloud.ai/contact#sales)
* 📚 **Documentation**: Browse the specific API sections below for detailed endpoints
