Skip to content

List hardware configurations available for a space

GET /api/v5/spaces/hardware

Query the list of hardware configurations (server specifications) available for a space. Supports pagination and filtering by AI device type (CPU / NPU).

Access token support

  • AtomGit user access tokens

Anonymous access allowed

This endpoint allows anonymous access

Request parameters

Parameter Location Type Required Description
page query integer No Page number, starting from 1; default 1
per_page query integer No Number of items returned per page; default 20
ai_device_type query string No AI device type, enum: CPU / NPU; if omitted, hardware configurations of all types are returned

Response parameters

Field Type Always returned Nullable Description
page_num integer Yes No Current page number
page_size integer Yes No Number of items returned per page
total integer Yes No Total number of records
page_count integer Yes No Total number of pages
content array<object> Yes No Hardware configuration list

content array element object

Field Type Always returned Nullable Description
content[].id string Yes No Server identifier ID, example r150el8k9aqm4fpgcz7dt6oxs2inybhj
content[].name string Yes No Server specification name, such as "CPU basic 2 vCPU 16 GB"
content[].ram string Yes No Server memory size, in Gi or Mi, such as 500Mi, 1Gi
content[].cpu string Yes No Number of server CPU cores, such as 0.5, 1
content[].ai_accelerate object Yes Yes Specification of the server's AI accelerator card; may be null for ordinary CPU specifications

content[].ai_accelerate object

Field Type Always returned Nullable Description
content[].ai_accelerate.device string Yes Yes Device type, such as NVIDIA GPU V100 or Ascend NPU D910
content[].ai_accelerate.request string Yes Yes Number of devices requested, default 1
content[].ai_accelerate.v_ram integer Yes Yes Required video memory size, in GB, such as 16

Failure responses

400 Parameter error

{
  "error_code": 400,
  "error_code_name": "PARAMETER_ERROR",
  "error_message": "参数 page 类型不正确"
}

401 Unauthenticated

{
  "error_code": 401,
  "error_code_name": "UNAUTHORIZED",
  "error_message": "缺少或无效的访问令牌"
}

HTTP response status codes

Status code Description
200 Success (OK)
400 Parameter error (Bad Request)
401 Authentication required (Requires authentication)
403 Access forbidden (Forbidden)
500 Internal system error (Internal Server Error)

Request example

Parameter description

This endpoint allows anonymous access, so the access token may optionally be included in the example; ai_device_type is an optional parameter. The example filters the first page by NPU with 20 items per page. Replace <token> with your AtomGit user access token (optional; including it grants more complete permissions).

cURL

curl -X GET 'https://api.atomgit.com/api/v5/spaces/hardware?page=1&per_page=20&ai_device_type=NPU' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <token>'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/spaces/hardware?page=1&per_page=20&ai_device_type=NPU", {
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer <YOUR-TOKEN>",
  },
});

if (!response.ok) {
  throw new Error("请求失败: " + response.status);
}

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

Python

import requests

resp = requests.get(
    "https://api.atomgit.com/api/v5/spaces/hardware",
    params={"page": 1, "per_page": 20, "ai_device_type": "NPU"},
    headers={
        "Accept": "application/json",
        "Authorization": "Bearer <YOUR-TOKEN>",
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response Example

Status code: 200

{
  "page_num": 1,
  "page_size": 20,
  "total": 2,
  "page_count": 1,
  "content": [
    {
      "id": "r150el8k9aqm4fpgcz7dt6oxs2inybhj",
      "name": "CPU basic 2 vCPU 16 GB",
      "ram": "16Gi",
      "cpu": "2",
      "ai_accelerate": null
    },
    {
      "id": "a8c9d1e2f3b4a5c6d7e8f9a0b1c2d3e4",
      "name": "NPU basic 1 Ascend 910",
      "ram": "32Gi",
      "cpu": "8",
      "ai_accelerate": {
        "device": "Ascend NPU D910",
        "request": "1",
        "v_ram": 16
      }
    }
  ]
}

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc