Xinference Cloud Python SDK
Official Python SDK for the Xinference Cloud management APIs: browse the deployable model catalog, create and manage model deployments, and issue inference API keys — all from Python.
Installation
pip install xinference-cloud
Requires Python 3.11 or later. The only runtime dependency is httpx.
Authentication
The SDK authenticates with an SDK management credential scoped to your organization. You can obtain one in two ways:
-
Console UI — the SDK Credentials page in the Xinference Cloud console (in development, rolling out soon).
-
Management API — while signed in to the console, create one via
POST /api/v1/organization/sdk-credentials:// Run in your browser DevTools console while signed in const res = await fetch("/api/v1/organization/sdk-credentials", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name: "my-sdk-credential" }), }); console.log((await res.json()).key);
The credential key is shown only once at creation time — store it securely. If you lose it, revoke the credential and create a new one.
Quickstart
from xinference_cloud import XinferenceCloud
client = XinferenceCloud(
base_url="https://<your-region>.cloud.xinference.co",
credential="<your-sdk-credential>",
)
with client:
# Browse the deployable model catalog
models = client.deployable_models.list(enabled_only=True)
# Deploy a model and wait until it is running
deployment = client.deployments.create(model_name="qwen2.5-instruct")
deployment = client.deployments.wait(deployment["id"], timeout=600)
# Issue an inference API key bound to the deployment
api_key = client.inference_api_keys.create(
name="production",
deployment_ids=[deployment["id"]],
)
Instead of passing arguments explicitly, you can set the
XINFERENCE_CLOUD_BASE_URL and XINFERENCE_CLOUD_CREDENTIAL environment
variables and construct the client with XinferenceCloud.from_env().
Resources
| Resource | Methods |
|---|---|
client.deployable_models |
list, get |
client.deployments |
create, list, list_page, get, wait, terminate, delete |
client.inference_api_keys |
list, list_deployment_options, create, update, revoke |
deployments.wait() polls a deployment until it reaches a target status
(running by default), raises RuntimeError if it enters a failure status,
and raises TimeoutError on timeout.
Error handling
API errors raise xinference_cloud.APIStatusError, which carries the HTTP
status_code, the server error code (when provided), and the raw
httpx.Response:
from xinference_cloud import APIStatusError
try:
client.deployments.get("unknown-id")
except APIStatusError as exc:
print(exc.status_code, exc.code, str(exc))
License
Metadata
Release files for xinference-cloud 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xinference_cloud-0.1.0.tar.gz | 11.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xinference_cloud-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.1 kB
Release files / xinference_cloud-0.1.0.tar.gz
| Download URL | xinference_cloud-0.1.0.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
697c3fa8778093d51a4659c0b1a5b591eac932b93fcf22f5ec297cf2f7183223
|
|
BLAKE2b-256 checksum How to use checksums |
1073cb9dc755ca49a6d6c38c0f7e340e3fefb601501b7b048c24f6d0546071a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Jul 11, 2026.
Transparency logRelease files / xinference_cloud-0.1.0-py3-none-any.whl
| Download URL | xinference_cloud-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5a3786017efab6d6198ddbece495141fd7613f659ae259c242b16132ddf1425
|
|
BLAKE2b-256 checksum How to use checksums |
2fe394a1b559459fb9396196f54c7ed072094a5155a9bc9b9028ef1e2383e154
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Jul 11, 2026.
Transparency log