Skip to main content

Ryzenth is a flexible Multi-API SDK with built-in support for API key management and database integration.

Project description

Ryzenth Library

Open Source Love Maintenance License PRs Welcome Ryzenth - Version pre-commit.ci status Pylint

Downloads API Tests

Image


Ryzenth is a powerful Multi-API SDK designed to seamlessly handle API keys and database connections with ease.

It provides native support for both synchronous and asynchronous operations, making it ideal for modern applications including AI APIs, Telegram bots, REST services, and automation tools.

Built with httpx and aiohttp integration, comprehensive logging features (including Telegram alerts), and database storage capabilities like MongoDB, Ryzenth empowers developers with a flexible, scalable, and customizable API client solution.

๐Ÿšจ Important Notes

HTTP 403 Error Fix

If you're encountering 403 Forbidden errors, ensure you're setting proper headers:

# โœ… CORRECT - Always use proper headers
from Ryzenth import RyzenthApiClient

clients = RyzenthApiClient(
    tools_name=["your-tool"],
    api_key={"your-tool": [{"Authorization": "Bearer your-token"}]},
    rate_limit=100,
    use_default_headers=True  # ๐Ÿ”ฅ IMPORTANT: Set this to True
)

# โœ… CORRECT - Custom headers example
clients = RyzenthApiClient(
    tools_name=["your-tool"],
    api_key={"your-tool": [{
        "Authorization": "Bearer your-token",
        "Accept": "application/json",
        "Content-Type": "application/json"
    }]},
    rate_limit=100,
    use_default_headers=True
)

# โŒ WRONG - Missing headers will cause 403 errors
clients = RyzenthApiClient(
    tools_name=["your-tool"],
    api_key={"your-tool": [{}]},  # Empty headers
    use_default_headers=False     # No default headers
)

Required Headers Format

The library automatically adds these headers when use_default_headers=True:

  • User-Agent: Ryzenth/Python v-{version}
  • Accept: application/json
  • Content-Type: application/json

Javascript Your own API

const ua = req.headers['User-Agent'];
const gh = req.headers['X-Github-Source'];
const ghVersion = req.headers['X-Ryzenth-Version'];

console.log(gh) // check valid whitelist TeamKillerX/Ryzenth

โœจ Features

  • ๐Ÿ”„ Dual Mode Support: Works with both sync and async clients
  • ๐Ÿ” Smart API Key Management: Built-in API key handling and rotation
  • ๐Ÿค– AI-Ready: Seamless integration with modern AI services (image generation, text processing, etc.)
  • โšก High Performance: Built on httpx for optimal speed and reliability
  • ๐Ÿ“Š Comprehensive Logging: Built-in logging with optional Telegram notifications
  • ๐Ÿ›ก๏ธ Error Handling: Robust error handling with automatic retries
  • ๐ŸŽฏ Context Managers: Proper resource management with async context support
  • ๐Ÿ“ฆ Database Integration: MongoDB and other database connectors included

๐Ÿ“ฆ Installation

Standard Installation

pip3 install ryzenth[fast]

Development Installation (Latest Features)

pip3 install git+https://github.com/TeamKillerX/Ryzenth.git

๐Ÿš€ Quick Start

๐Ÿ”— New Chaining API Support

Modern fluent API with method chaining:

from Ryzenth import RyzenthAuthClient

# ๐ŸŒŸ Fluent API with chaining
response = await RyzenthAuthClient()\
    .with_credentials("68750d3b92828xxxxxxxx", "sk-ryzenth-*")\
    .use_tool("instatiktok")\
    .set_parameter("&url={url}&platform=facebook")\
    .retry(2)\
    .cache(True)\
    .timeout(10)\
    .execute()

print(response)

# ๐Ÿ”ง Traditional client approach
clients = await RyzenthApiClient(
    tools_name=["ryzenth-v2"],
    api_key={"ryzenth-v2": [{}]},
    rate_limit=100,
    use_default_headers=True
)

๐Ÿ”ฅ Multi Client Tools

  • support environment
