Alephant Python SDK
Alephant Python SDK helps you call Alephant Gateway, generate session headers, query Virtual Key usage and cost analytics, and integrate with LangChain or LlamaIndex.
Installation
pip install alephantai
pip install "alephantai[langchain]"
pip install "alephantai[llamaindex]"
Gateway Chat
The production Gateway host is https://ai.alephant.io/v1.
from alephantai import AlephantGatewayContext, create_openai_client
ctx = AlephantGatewayContext(session_name="quickstart")
client = create_openai_client(api_key="vk-...", context=ctx)
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello"}],
)
By default, the SDK only generates Alephant-Session-Id. Behavior headers such
as cache controls, forced routing, and prompt template identifiers must be
configured explicitly. Version 1 guarantees session-level request and cost
attribution only; full journey steps, policy events, and grading require a
future step/span contract.
Analytics
The Cockpit analytics client defaults to https://alephant.io/api/v1.
from alephantai import AlephantAnalyticsClient
analytics = AlephantAnalyticsClient(api_key="vk-...")
print(analytics.usage_summary(period="7d"))
usage_summary().total_tokens.input maps to prompt/input tokens and
total_tokens.output maps to completion/output tokens. daily_costs() reports
daily total tokens. cost_by_model() is scoped to the VK's bound agent/member
when present, and recent_requests() returns live rows; degraded=true means
the backend, Collector, or requested scope could not provide live data.
Metadata
Release files for alephantai 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 | Provenance | |
|---|---|---|---|---|
| alephantai-0.1.0.tar.gz | 12.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| alephantai-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.8 kB
Release files / alephantai-0.1.0.tar.gz
| Download URL | alephantai-0.1.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24f92dac962c18657ddca74911e5be4770bf7fa487f119997c39b1855c260685
|
|
BLAKE2b-256 checksum How to use checksums |
15c037a34cc9a0865917cad5f0b54547279bab31bcefee652e0b24d33678430a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / alephantai-0.1.0-py3-none-any.whl
| Download URL | alephantai-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ef03705a2c533b3ba5c50beea117dea7ccf6eb2526a7f57513802ca44b5f579
|
|
BLAKE2b-256 checksum How to use checksums |
c77cdad0287c174f29e6d7150743ac170953bb4de55fa459f520cbff9adca177
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for alephantai 0.1.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.