hypercli-sdk 0.7.1__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/PKG-INFO +1 -1
  2. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/claw.py +1 -1
  3. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/client.py +2 -0
  4. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/jobs.py +4 -0
  5. hypercli_sdk-0.8.0/hypercli/keys.py +62 -0
  6. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/pyproject.toml +1 -1
  7. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/.gitignore +0 -0
  8. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/README.md +0 -0
  9. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/__init__.py +0 -0
  10. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/billing.py +0 -0
  11. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/config.py +0 -0
  12. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/files.py +0 -0
  13. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/http.py +0 -0
  14. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/instances.py +0 -0
  15. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/job/__init__.py +0 -0
  16. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/job/base.py +0 -0
  17. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/job/comfyui.py +0 -0
  18. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/job/gradio.py +0 -0
  19. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/logs.py +0 -0
  20. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/renders.py +0 -0
  21. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/hypercli/user.py +0 -0
  22. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/tests/test_apply_params.py +0 -0
  23. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/tests/test_claw.py +0 -0
  24. {hypercli_sdk-0.7.1 → hypercli_sdk-0.8.0}/tests/test_graph_to_api.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hypercli-sdk
3
- Version: 0.7.1
3
+ Version: 0.8.0
4
4
  Summary: Python SDK for HyperCLI - GPU orchestration and LLM API
5
5
  Project-URL: Homepage, https://hypercli.com
6
6
  Project-URL: Documentation, https://docs.hypercli.com
@@ -143,7 +143,7 @@ class Claw:
143
143
  dev: Use dev API endpoint
144
144
  """
145
145
  self._http = http
146
- self._api_key = claw_api_key or http._api_key
146
+ self._api_key = claw_api_key or http.api_key
147
147
  self._dev = dev
148
148
  self._base_url = self.DEV_API_BASE if dev else self.CLAW_API_BASE
149
149
  self._openai = None
@@ -8,6 +8,7 @@ from .instances import Instances
8
8
  from .renders import Renders
9
9
  from .files import Files
10
10
  from .claw import Claw
11
+ from .keys import KeysAPI
11
12
 
12
13
 
13
14
  class HyperCLI:
@@ -55,6 +56,7 @@ class HyperCLI:
55
56
  self.instances = Instances(self._http)
56
57
  self.renders = Renders(self._http)
57
58
  self.files = Files(self._http)
59
+ self.keys = KeysAPI(self._http)
58
60
  self.claw = Claw(self._http, claw_api_key=claw_api_key, dev=claw_dev)
59
61
 
60
62
  @property
@@ -133,6 +133,7 @@ class Jobs:
133
133
  env: dict[str, str] = None,
134
134
  ports: dict[str, int] = None,
135
135
  auth: bool = False,
136
+ registry_auth: dict[str, str] = None,
136
137
  ) -> Job:
137
138
  """Create a new job.
138
139
 
@@ -147,6 +148,7 @@ class Jobs:
147
148
  env: Environment variables
148
149
  ports: Ports to expose. Use {"lb": port} for HTTPS load balancer
149
150
  auth: Enable Bearer token auth on load balancer (use with ports={"lb": port})
151
+ registry_auth: Private registry credentials {"username": "...", "password": "..."}
150
152
  """
151
153
  payload = {
152
154
  "docker_image": image,
@@ -165,6 +167,8 @@ class Jobs:
165
167
  payload["ports"] = ports
166
168
  if auth:
167
169
  payload["auth"] = auth
170
+ if registry_auth:
171
+ payload["registry_auth"] = registry_auth
168
172
 
169
173
  data = self._http.post("/api/jobs", json=payload)
170
174
  return Job.from_dict(data)
@@ -0,0 +1,62 @@
1
+ """API Keys management"""
2
+ from dataclasses import dataclass
3
+ from typing import List, Optional, TYPE_CHECKING
4
+
5
+ if TYPE_CHECKING:
6
+ from .http import HTTPClient
7
+
8
+
9
+ @dataclass
10
+ class ApiKey:
11
+ key_id: str
12
+ name: str
13
+ api_key: Optional[str] # Full key only on create
14
+ api_key_preview: Optional[str] # Masked key on list
15
+ last4: Optional[str]
16
+ is_active: bool
17
+ created_at: str
18
+ last_used_at: Optional[str]
19
+
20
+ @classmethod
21
+ def from_dict(cls, data: dict) -> "ApiKey":
22
+ return cls(
23
+ key_id=data.get("key_id", ""),
24
+ name=data.get("name", ""),
25
+ api_key=data.get("api_key"),
26
+ api_key_preview=data.get("api_key_preview"),
27
+ last4=data.get("last4"),
28
+ is_active=data.get("is_active", True),
29
+ created_at=data.get("created_at", ""),
30
+ last_used_at=data.get("last_used_at"),
31
+ )
32
+
33
+
34
+ class KeysAPI:
35
+ """API Keys management"""
36
+
37
+ def __init__(self, http: "HTTPClient"):
38
+ self._http = http
39
+
40
+ def create(self, name: str = "default") -> ApiKey:
41
+ """Create a new API key"""
42
+ data = self._http.post("/api/keys", json={"name": name})
43
+ return ApiKey.from_dict(data)
44
+
45
+ def list(self) -> List[ApiKey]:
46
+ """List all API keys (masked)"""
47
+ data = self._http.get("/api/keys")
48
+ return [ApiKey.from_dict(k) for k in data]
49
+
50
+ def get(self, key_id: str) -> ApiKey:
51
+ """Get a specific API key (masked)"""
52
+ data = self._http.get(f"/api/keys/{key_id}")
53
+ return ApiKey.from_dict(data)
54
+
55
+ def disable(self, key_id: str) -> dict:
56
+ """Deactivate an API key (irreversible)"""
57
+ return self._http.delete(f"/api/keys/{key_id}")
58
+
59
+ def rename(self, key_id: str, name: str) -> ApiKey:
60
+ """Rename an API key"""
61
+ data = self._http.patch(f"/api/keys/{key_id}", json={"name": name})
62
+ return ApiKey.from_dict(data)
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hypercli-sdk"
7
- version = "0.7.1"
7
+ version = "0.8.0"
8
8
  description = "Python SDK for HyperCLI - GPU orchestration and LLM API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes