Nemati AI Python SDK
Official Python SDK for Nemati AI - Your all-in-one AI platform for content creation, image generation, trend discovery, and more.
Installation
pip install nemati-ai
Quick Start
from nemati import NematiAI
# Initialize client
client = NematiAI(api_key="your-api-key")
# Chat completion
response = client.chat.create(
messages=[
{"role": "user", "content": "What is machine learning?"}
]
)
print(response.content)
# AI Writer
content = client.writer.generate(
prompt="Write a blog post about AI trends in 2026",
content_type="blog_post"
)
print(content.text)
# Image Generation
image = client.image.generate(
prompt="A futuristic city at sunset",
size="1024x1024"
)
image.save("city.png")
Features
- 🤖 Chat Completions - Conversational AI with multiple models
- ✍️ AI Writer - Generate blogs, articles, social posts, and more
- 🎨 Image Generation - Text-to-image, image-to-image, upscaling
- 🔊 Audio - Text-to-speech and speech-to-text
- 📈 Trend Discovery - Track trends across YouTube, TikTok, Reddit, and more
- 📊 Market Intelligence - Stock and crypto data with AI analysis
- 📄 Document Processing - Upload, convert, and chat with documents
- ⚡ Async Support - Full async/await support for high-performance apps
Authentication
Get your API key from nemati.ai/dashboard/api-keys.
# Option 1: Pass directly
client = NematiAI(api_key="nai_live_xxxxxxxxxxxx")
# Option 2: Environment variable
# Set NEMATI_API_KEY in your environment
client = NematiAI()
Usage Examples
Chat Completions
# Simple chat
response = client.chat.create(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing"}
],
model="gpt-4",
max_tokens=1000
)
print(response.content)
print(f"Tokens used: {response.usage.total_tokens}")
# Streaming
for chunk in client.chat.create(
messages=[{"role": "user", "content": "Write a poem about AI"}],
stream=True
):
print(chunk.content, end="", flush=True)
AI Writer
# Generate content
content = client.writer.generate(
prompt="Write a product description for an AI assistant app",
content_type="product_description",
tone="professional",
max_tokens=500
)
# Use templates
templates = client.writer.templates.list()
content = client.writer.templates.generate(
template_id="social-media-post",
variables={
"topic": "AI trends",
"platform": "LinkedIn"
}
)
Image Generation
# Text to image
image = client.image.generate(
prompt="A serene mountain landscape at dawn",
size="1024x1024",
quality="hd"
)
image.save("landscape.png")
# Image to image
edited = client.image.edit(
image=open("photo.jpg", "rb"),
prompt="Make it look like a watercolor painting"
)
# Upscale
upscaled = client.image.upscale(
image=open("small.jpg", "rb"),
scale=4
)
Trend Discovery
# Search trends
trends = client.trends.search(
query="artificial intelligence",
platforms=["youtube", "tiktok", "reddit"],
timeframe="7d"
)
for trend in trends.items:
print(f"{trend.platform}: {trend.title}")
print(f" Engagement: {trend.engagement}")
Async Support
import asyncio
from nemati import AsyncNematiAI
async def main():
client = AsyncNematiAI(api_key="your-api-key")
response = await client.chat.create(
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.content)
await client.close()
asyncio.run(main())
Error Handling
from nemati.exceptions import (
AuthenticationError,
RateLimitError,
InsufficientCreditsError,
ValidationError,
APIError
)
try:
response = client.chat.create(messages=[...])
except AuthenticationError:
print("Invalid API key")
except RateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after} seconds")
except InsufficientCreditsError as e:
print(f"Need {e.required} credits, have {e.available}")
except ValidationError as e:
print(f"Invalid request: {e.errors}")
except APIError as e:
print(f"API error {e.status_code}: {e.message}")
Account & Usage
# Check credits
credits = client.account.credits()
print(f"Remaining: {credits.remaining}")
# Get usage stats
usage = client.account.usage(
start_date="2026-01-01",
end_date="2026-01-31"
)
print(f"Total requests: {usage.total_requests}")
# Get plan limits
limits = client.account.limits()
print(f"Chat messages/day: {limits.chat.max_messages_per_day}")
Documentation
Full documentation is available at docs.nemati.ai/sdk/python
Requirements
- Python 3.8+
- API key from nemati.ai
License
MIT License - see LICENSE for details.
Support
- 📧 Email: support@nemati.ai
- 💬 Discord: discord.gg/nemati
- 🐛 Issues: GitHub Issues
Metadata
Release files for nemati 0.1.4
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 | Actions |
|---|---|---|---|---|
| nemati-0.1.4.tar.gz | 23.5 kB | Without provenance | Details for nemati-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nemati-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for nemati-0.1.4-py3-none-any.whl |
Total release size: 56.7 kB
Release files / nemati-0.1.4.tar.gz
| Download URL | nemati-0.1.4.tar.gz |
|---|---|
| Size | 23.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65f6a97995c2001642498a8ed2899c11c79d555d642145e7ce30154721e3bec5
|
|
BLAKE2b-256 checksum How to use checksums |
ee0439c56a6ed2d6ba2a7a961cd0a3d81f2490ade7e59fec9ab3b455c8fc2485
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Release files / nemati-0.1.4-py3-none-any.whl
| Download URL | nemati-0.1.4-py3-none-any.whl |
|---|---|
| Size | 33.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d656d6fd0b8e6eae73f82a21852a7595810275a773af6160d29b827c03bacc03
|
|
BLAKE2b-256 checksum How to use checksums |
ffcc43b8ba96b5c622589e91a34e7ce4a763c62531dac37e6320c7cdf189054d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Security for nemati 0.1.4
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.