gpuai-sdk
Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 0.4.1
- Generator version: 7.24.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python 3.10+
Installation & Usage
pip install
Install from PyPI with pip install gpuai-sdk, or straight from the public source mirror:
pip install git+https://github.com/gpuai-dev/gpuai-python-sdk.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/gpuai-dev/gpuai-python-sdk.git)
Then import the package:
import gpuai_sdk
Setuptools
Install from a mirror checkout (run from the checkout root):
pip install --user .
(or sudo pip install . to install the package for all users)
Then import the package:
import gpuai_sdk
Tests
Execute pytest to run the tests.
Functions
Run a Python function on a GPU.ai GPU by calling it. The gpuai_sdk.functions client ships in this package (Python 3.10 or newer):
from gpuai_sdk.functions import function
@function(gpu="a100_80gb", pip=["torch"])
def gpu_name():
import torch
return torch.cuda.get_device_name(0)
print(gpu_name.remote()) # runs on GPU.ai, prints the GPU's name
Set GPUAI_API_KEY first. Guide: https://gpu.ai/docs/functions
Getting Started
Please follow the installation procedure and then run the following:
import os
import gpuai_sdk
from gpuai_sdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.gpu.ai/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = gpuai_sdk.Configuration(
host = "https://api.gpu.ai/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (gpuai_live_<24-base62>): bearerAuth
configuration = gpuai_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with gpuai_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = gpuai_sdk.AutolaunchApi(api_client)
autolaunch_rule_create = gpuai_sdk.AutolaunchRuleCreate() # AutolaunchRuleCreate |
idempotency_key = 'idempotency_key_example' # str | (optional)
try:
# Create an auto-launch rule (pre-approves a bounded, unattended spend)
api_response = api_instance.create_autolaunch_rule(autolaunch_rule_create, idempotency_key=idempotency_key)
print("The response of AutolaunchApi->create_autolaunch_rule:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling AutolaunchApi->create_autolaunch_rule: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.gpu.ai/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AutolaunchApi | create_autolaunch_rule | POST /autolaunch-rules | Create an auto-launch rule (pre-approves a bounded, unattended spend) |
| AutolaunchApi | delete_autolaunch_rule | DELETE /autolaunch-rules/{id} | Cancel an auto-launch rule |
| AutolaunchApi | disarm_autolaunch_rule | PATCH /autolaunch-rules/{id} | Disarm an auto-launch rule |
| AutolaunchApi | get_autolaunch_rule | GET /autolaunch-rules/{id} | Get an auto-launch rule |
| AutolaunchApi | list_autolaunch_rules | GET /autolaunch-rules | List auto-launch rules |
| BillingApi | create_crypto_deposit | POST /billing/deposits/crypto | Create a stablecoin deposit |
| BillingApi | download_invoice_pdf | GET /billing/invoices/{id}/pdf | Download an invoice PDF |
| BillingApi | get_balance | GET /billing/balance | Get the org credit balance |
| BillingApi | get_billing_details | GET /billing/details | Get billing details |
| BillingApi | get_deposit | GET /billing/deposits/{id} | Get one stablecoin deposit |
| BillingApi | get_spending_limit | GET /billing/spending-limit | Get the org spending limit |
| BillingApi | list_deposits | GET /billing/deposits | List stablecoin deposits |
| BillingApi | list_invoices | GET /billing/invoices | List invoices |
| BillingApi | update_billing_details | PATCH /billing/details | Update billing details |
| BillingApi | update_spending_limit | PUT /billing/spending-limit | Set the org spending limit |
| CommunityApi | delist_community_machine | POST /community/machines/{id}/delist | Delist a Community Cloud machine |
| CommunityApi | enable_community_supplier | POST /community/suppliers | Enable the Community Cloud supplier role |
| CommunityApi | get_community_supplier_me | GET /community/suppliers/me | Get the caller's Community Cloud supplier |
| CommunityApi | list_community_machines | GET /community/machines | List your Community Cloud machines |
| CommunityApi | reclaim_community_machine | POST /community/machines/{id}/reclaim | Reclaim a spot-tier Community Cloud machine |
| CommunityApi | register_community_machine | POST /community/machines | Register a Community Cloud machine |
| EnvironmentsApi | get_environments | GET /environments | List launch environments (no auth required) |
| FineTuningApi | cancel_fine_tuning_job | POST /fine_tuning/jobs/{id}/cancel | Cancel a fine-tuning job (OpenAI-compatible) |
| FineTuningApi | create_file | POST /files | Upload a fine-tuning dataset file (OpenAI-compatible) |
| FineTuningApi | create_fine_tuning_job | POST /fine_tuning/jobs | Create a managed fine-tuning job (OpenAI-compatible) |
| FineTuningApi | get_fine_tuning_job | GET /fine_tuning/jobs/{id} | Retrieve a fine-tuning job (OpenAI-compatible) |
| FineTuningApi | list_fine_tuning_job_events | GET /fine_tuning/jobs/{id}/events | List fine-tuning job events (OpenAI-compatible) |
| FineTuningApi | list_fine_tuning_jobs | GET /fine_tuning/jobs | List fine-tuning jobs (OpenAI-compatible) |
| FineTuningApi | retrieve_file | GET /files/{id} | Retrieve a file (OpenAI-compatible) |
| FunctionsApi | activate_function_version | POST /functions/{id}/versions/{version_id}/activate | Confirm a version's upload and make it current |
| FunctionsApi | cancel_function_run | POST /functions/{id}/runs/{run_id}/cancel | Cancel a run |
| FunctionsApi | create_function | POST /functions | Get or create a function by name |
| FunctionsApi | create_function_run | POST /functions/{id}/runs | Call a function |
| FunctionsApi | create_function_version | POST /functions/{id}/versions | Register a version of a function |
| FunctionsApi | delete_function | DELETE /functions/{id} | Delete a function |
| FunctionsApi | get_function | GET /functions/{id} | Get a function |
| FunctionsApi | get_function_run | GET /functions/{id}/runs/{run_id} | Get a run |
| FunctionsApi | get_function_run_logs | GET /functions/{id}/runs/{run_id}/logs | Read a run's output |
| FunctionsApi | list_function_runs | GET /functions/{id}/runs | List a function's runs |
| FunctionsApi | list_functions | GET /functions | List functions |
| GpuTypesApi | list_gpu_types | GET /gpu-types | List available GPU types (no auth required) |
| InferenceApi | cancel_video | POST /videos/{id}/cancel | Cancel a video generation job |
| InferenceApi | create_chat_completion | POST /chat/completions | Create a chat completion (OpenAI-compatible) |
| InferenceApi | create_embeddings | POST /embeddings | Create embeddings (OpenAI-compatible) |
| InferenceApi | create_image | POST /images/generations | Create image (OpenAI-compatible) |
| InferenceApi | create_video | POST /videos | Create a video generation job (async) |
| InferenceApi | get_model | GET /models/{id} | Get a specific model (OpenAI-compatible) |
| InferenceApi | get_video | GET /videos/{id} | Get a video generation job |
| InferenceApi | get_video_content | GET /videos/{id}/content | Download a completed video artifact |
| InferenceApi | list_models | GET /models | List available models (OpenAI-compatible) |
| InferenceApi | list_videos | GET /videos | List video generation jobs |
| InstancesApi | create_instance | POST /instances | Create an instance (async — returns 202 + Operation-Id header) |
| InstancesApi | delete_instance | DELETE /instances/{id} | Terminate an instance (idempotent) |
| InstancesApi | get_instance | GET /instances/{id} | Get an instance |
| InstancesApi | list_instances | GET /instances | List instances |
| InstancesApi | update_instance | PATCH /instances/{id} | Update an instance (rename only in v1) |
| MarketApi | get_market_history | GET /market-history | Get a GPU's price and availability over time |
| MetaApi | get_health | GET /health | Liveness probe |
| MetaApi | get_open_api_spec | GET /openapi.json | OpenAPI 3.1 specification |
| OperationsApi | get_operation | GET /operations/{id} | Get an async operation status |
| PricingApi | list_pricing | GET /pricing | List pricing per GPU type + region (no auth required) |
| RegistryCredentialsApi | create_registry_credential | POST /registry-credentials | Store a registry credential |
| RegistryCredentialsApi | delete_registry_credential | DELETE /registry-credentials/{id} | Delete a registry credential |
| RegistryCredentialsApi | list_registry_credentials | GET /registry-credentials | List registry credentials |
| SshKeysApi | create_ssh_key | POST /ssh-keys | Create an SSH key |
| SshKeysApi | delete_ssh_key | DELETE /ssh-keys/{id} | Delete an SSH key (idempotent — 404 on already-gone per D-07) |
| SshKeysApi | get_ssh_key | GET /ssh-keys/{id} | Get an SSH key |
| SshKeysApi | list_ssh_keys | GET /ssh-keys | List SSH keys |
| TemplatesApi | get_template | GET /templates/{id} | Get one deployable application template |
| TemplatesApi | list_templates | GET /templates | List deployable application templates |
| UsageApi | list_usage | GET /usage | Time-bucketed usage |
| WatchApi | create_watch_rule | POST /watch-rules | Create a watch rule |
| WatchApi | delete_watch_rule | DELETE /watch-rules/{id} | Delete a watch rule |
| WatchApi | get_watch_rule | GET /watch-rules/{id} | Get a watch rule |
| WatchApi | list_watch_rules | GET /watch-rules | List watch rules |
| WatchApi | update_watch_rule | PATCH /watch-rules/{id} | Update a watch rule |
| WebhooksApi | create_webhook_endpoint | POST /webhook-endpoints | Create a webhook endpoint |
| WebhooksApi | delete_webhook_endpoint | DELETE /webhook-endpoints/{id} | Delete a webhook endpoint |
| WebhooksApi | get_webhook_endpoint | GET /webhook-endpoints/{id} | Get a webhook endpoint |
| WebhooksApi | list_webhook_endpoints | GET /webhook-endpoints | List webhook endpoints |
Documentation For Models
- AutolaunchRule
- AutolaunchRuleCreate
- AutolaunchRuleDisarm
- AutolaunchRulePage
- Balance
- BillingDetails
- ChatChoice
- ChatCompletionRequest
- ChatCompletionResponse
- ChatMessage
- CommunityMachine
- CommunityMachineDelistResult
- CommunityMachineRegistration
- CommunitySupplier
- CreateCryptoDepositRequest
- CreateFineTuningJobRequest
- CreateFineTuningJobRequestGpuai
- CreateFineTuningJobRequestMethod
- CreateFineTuningJobRequestMethodLora
- CreateFunctionRequest
- CreateFunctionRunRequest
- CreateFunctionVersionRequest
- CreateInstanceRequest
- CreateInstanceRequestPortsInner
- CreateRegistryCredentialRequest
- CreateSshKeyRequest
- CreateWebhookEndpointRequest
- CryptoDeposit
- Embedding
- EmbeddingsRequest
- EmbeddingsRequestInput
- EmbeddingsResponse
- EmbeddingsUsage
- Environments
- FileObject
- FineTuningJob
- FineTuningJobError
- FineTuningJobEvent
- FineTuningJobEventList
- FineTuningJobList
- FineTuningJobMethod
- FrameworkVersion
- Function
- FunctionList
- FunctionReplicaCounts
- FunctionRun
- FunctionRunError
- FunctionRunList
- FunctionRunLogChunk
- FunctionRunLogs
- FunctionUpload
- FunctionVersion
- GPUType
- GPUTypePage
- GetHealth200Response
- ImagesGenerationsRequest
- ImagesResponse
- ImagesResponseDataInner
- ImagesResponseUsage
- IncludeItem
- Instance
- InstanceConnection
- InstancePage
- Invoice
- InvoiceList
- ListCommunityMachines200Response
- ListDeposits200Response
- ListRegistryCredentials200Response
- MarketHistoryPoint
- MarketHistoryResponse
- Model
- ModelList
- ModelParametersInner
- ModelPricing
- ModelRate
- OpenAIErrorEnvelope
- OpenAIErrorEnvelopeError
- Operation
- OperationError
- OperationResult
- PeakWindow
- Pricing
- PricingPage
- Problem
- RegisterCommunityMachineRequest
- RegistryCredential
- SSHKey
- SSHKeyPage
- SpendingLimit
- StreamOptions
- SupplierMachineView
- Template
- TemplateEnvInner
- TemplateList
- TemplatePortsInner
- UpdateBillingDetailsRequest
- UpdateInstanceRequest
- UpdateSpendingLimitRequest
- Usage
- UsageBucket
- UsagePage
- VMImage
- VideoCreateRequest
- VideoJob
- VideoList
- WatchRule
- WatchRuleCreate
- WatchRulePage
- WatchRuleUpdate
- WebhookEndpoint
- WebhookEndpointPage
Documentation For Authorization
Authentication schemes defined for the API:
bearerAuth
- Type: Bearer authentication (gpuai_live_<24-base62>)
Author
Metadata
Release files for gpuai-sdk 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gpuai_sdk-0.4.1.tar.gz | 162.9 kB | With provenance | Details for gpuai_sdk-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gpuai_sdk-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for gpuai_sdk-0.4.1-py3-none-any.whl |
Total release size: 461.9 kB
Release files / gpuai_sdk-0.4.1.tar.gz
| Download URL | gpuai_sdk-0.4.1.tar.gz |
|---|---|
| Size | 162.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
460e9431cb1d974f56f0aeb1de99040bf871408b7080a15143ce47be3fff22bb
|
|
BLAKE2b-256 checksum How to use checksums |
2db00985459e0a26b97da9242c7e799e61523ec22e14bd36604c1aca26fffa0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.
Transparency logRelease files / gpuai_sdk-0.4.1-py3-none-any.whl
| Download URL | gpuai_sdk-0.4.1-py3-none-any.whl |
|---|---|
| Size | 299.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6699f76e41b1125d063f22b696a3262c6d846795e2138a29de1f7ff6eae66d5
|
|
BLAKE2b-256 checksum How to use checksums |
2d6f429619b68da319146c0fc28c223d0978ef7b83dbc5a3c4fa583001337d2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.
Transparency logSecurity for gpuai-sdk 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for gpuai_sdk-0.4.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.