Skip to main content

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.1.0
  • Generator version: 7.24.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.10+

Installation & Usage

pip install

Once this package is published, install it from PyPI with pip install <package-name> (see the project page for the exact name). To install straight from the repository instead — the package lives in sdk/python/, not the repo root:

pip install "git+https://github.com/gpuai-dev/gpu-ai.git#subdirectory=sdk/python"

(you may need to run pip with root permission: sudo pip install "git+https://github.com/gpuai-dev/gpu-ai.git#subdirectory=sdk/python")

Then import the package:

import gpuai_sdk

Setuptools

Install from a repository checkout (run from the sdk/python/ directory):

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.

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.BillingApi(api_client)
    create_crypto_deposit_request = gpuai_sdk.CreateCryptoDepositRequest() # CreateCryptoDepositRequest | 

    try:
        # Create a stablecoin deposit
        api_response = api_instance.create_crypto_deposit(create_crypto_deposit_request)
        print("The response of BillingApi->create_crypto_deposit:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling BillingApi->create_crypto_deposit: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.gpu.ai/v1

Class Method HTTP request Description
BillingApi create_crypto_deposit POST /billing/deposits/crypto Create a stablecoin deposit
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 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_earnings GET /community/earnings Get your Community Cloud earnings
CommunityApi get_community_machine GET /community/machines/{id} Get one of your Community Cloud machines
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
CommunityApi update_community_machine PATCH /community/machines/{id} Update a Community Cloud machine's price
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)
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_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)
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)
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
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

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication (gpuai_live_<24-base62>)

Author

support@gpu.ai

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpuai_sdk-0.1.0.tar.gz (96.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpuai_sdk-0.1.0-py3-none-any.whl (188.9 kB view details)

Uploaded Python 3

File details

Details for the file gpuai_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: gpuai_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 96.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gpuai_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d3f017d26a9a7cf3f26225f39b5a1b6db33221f1d59e2a60ba11b02046330b4e
MD5 242d32e86115b372632b3dad170f7a8c
BLAKE2b-256 4432425f20bd544819a6c60cf2d0b184bb2a3f4de28cdcac1920ee96c33451f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpuai_sdk-0.1.0.tar.gz:

Publisher: sdk-release.yml on gpuai-dev/gpu-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gpuai_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gpuai_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 188.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gpuai_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9dea7680ae50e0fa8dc5b1df5b4d8d0badae664896174dfd6b8757fb5e44ba9f
MD5 9188d00fc6a1e398f4eea4c315ea4258
BLAKE2b-256 2b92d8ce17d7bc30684700c0e9b3e421865bac90c445cb3a1d9613d8c0d70092

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpuai_sdk-0.1.0-py3-none-any.whl:

Publisher: sdk-release.yml on gpuai-dev/gpu-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page