Skip to main content

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

Metadata

Release files for scalix 1.0.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 scalix 1.0.0
File Size Uploaded Provenance
scalix-1.0.0.tar.gz 56.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 69.4 kB

Release files / scalix-1.0.0.tar.gz

Download URL scalix-1.0.0.tar.gz
Size 56.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a5d234f7e2b2fca6fefbd2d52de5148a35e03f2354e97339568d2f863bc421dd
BLAKE2b-256 checksum
How to use checksums
590b1f270d065749fe3c030af048ef512141225f97a22ed2167c1c47c907d3b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / scalix-1.0.0-py3-none-any.whl

Download URL scalix-1.0.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ceac163fbb746a99486a7c6a176d88ff148cfb9e52d437bfeba97b345e43abd
BLAKE2b-256 checksum
How to use checksums
d909eaf21cd8ace0d229b0f56b16ce0fb02b909240c8b6ac48fc4f88565b0a72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for scalix 1.0.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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