Skip to main content

uploadcenter

Official Python SDK for the UploadCenter API — presigned uploads, file processing, transforms, webhooks, AI generation, and more, fully typed and generated from UploadCenter's OpenAPI schema.

Install

pip install uploadcenter

Usage

import httpx

from uploadcenter import create_client
from uploadcenter.generated.api.uploads import (
    complete_upload_endpoint_v1_uploads_complete_post as complete_upload,
)
from uploadcenter.generated.api.uploads import (
    presign_upload_endpoint_v1_uploads_presign_post as presign_upload,
)
from uploadcenter.generated.models import CompleteUploadRequest, PresignUploadRequest

client = create_client(
    base_url="https://api.uploadcenter.com",
    token="sk_live_...",  # an API key from your project settings
)

presigned = presign_upload.sync(
    client=client,
    body=PresignUploadRequest(
        project_id="project_...",
        filename="photo.jpg",
        size_bytes=len(file_bytes),
        mime_type="image/jpeg",
        visibility="private",
    ),
)

httpx.put(
    presigned.upload_url,
    content=file_bytes,
    headers={"Content-Type": "image/jpeg"},
)

complete_upload.sync(
    client=client,
    body=CompleteUploadRequest(file_id=presigned.file_id),
)

Async equivalents (presign_upload.asyncio, complete_upload.asyncio, ...) are available for every endpoint — use them with httpx.AsyncClient and await your own PUT request.

Every module under uploadcenter.generated.api.<group> mirrors an OpenAPI tag (uploads, files, folders, projects, organizations, api_keys, domains, webhooks, notifications, usage, billing, auth, ai, brand_kit), and exposes four functions per endpoint: sync, sync_detailed, asyncio, asyncio_detailed. Request/response models live under uploadcenter.generated.models and mirror the OpenAPI schema directly.

AI generation

Image/video generation, editing, and semantic search — one provider per capability behind the scenes, swappable without any change to this SDK (see docs/media-ai-platform.md). Every generation call returns 202 immediately with a generation id; poll it (or listen for the ai.generation.completed/ai.generation.failed webhook) until it settles.

from uploadcenter.generated.api.ai import (
    generate_image_endpoint_v1_ai_images_generate_post as generate_image,
)
from uploadcenter.generated.api.ai import (
    get_generation_endpoint_v1_ai_generations_generation_id_get as get_generation,
)
from uploadcenter.generated.models import GenerateImageRequest

generation = generate_image.sync(
    client=client,
    body=GenerateImageRequest(
        project_id="project_...",
        prompt="a minimalist logo of a fox, flat vector style",
        use_brand_kit=True,  # pulls in this org's brand_kit colors/fonts as style guidance
    ),
)

# Poll until it settles, then read the resulting file id(s) from result.file_ids.
result = get_generation.sync(generation.id, client=client, project_id="project_...")

The ai module also has edit_image_endpoint_..., background_remove_endpoint_..., upscale_image_endpoint_..., image_variations_endpoint_..., analyze_image_endpoint_... (auto-tagging/captioning), generate_video_endpoint_..., image_to_video_endpoint_..., transcribe_video_endpoint_..., and semantic_search_endpoint_... (natural-language search over your files). uploadcenter.generated.api.files.similar_files_endpoint_... finds files with a similar AI-generated caption.

uploadcenter.generated.api.brand_kit manages the org-level brand kit (colors, fonts, logo) referenced above — get_brand_kit_endpoint_... and update_brand_kit_endpoint_....

Regenerating (maintainers)

openapi-python-client generate --url http://127.0.0.1:8000/openapi.json --output-path src/uploadcenter/generated --meta none --overwrite

Requires the API running locally (uvicorn app.main:app --reload from apps/api, or adjust the port if running via Docker Compose) and pip install openapi-python-client.

License

MIT

Metadata

Release files for uploadcenter 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uploadcenter 0.3.0
File Size Uploaded
uploadcenter-0.3.0.tar.gz 49.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uploadcenter 0.3.0
File Interpreter ABI Platform
uploadcenter-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 267.7 kB

Release files / uploadcenter-0.3.0.tar.gz

Download URL uploadcenter-0.3.0.tar.gz
Size 49.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8d06493cf0c1d2e8ff17f135e0d6cece9adc743a8a13098c19149c73f7f583ce
BLAKE2b-256 checksum
How to use checksums
aee0f470863daefe5265a16e2ed92c55dcddd0dec5970defee31b2cb98a50473
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / uploadcenter-0.3.0-py3-none-any.whl

Download URL uploadcenter-0.3.0-py3-none-any.whl
Size 218.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7ed539058d15bc84bf842f0035c664b1e555109be0188cb1ee5a011d17187ad
BLAKE2b-256 checksum
How to use checksums
0729a0b5aaacedaaef8c71048071e305383deffbe097f5a7798ca47536dcf57d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.4

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page