# COHERE_API_KEY
# GEMINI_API_KEY
# XAI_API_KEY
# OPENAI_API_KEY
# ALIBABA_API_KEY
# DEEPSEEK_API_KEY
# ZAI_API_KEY

from Ryzenth import RyzenthTools

rt = RyzenthTools()
# your own code logic

Attribute Tools

.aio.grok_chat
.aio.claude_chat
.aio.gemini_chat
.aio.old_gemini_chat
.aio.openai_images
.aio.openai_responses
.aio.qwen_chat
.aio.deepseek_chat
.aio.zai_chat
.aio.qwen_images
.aio.qwen_videos
.aio.images
.aio.chat

Examples full code

gemini-openai tools

from Ryzenth import RyzenthTools

rt = RyzenthTools("api-key-from-gemini")

results = await rt.aio.gemini_chat.ask([
    {"role": "system", "content": "You are a helpful assistant"},
    {"role": "user", "content": "What is Gemini?"}
], model="gemini-2.5-flash")

print(await results.to_dict())
  • Use tools
from Ryzenth import RyzenthTools

rt = RyzenthTools("api-key-from-gemini")

results = await rt.aio.gemini_chat.ask([
    {"role": "user", "content": "What's the weather like in Chicago today?"}
], tools=[
  {
    "type": "function",
    "function": {
      "name": "get_weather",
      "description": "Get the current weather in a given location",
      "parameters": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "description": "The city and state, e.g. Chicago, IL"
          },
          "unit": {
            "type": "string",
            "enum": ["celsius", "fahrenheit"]
          }
        },
        "required": ["location"]
      }
    }
  }
],tool_choice="auto")

print(await results.to_json_dumps())

qwen-image tools

from Ryzenth import RyzenthTools

rt = RyzenthTools("api-key-from-qwen")

response = await rt.aio.qwen_images.create("make a generate cat blue and background car Lamborghini gold")

output = await response.run()

img = await response.to_buffer_request(output.results[0].url)

print(img)
  • Use task id manually
from Ryzenth import RyzenthTools

rt = RyzenthTools()

response = await rt.aio.qwen_images.create("...")
obj = await response.to_obj()
task_id = obj.output.task_id

response_status = await rt.aio.qwen_images.get_task(task_id)

obj_res = await response_status.to_obj()

if obj_res.output.task_status == "SUCCEEDED":
    print(obj_res.output)

Ryzenth-Chat tools (Free)

from Ryzenth import RyzenthTools

rt = RyzenthTools()

results = await rt.aio.chat.ask([
    {"role": "system", "content": "You are helpful assistant"},
    {"role": "user", "content": "oh good job"}
], use_conversation=True)

print(await results.to_json_dumps())
  • Use Kimi AI (free)
  • support use_instruct for multi turn conversation
from Ryzenth import RyzenthTools

rt = RyzenthTools()

results = await rt.aio.chat.ask_kimi([
    {"role": "system", "content": "...."},
    {"role": "user", "content": "hello world!"}
], use_instruct=True)

obj = await results.to_obj()
print(obj.data.choices[0].message.content)
  • You can use one prompt
from Ryzenth import RyzenthTools

rt = RyzenthTools()

results = await rt.aio.chat.ask("Hello world")

print(await results.to_json_dumps())

๐Ÿค– AI Features (No API Key Required)

Supports multiple AI models: grok, deepseek-reasoning, evil, unity, sur, rtist, hypnosis-tracy, llama-roblox

from Ryzenth import RyzenthTools

rt = RyzenthTools()

# ๐Ÿ’ฌ Chat Ultimate - Multiple AI Models
response_grok = await rt.aio.chat.ask_ultimate(
    "What is Durov's role in Telegram?",
    model="grok"
)
print(await response_grok.to_result())

# ๐ŸŽฏ OpenAI V2 Integration
response_openai = await rt.aio.chat.ask("What's the capital of Japan?")
print(await response_openai.to_result())

