API Client
The Scope3AI SDK provides both synchronous (Client) and
asynchronous (AsyncClient) HTTP clients for interacting
with the Scope3AI API.
All the commands from the AsyncClient can be invoked with the await.
scope3ai.api.client
Classes:
-
Client–Synchronous Client to the Scope3AI HTTP API
-
AsyncClient–Asynchronous Client to the Scope3AI HTTP API
-
ClientBase–Base client class for communicating with the Scope3AI HTTP API.
-
ClientCommands–Base class that implements the command methods for interacting with the Scope3AI API.
Client
AsyncClient
ClientBase
Base client class for communicating with the Scope3AI HTTP API.
Handles authentication and provides core request functionality for both synchronous and asynchronous clients.
Attributes:
-
api_key(Optional[str]) –API key for authentication, can be passed in or read from env var
-
api_url(Optional[str]) –URL for the API, defaults to production endpoint
Methods:
client
property
Obtain an httpx client for synchronous or asynchronous operation with the necessary authentication headers included.
ClientCommands
Base class that implements the command methods for interacting with the Scope3AI API. The execute_request method must be implemented by subclasses to handle the actual HTTP requests.
Methods:
-
add_model_alias–Add a new alias to a model
-
calculate_impact_big_query–Calculate AI model impact metrics for BigQuery
-
create_gpu–Create a GPU
-
create_model–Create a model
-
create_node–Create a custom node
-
delete_gpu–Delete a GPU
-
delete_model–Delete a model
-
delete_node–Delete a node (custom nodes only, unless admin)
-
execute_request–Execute an HTTP request to the Scope3AI API.
-
get_gpu–Get a specific GPU (global or custom)
-
get_impact–Get impact metrics for a task
-
get_model–Get a specific model (global or custom)
-
get_node–Get a specific node (global or custom)
-
list_gpus–List GPUs
-
list_models–List models
-
list_nodes–List nodes (both global and custom)
-
reload– -
remove_model_alias–Remove an alias from a model
-
status– -
update_gpu–Update a GPU
-
update_model–Update a model
-
update_node–Update a node (custom nodes only, unless admin)
add_model_alias
Add a new alias to a model
calculate_impact_big_query
calculate_impact_big_query(content: ImpactBigQueryRequest, with_response: Optional[bool] = True) -> ImpactBigQueryResponse
Calculate AI model impact metrics for BigQuery
create_gpu
create_gpu(content: GPUCreateRequest, with_response: Optional[bool] = True) -> GPU
Create a GPU
create_model
create_model(content: ModelCreateRequest, with_response: Optional[bool] = True) -> Model
Create a model
create_node
create_node(content: NodeCreateRequest, with_response: Optional[bool] = True) -> Node
Create a custom node
delete_model
Delete a model
delete_node
Delete a node (custom nodes only, unless admin)
execute_request
Execute an HTTP request to the Scope3AI API. Must be implemented by subclasses to handle synchronous or asynchronous requests.
get_gpu
get_gpu(gpu_id: str, with_response: Optional[bool] = True) -> GPU
Get a specific GPU (global or custom)
get_impact
get_impact(content: ImpactRequest, debug: Optional[bool] = None, with_response: Optional[bool] = True) -> ImpactResponse
Get impact metrics for a task
get_model
get_model(model_id: str, with_response: Optional[bool] = True) -> Model
Get a specific model (global or custom)
get_node
get_node(node_id: str, with_response: Optional[bool] = True) -> Node
Get a specific node (global or custom)
list_models
list_models(family: Optional[Family] = None, with_response: Optional[bool] = True) -> ModelResponse
List models
list_nodes
list_nodes(service: Optional[str] = None, cloud: Optional[str] = None, custom: Optional[bool] = None, gpu: Optional[str] = None, instance: Optional[str] = None, with_response: Optional[bool] = True) -> NodeResponse
List nodes (both global and custom)
remove_model_alias
Remove an alias from a model
update_gpu
update_gpu(gpu_id: str, content: GPUUpdateRequest, with_response: Optional[bool] = True) -> GPU
Update a GPU
update_model
update_model(model_id: str, content: ModelUpdateRequest, with_response: Optional[bool] = True) -> Model
Update a model
update_node
update_node(node_id: str, content: NodeUpdateRequest, with_response: Optional[bool] = True) -> Node
Update a node (custom nodes only, unless admin)