Skip to main content

Python SDK for the AiUtils Developer API — 100+ AI models via one unified API

Project description

AiUtils Python SDK

Official Python SDK for the AiUtils Developer API — access 100+ AI models (LLM, image, video, audio, 3D) through one unified API.

Install

pip install aiutils-sdk

Quick Start

from aiutils_sdk import AiUtils

client = AiUtils(api_key="ak-dev-YOUR_KEY")

# Chat completion (OpenAI-compatible)
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Explain quantum computing in one sentence."}],
)
print(response.choices[0].message.content)

# Image generation
image = client.images.generate.generate(
    model="fal:fal-ai/flux/dev",
    prompt="A futuristic city at sunset, cyberpunk style",
)
print(image.data[0].url)

# Video generation (async with auto-polling)
video = client.generations.create(
    model="fal:fal-ai/kling-video/v1.6/pro/image-to-video",
    parameters={"prompt": "Camera orbits a mountain lake", "image_url": "..."},
    wait_for_completion=True,
    timeout=300,
)
print(video.download_urls)

# Embeddings
embeddings = client.embeddings.create.create(
    model="text-embedding-3-small",
    input="Hello world",
)
print(len(embeddings.data[0].embedding))

# Browse model catalog
models = client.models.list(category="image", vendor="fal")
for m in models.data:
    print(f"{m.id}{m.label}")

API Reference

AiUtils(api_key, base_url=..., timeout=60.0)

Param Type Default Description
api_key str required Your developer API key (ak-dev-...)
base_url str https://developer-api.aiutils.io API base URL
timeout float 60.0 Request timeout in seconds

Resources

  • client.chat.completions.create(...) — OpenAI-compatible chat completions
  • client.images.generate.generate(...) — Image generation
  • client.embeddings.create.create(...) — Text embeddings
  • client.generations.create(...) — Universal generation (image/video/audio/3D)
  • client.generations.get(id) — Poll generation status
  • client.models.list(...) — Browse model catalog
  • client.models.get(id) — Get model details + schemas

Error Handling

from aiutils_sdk import AiUtils, AuthenticationError, InsufficientDTError, RateLimitError

try:
    response = client.chat.completions.create(...)
except AuthenticationError:
    print("Bad API key")
except InsufficientDTError:
    print("Top up your DT balance")
except RateLimitError:
    print("Slow down")

Context Manager

with AiUtils(api_key="ak-dev-YOUR_KEY") as client:
    response = client.chat.completions.create(...)

Billing

All usage is billed in DT (Developer Tokens). 1 DT = $0.001 USD. Cost = provider cost + 8% platform fee.

Links

Project details


Download files

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

Source Distribution

aiutils_sdk-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

aiutils_sdk-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiutils_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for aiutils_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8c6f9016c63d5a20a4ebc8336c24c4e96b9230041d0a6424a43e86ebb623fe7b
MD5 10755c3e169c763a8f6e5e9e2ac92b85
BLAKE2b-256 7edba43c4e725335ccbf369d0b155d6fc10c6e70d873dfc986219a2cbbfd70cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aiutils_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for aiutils_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d41f1fdd810716905d9b4bf24dedf28fb93494800984b6cc4d45c45b72d5c94f
MD5 7b0b9029f078dd358b6ddde3a135af3b
BLAKE2b-256 ce0477770e4aaeb8b814ad9de9172cce8a0d454c96b452c82f290ff04d80b186

See more details on using hashes here.

Supported by

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