Skip to main content

Scalix SDK — Python client for chat, research, audio, images, text, RAG, docgen, database, storage, and account APIs.

Project description

Scalix SDK — Python

Python client for the Scalix API. Provides async access to chat, research, audio, images, text, RAG, document generation, database, storage, and account management.

Installation

pip install scalix

Quick Start

from scalix import ScalixClient

scalix = ScalixClient(api_key="sk_scalix_...")

# Chat completion (OpenAI-compatible)
result = await scalix.chat.complete(
    messages=[{"role": "user", "content": "Hello!"}],
    model="scalix-world-ai",
)

# Streaming chat
async for chunk in scalix.chat.stream(
    messages=[{"role": "user", "content": "Tell me a story"}],
    model="scalix-world-ai",
):
    print(chunk, end="")

# Web search
results = await scalix.research.search("quantum computing")

# Deep research
deep = await scalix.research.deep("compare fusion reactor designs")

# Text-to-speech
audio = await scalix.audio.speak("Hello world", voice="af_heart")

# Audio transcription
with open("audio.mp3", "rb") as f:
    transcript = await scalix.audio.transcribe(f)

# Image generation
image = await scalix.images.generate("A sunset over mountains")
job = await scalix.images.generate_async("A detailed cityscape")

# Text utilities
sentiment = await scalix.text.sentiment("I love this product!")
summary = await scalix.text.summarize(long_article)
translated = await scalix.text.translate("Hello", target_language="es")

# RAG — upload and query documents
doc = await scalix.rag.upload(pdf_file, filename="report.pdf")
hits = await scalix.rag.query("revenue growth")

# Document generation
report = await scalix.docgen.create(prompt="Q1 report", format="pdf")

# ScalixDB
dbs = await scalix.database.list_databases()
result = await scalix.database.query(db_id, "SELECT * FROM users")

# Account — manage API keys
keys = await scalix.account.list_api_keys()
new_key = await scalix.account.create_api_key("production-key")

# Usage tracking
usage = await scalix.account.usage(start_date="2026-04-01")

Configuration

from scalix import ScalixClient

scalix = ScalixClient(
    api_key="sk_scalix_...",
    base_url="https://api.scalix.world",  # default
)

Environment Variables

Variable Description
SCALIX_API_KEY Scalix API key
SCALIX_BASE_URL Override API base URL (default: https://api.scalix.world)

API Reference

Chat

Method Endpoint SDK Method
POST /v1/chat/completions scalix.chat.complete(messages)
POST /v1/chat/completions scalix.chat.stream(messages) (streaming)
GET /v1/models scalix.chat.models()

Research

Method Endpoint SDK Method
POST /v1/research/search scalix.research.search(query)
POST /v1/research scalix.research.research(query)
POST /v1/research/deep scalix.research.deep(query)

Audio

Method Endpoint SDK Method
POST /v1/audio/transcribe scalix.audio.transcribe(file)
POST /v1/audio/speak/kokoro scalix.audio.speak(text)
GET /v1/audio/kokoro/voices scalix.audio.voices()
GET /v1/audio/kokoro/languages scalix.audio.languages()

Images

Method Endpoint SDK Method
POST /v1/images/generate scalix.images.generate(prompt)
POST /v1/images/generate/queue scalix.images.generate_async(prompt)
GET /v1/images/jobs/{jobId} scalix.images.get_job(job_id)
GET /v1/images/jobs/{jobId}/result scalix.images.get_job_result(job_id)
GET /v1/images/models scalix.images.models()

Text

Method Endpoint SDK Method
POST /v1/text/sentiment scalix.text.sentiment(text)
POST /v1/text/summarize scalix.text.summarize(text)
POST /v1/text/translate scalix.text.translate(text, target_language)

RAG

Method Endpoint SDK Method
POST /v1/rag/upload scalix.rag.upload(file)
POST /v1/rag/query scalix.rag.query(query)
GET /v1/rag/documents scalix.rag.documents()
DELETE /v1/rag/documents/{docId} scalix.rag.delete_document(doc_id)

Document Generation

Method Endpoint SDK Method
POST /v1/docgen/create scalix.docgen.create(prompt, format)
POST /v1/docgen/preview scalix.docgen.preview(prompt)
GET /v1/docgen/formats scalix.docgen.formats()
GET /v1/docgen/templates scalix.docgen.templates()
GET /v1/docgen/history scalix.docgen.history()
POST /v1/docgen/revise scalix.docgen.revise(doc_id, prompt)
GET /v1/docgen/versions/{docId} scalix.docgen.versions(doc_id)

Storage

Method Endpoint SDK Method
POST /v1/storage/upload-url scalix.storage.get_upload_url(mime_type)

ScalixDB

Method Endpoint SDK Method
GET /api/scalixdb/databases scalix.database.list_databases()
POST /api/scalixdb/databases scalix.database.create_database(name)
GET /api/scalixdb/databases/{id} scalix.database.get_database(db_id)
DELETE /api/scalixdb/databases/{id} scalix.database.delete_database(db_id)
POST /api/scalixdb/databases/{id}/query scalix.database.query(db_id, sql)
GET /api/scalixdb/databases/{id}/tables scalix.database.tables(db_id)
GET /api/scalixdb/databases/{id}/metrics scalix.database.metrics(db_id)

Account

Method Endpoint SDK Method
GET /health scalix.account.health()
GET /api/dashboard/api-keys scalix.account.list_api_keys()
POST /api/dashboard/api-keys scalix.account.create_api_key(name)
DELETE /api/dashboard/api-keys/{id} scalix.account.delete_api_key(key_id)
GET /api/billing/usage scalix.account.usage()

Error Handling

from scalix import ScalixClient, ScalixError, AuthenticationError

scalix = ScalixClient(api_key="sk_scalix_...")

try:
    result = await scalix.chat.complete(
        messages=[{"role": "user", "content": "Hello"}],
    )
except AuthenticationError:
    print("Invalid API key")
except ScalixError as e:
    print(f"API error: {e}")

Available Models

Model Description Best For
scalix-world-ai Default model — fast, balanced General use, chat, quick tasks
scalix-advanced Most capable model — deep reasoning Complex analysis, coding, agents

Requirements

  • Python >= 3.10
  • httpx >= 0.25.0
  • pydantic >= 2.5.0

License

MIT

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

scalix-1.0.0.tar.gz (56.3 kB view details)

Uploaded Source

Built Distribution

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

scalix-1.0.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file scalix-1.0.0.tar.gz.

File metadata

  • Download URL: scalix-1.0.0.tar.gz
  • Upload date:
  • Size: 56.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for scalix-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a5d234f7e2b2fca6fefbd2d52de5148a35e03f2354e97339568d2f863bc421dd
MD5 ac865a7b9209a5502b77567477ca08e5
BLAKE2b-256 590b1f270d065749fe3c030af048ef512141225f97a22ed2167c1c47c907d3b4

See more details on using hashes here.

File details

Details for the file scalix-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: scalix-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for scalix-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ceac163fbb746a99486a7c6a176d88ff148cfb9e52d437bfeba97b345e43abd
MD5 395e8fd7bf4811a589d41fb883659193
BLAKE2b-256 d909eaf21cd8ace0d229b0f56b16ce0fb02b909240c8b6ac48fc4f88565b0a72

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