Repository

sdk

<a href="https://www.ultralytics.com"> Ultralytics Platform API , generated from a pinned contract with interactive API reference renders the live contract directly and includes Py · License unknown · Install via pip · Maintenance unknown

License
Unknown
Output
Status
Interactive API reference
Available
Python SDK
Available

Specs

  • OutputStatus
  • Interactive API referenceAvailable
  • Python SDKAvailable
  • TypeScript SDKComing soon
  • Go SDKComing soon
  • Java SDKComing soon

README

<a href="https://www.ultralytics.com">

Ultralytics logo

</a>

English | 简体中文

🔌 Ultralytics SDKs

Ultralytics Actions
CI
Ultralytics Discord
Ultralytics Forums
Ultralytics Reddit

Typed SDKs for the Ultralytics Platform API, generated from a pinned contract with Ultralytics OpenAPI. The interactive API reference renders the live contract directly and includes Python SDK examples.

Output Status
Interactive API reference Available
Python SDK Available
TypeScript SDK Coming soon
Go SDK Coming soon
Java SDK Coming soon

🐍 Python

PyPI - Version Ultralytics Downloads PyPI - Python Version

Install the standalone ultralytics-platform package from PyPI in a Python >=3.11 environment. It has one lightweight runtime dependency (httpx) and does not install the larger ultralytics package:

uv pip install ultralytics-platform

Pass your Platform API key directly as shown below. Alternatively, set ULTRALYTICS_API_KEY and omit the api_key argument.

from ultralytics_platform import Platform

with Platform(api_key="YOUR_API_KEY") as client:
    datasets = client.datasets.list("your_username")
    training = client.training.start(model_id="model_id", train_args={"epochs": 10})
    model = client.models.retrieve("your_username", "project", "model")
    export = client.exports.create("your_username", "project", "model", format="onnx")
    deployment = client.deployments.create(
        "your_username",
        project="project",
        model="model",
        deployment="production",
        name="Production",
        region="us-central1",
    )

The asynchronous client exposes the same resource tree:

import asyncio

from ultralytics_platform import AsyncPlatform


async def main():
    async with AsyncPlatform(api_key="YOUR_API_KEY") as client:
        datasets = await client.datasets.list("your_username")


asyncio.run(main())

The package includes typed responses, multipart uploads, retries for temporary failures, structured API errors, custom HTTP clients, and context-manager cleanup. It requires Python 3.11 or newer.

🧩 One Contract, Multiple Outputs

Ultralytics Platform owns the API contract. This repository pins a versioned snapshot with its generated descendants:

Platform OpenAPI contract
    ├── openapi.json      # Versioned contract snapshot
    ├── README.python.md  # Python package README source
    └── sdk/
        ├── python/     # ultralytics-platform
        ├── typescript/ # coming soon
        ├── go/         # coming soon
        └── java/       # coming soon

openapi.config.json contains product and package configuration, including the source path for README.python.md. openapi.json and openapi.sha256 pin the exact consumed contract. Generated files are never edited manually; update the contract snapshot, configuration, package README source, or generator and regenerate.

🛠️ Validation

CI regenerates the Python SDK from the versioned contract with the main branch of Ultralytics OpenAPI, then fails on contract mismatch or generated drift. Pushes to main, scheduled runs, and manual runs detect upstream contract changes without breaking unrelated pull requests. CI also formats and lints Python, compiles the package, builds its wheel, installs through the Git subdirectory boundary, and exercises representative sync and async requests against a mock transport. The package version is the contract's info.version, so a contract version bump reaching main publishes ultralytics-platform to PyPI through trusted publishing.

💡 Contribute

Ultralytics thrives on community collaboration, and we deeply value your contributions! Please see our Contributing Guide for details on how you can get involved. We also encourage you to share your feedback through our Survey. A huge thank you 🙏 to all our contributors!

API shape changes belong in the Platform OpenAPI contract; generated files in this repository should not be edited directly.

Ultralytics open-source contributors

📄 License

📫 Contact

For bug reports or feature suggestions related to Ultralytics SDKs, please submit an issue via GitHub Issues. Join our Discord community for discussions and support!

<br>

Ultralytics GitHub space Ultralytics LinkedIn space Ultralytics Twitter space Ultralytics YouTube space Ultralytics TikTok space Ultralytics BiliBili space Ultralytics Discord