Skip to main content

AI Made Stupid Simple. Unified API for OpenAI, Groq, Google, and more.

Project description

ask-ai

🌍 Readme: English English · Persian فارسی · Chinese 中文 · Turkish Türkçe · Arabic العربية · Russian Русский · Spanish Español · Japanese 日本語

AI Made Simple.
One unified Python client for OpenAI, Claude, Gemini, Groq & more.

Stop rewriting AI code for every provider. Use one line. Switch models anytime.

License: MIT Python 3.8+


⚡ Why ask-ai?

  • No SDK lock-in: Don't learn 5 different libraries. Learn one.
  • Unified API: ai.ask() works for text, images, and audio across all providers.
  • Production Ready: Built-in type safety, error handling, and environment management.
  • Zero-Config: Auto-detects API keys from your environment.

🚀 The Golden Example

See the power of ask-ai in 3 lines of code:

from ask_ai import OpenAI, Anthropic, Google

prompt = "Explain quantum computing in one sentence."

# Switch providers instantly
print("OpenAI:   ", OpenAI().ask(prompt))
print("Claude:   ", Anthropic().ask(prompt))
print("Gemini:   ", Google().ask(prompt))

📦 Installation

pip install askai-python

📖 Quick Start

1. Setup

Export your API keys (or pass them explicitly).

export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."

2. Standard Usage

from ask_ai import OpenAI

ai = OpenAI()
print(ai.ask("Hello, World!"))

3. Advanced Usage

Control temperature, top_p, and system personas for professional results.

ai.advanced(
    temperature=0.7,
    prompt="You are a senior DevOps engineer."
)

print(ai.ask("How do I optimize a Dockerfile?"))

🔌 Supported Providers

Provider Class Feature Set
OpenAI OpenAI All Models (GPT-4o, o1, etc.)
Anthropic Anthropic All Models (Claude 3.5, Opus)
Google Google All Models (Gemini 1.5 Pro/Flash)
Groq Groq All Models (Llama 3, Mixtral)
Azure Azure All Deployments
OpenRouter OpenRouter All Models (100+)

⭐ Support the Project

If this project saved you time, please consider giving it a star on GitHub! It helps us grow.

Give it a Star!


Built by Hossein Ghorbani | GitHub.

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

askai_python-0.1.2.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

askai_python-0.1.2-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file askai_python-0.1.2.tar.gz.

File metadata

  • Download URL: askai_python-0.1.2.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for askai_python-0.1.2.tar.gz
Algorithm Hash digest
SHA256 712c2134aa1063de0a74ae86293c4963373c198659d5e63395efd950827d921a
MD5 b997c711b09b323fcea3464843f8c723
BLAKE2b-256 df3adb9926a5bc76b4b4c3758a6fc1e1d9000594a62dadfcaa75d3b50dcc3377

See more details on using hashes here.

File details

Details for the file askai_python-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: askai_python-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for askai_python-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 62abe0e6c8a29517a9919d3d262502bfa70b57bc4220c64b07a86e7cc1046e68
MD5 f47a4d07b4da275ee5e83e3f7ac9cd70
BLAKE2b-256 026e04af90280eea4543406a88a6becc20beba5a66ce3ef1ac5b8f4c83b8ff0e

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