AYETO API Client
A Python client library for interacting with the AYETO.ai API. This library provides a simple and intuitive interface to access various AI models for chat, image generation, and other AI capabilities.
Features
- 🤖 Multiple AI Models: Support for various AI providers (OpenAI, Anthropic, DeepSeek, Google, XAI, and more)
- 💬 Chat Functionality: Simple and advanced chat interactions with AI models
- 🖼️ Image Generation: Support for image generation models (DALL-E, Stable Diffusion, BFL)
- 📁 Document Support: Upload and process documents in conversations
- 👁️ Vision Capabilities: Process images with vision-enabled models
- 🔧 Tool Integration: Dynamic tool integration for enhanced AI capabilities
- 📝 Type Safety: Full type hints and Pydantic models for request/response validation
Installation
pip install ayeto
Quick Start
Setting up the Client
from ayeto import AyetoClient
# Initialize with API key from environment variable AYETO_API_KEY
client = AyetoClient()
# Or provide API key directly
client = AyetoClient(api_key="your-api-key-here")
# Custom base URL (optional)
client = AyetoClient(
api_key="your-api-key-here",
base_url="https://custom-ayeto-instance.com/api/v2"
)
Getting Your API Key
To use this client, you'll need an API key from your AYETO account:
- Sign up or log in at https://ayeto.ai
- Go to your profile settings
- Generate or copy your API key
Environment Variables
Set your API key as an environment variable:
export AYETO_API_KEY="your-api-key-here"
Usage Examples
List Available Models
# List all available models
models = client.list_models()
for model in models:
print(f"Model ID: {model.model_id}, Name: {model.display_name}, Type: {model.model_type}")
# Filter by model type
llm_models = client.list_models(model_type="llm")
image_models = client.list_models(model_type="img_gen")
Simple Chat
# Simple chat interaction
response = client.simple_chat(
model_id="gpt-4.1-mini",
prompt="What is the capital of France?"
)
print(response.message)
Advanced Chat
from ayeto.types import LLMMessage
from ayeto.requests import ChatRequest
# Create a message
message = LLMMessage(
role="user",
content="Explain quantum computing in simple terms"
)
# Create chat request
chat_request = ChatRequest(
model="gpt-4.1",
message=message,
max_tokens=500,
relevant_history=True,
dynamic_tools=True
)
# Send chat request
response = client.chat(chat_request)
print(response.content)
Chat with Images (Vision)
from ayeto.types import LLMMessage, EncodedData
from ayeto.requests import ChatRequest
# Encode your image (base64 encoded data)
vision_data = EncodedData(
data="base64-encoded-image-data",
mime_type="image/jpeg"
)
message = LLMMessage(
role="user",
content="What do you see in this image?"
)
chat_request = ChatRequest(
model="gpt-4.1",
message=message,
vision=vision_data
)
response = client.chat(chat_request)
Chat with Document Upload
from ayeto.types import EncodedData
# Encode your document
document = EncodedData(
data="base64-encoded-document-data",
mime_type="application/pdf"
)
chat_request = ChatRequest(
model="gpt-4.1-mini",
message=message,
documents=[document]
)
response = client.chat(chat_request)
Get API Version
version_info = client.get_version()
print(f"API Version: {version_info.version}")
API Reference
AyetoClient
The main client class for interacting with the AYETO API.
Methods
-
list_models(model_type: Optional[AiModelType] = None) -> List[ListModelsResponse]- List available AI models, optionally filtered by type
-
simple_chat(model_id: str, prompt: str) -> SimpleChatResponse- Send a simple chat request to an AI model
-
chat(request: ChatRequest) -> LLMMessage- Send an advanced chat request with full feature support
-
get_version() -> VersionResponse- Get API version information
Model Types
LLM: Large Language Models for text generation and chatIMG_GEN: Image generation modelsSTT: Speech-to-text modelsTTS: Text-to-speech modelsEMBEDDINGS: Text embedding models
Supported Providers
- OpenAI: GPT models, DALL-E
- Anthropic: Claude models
- DeepSeek: DeepSeek models
- Google: Gemini models
- XAI: Grok models
- SD: Stable Diffusion models
- BFL: Black Forest Labs models
Error Handling
The library raises AyetoException for API-related errors:
from ayeto.exceptions import AyetoException
try:
response = client.simple_chat("invalid-model", "Hello")
except AyetoException as e:
print(f"API Error: {e}")
Requirements
- Python 3.12.3+
- requests
- pydantic
License
This project is licensed under the terms specified in the LICENSE file.
Changelog
v0.0.3
- Added EncodedData loader (classmethod
from_path)
v0.0.2
- Project urls added
v0.0.1
- Initial release
- Basic chat functionality
- Model listing
- Support for multiple AI providers
- Vision and document capabilities
Metadata
Release files for ayeto 0.0.3
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 | |
|---|---|---|---|---|
| ayeto-0.0.3.tar.gz | 11.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ayeto-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.9 kB
Release files / ayeto-0.0.3.tar.gz
| Download URL | ayeto-0.0.3.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a189352d6200942b90b4368e347a2b4ace5df3b34f8026bd482a7433e772b44
|
|
BLAKE2b-256 checksum How to use checksums |
0f7d8914b93681cf70c1a9a70befe37a54e83090e631e4a2bdf04d64caf84dec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / ayeto-0.0.3-py3-none-any.whl
| Download URL | ayeto-0.0.3-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62a39e8ba47e67aca99dc8f8610f834c387cd7df75bc2316e97f60524f740dda
|
|
BLAKE2b-256 checksum How to use checksums |
8106ab9505046e1da20564e23b79802c511b974b3c2d59b8615dbb29b5a494f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for ayeto 0.0.3
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.