# ๐ŸŽจ Image Generation
response_content = await rt.aio.images.create("generate a blue cat")
await response_content.to_save()

# ๐Ÿ‘€ Image Analysis with Upload
response_see = await rt.aio.images.create_upload_to_ask(
    "Describe this image:",
    "/path/to/example.jpg"
)
result = await response_see.to_result()

# ๐Ÿงน Proper cleanup
await rt.aio.chat.close()
await rt.aio_client.images.close()

๐ŸŽฅ Advanced AI Features

# ๐Ÿ–ผ๏ธ Multiple image operations
await rt.aio.images.create()
await rt.aio.images.create_gemini_and_captions()
await rt.aio_client.images.create_gemini_to_edit(
    "add Lamborghini background",
    "/path/to/example.jpg"
)  # Use response.to_buffer_and_list()

await rt.aio.images.create_upload_to_ask()
await rt.aio.images.create_multiple()

# ๐Ÿ’ญ Chat operations
await rt.aio.chat.ask()
await rt.aio.chat.ask_ultimate()

๐ŸŽฌ Image & Video Generation with Qwen AI

Generate high-quality images and videos using Qwen AI with dot notation access:

from Ryzenth import RyzenthTools

rt = RyzenthTools("your-qwen-api-key")

# ๐Ÿ–ผ๏ธ Generate Image
response = await rt.aio.qwen_images.create("generate a blue cat running")
output = await response.create_task_and_wait(max_retries=120, poll_interval=1.0)

print("๐ŸŽจ Image URL:", output.results[0].url)

# ๐ŸŽฌ Generate Video
response_video = await rt.aio.qwen_videos.create("blue cat running in slow motion")
output_video = await response_video.create_task_and_wait(max_retries=120, poll_interval=1.0)

print("๐ŸŽฅ Video URL:", output_video.video_url)

โš ๏ธ Version Note: Dot notation access may be limited in version 2.2.3+ due to API changes. Check our GitHub Discussions for updates.


๐Ÿ› ๏ธ Developer Tools & Supported APIs

Pricing & Free Tier (Ryzenth)

Endpoints Free Description
kimi-latest โœ… Free Kimi AI
openai-v2/oss โœ… Free GPT oss
ultimate-chat โœ… Free Custom Model
openai-v2 โœ… Free openAI
openai-v2/image-vision โœ… Free openAI image vision
gemini-latest/imagen/edit โœ… Free Gemini imagen edit
gemini-latest/imagen โœ… Free Gemini imagen
tools/generate-image โœ… Free Tool Generate image

Available API Tools

Choose from our extensive list of supported APIs:

Tool Name Status Description
itzpire โŒ Dead Legacy API service
ryzenth โœ… Active Main Ryzenth API
ryzenth-v2 โœ… Active Enhanced Ryzenth API
siputzx โœ… Active (Auto block) Community API
fgsi โœ… Active FGSI API Service
onrender โœ… Active Render-based API
deepseek โœ… Active DeepSeek AI API
cloudflare โœ… Active Cloudflare Workers API
paxsenix โœ… Active PaxSenix API
exonity โœ… Active Exonity API
yogik โŒ Dead Legacy API
ytdlpyton โœ… Active YouTube downloader
openai โœ… Active OpenAI API
cohere โœ… Active Cohere AI API
claude โœ… Active Anthropic Claude API
grok โœ… Active Grok AI API
alibaba โœ… Active Alibaba Qwen API
gemini โœ… Active Google Gemini API
gemini-openai โœ… Active Gemini OpenAI Compatible

๐Ÿ”ง Custom API Implementation

from Ryzenth import RyzenthApiClient

# ๐ŸŽฏ Example with SiputZX API
clients = RyzenthApiClient(
    tools_name=["siputzx"],
    api_key={"siputzx": [{"Authorization": "Bearer test"}]},
    rate_limit=100,
    use_default_headers=True  # ๐Ÿ”ฅ Always enable for 403 fix
)

# Your implementation logic here
response = await clients.get(
    tool="siputzx",
    path="/api/endpoint",
    params={"query": "your-query"}
)

๐Ÿ“š Resources:


๐Ÿ—๏ธ Legacy Examples (Deprecated)

Async Example

from Ryzenth import ApiKeyFrom
from Ryzenth.types import QueryParameter

ryz = ApiKeyFrom(..., is_ok=True)

await ryz.aio.send_message(
    "hybrid",
    QueryParameter(query="hello world!")
)

Sync Example

from Ryzenth import ApiKeyFrom
from Ryzenth.types import QueryParameter

ryz = ApiKeyFrom(..., is_ok=True)
ryz._sync.send_message(
    "hybrid",
    QueryParameter(query="hello world!")
)

๐Ÿค– Multi-Platform AI Support

Grok AI Integration

from Ryzenth.tool import GrokClient

g = GrokClient(api_key="sk-grok-xxxx")

response = await g.chat_completions(
    messages=[
        {
            "role": "system",
            "content": "You are Grok, a chatbot inspired by the Hitchhiker's Guide to the Galaxy."
        },
        {
            "role": "user",
            "content": "What is the meaning of life, the universe, and everything?"
        }
    ],
    model="grok-3-mini-latest",
    reasoning_effort="low",
    temperature=0.7,
    timeout=30
)
print(response)

๐Ÿ”‘ API Keys & Documentation

๐Ÿค– AI Platform Documentation

๐Ÿ” Get Your API Keys

Platform Get API Key Official Website
Ryzenth Get Key Official Ryzenth Portal
OpenAI Get Key OpenAI Platform
Cohere Get Key Cohere Dashboard
Alibaba Get Key Alibaba Console
Claude Get Key Anthropic Console
Grok Get Key X.AI Console

๐ŸŒ API Provider Partners (NB Friends)

๐Ÿ† Credits Developer

  • xtdevs - Lead Developer & Creator
  • X-API-JS - Ryzenth DLR JavaScript Solo Dev
  • Ryzenth V2 - Ryzenth TypeScript Solo Dev
  • TeamKillerX - Solo Dev
  • AkenoX Project - Original inspiration and foundation
  • Google Developer Tools - AI integration support
  • Open Source Community - Contributions and feedback

๐Ÿ’– Support Development

Your support helps us continue building and maintaining this project!

๐Ÿ’ฐ Donation Options

  • Bank Transfer (DANA): Send to Bank Jago 100201327349
  • Cryptocurrency: Contact us for wallet addresses
  • GitHub Sponsors: Sponsor on GitHub

Every contribution, no matter the size, makes a difference! ๐Ÿš€


๐Ÿ“„ License

MIT License ยฉ 2025 Ryzenth Developers from TeamKillerX

This project is open source and available under the MIT License.


๐ŸŒŸ Star us on GitHub if you find this project useful!

GitHub stars GitHub forks GitHub watchers

Made with โค๏ธ by the Ryzenth Solo Dev

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

ryzenth-2.3.0.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

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

ryzenth-2.3.0-py3-none-any.whl (91.9 kB view details)

Uploaded Python 3

File details

Details for the file ryzenth-2.3.0.tar.gz.

File metadata

  • Download URL: ryzenth-2.3.0.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ryzenth-2.3.0.tar.gz
Algorithm Hash digest
SHA256 38c6050d16a005947e0204004d62d92545c16c991f4dc86845b67015d3cb1f8d
MD5 9bf18b03fb84a72494a8dfcf797e641e
BLAKE2b-256 5c716b01e3e2186d4287b14f5082864f5374f8aae6e0bdc9d16b2cafe17bb55f

See more details on using hashes here.

File details

Details for the file ryzenth-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: ryzenth-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 91.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ryzenth-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ff83a53c9af3edd5dd03470ac45cae5ece90853449c9ddeb0ae7f99a9c3adb9
MD5 c88f44264d4bfe565cea4e42b2c72c4a
BLAKE2b-256 930d3a2cf3d469a49884782db57a1f4e455031f556377853d528d0639803d6da

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