Skip to main content

anyask

Call an LLM provider with a single text prompt, get its raw response back — one function, 18 vendors, zero routing/fallback magic.

import anyask

response = anyask.ask(
    "Say hello in one word.",
    provider="anthropic",
    model="claude-haiku-4-5-20251001",
    api_key="sk-...",  # or set ANTHROPIC_API_KEY
)

print(response.content)   # "Hello"
print(response.usage)     # TokenUsage(prompt_tokens=..., completion_tokens=..., total_tokens=...)

Features

  • Lightweight installation — a bare pip install anyask pulls in exactly one dependency (PyYAML); each provider you actually use adds only that provider's own SDK, never the other 17. Cheap to bake into a container image, fast to install in CI.
  • One function, 18 vendors — ask()/ask_async() take the same provider=/model= signature everywhere; swap providers by changing one string.
  • No routing/fallback magic — provider and model are always explicit; anyask never silently swaps one vendor for another.
  • Real reasoning support, not simulated — reasoning=True enables each provider's own actual extended-thinking mechanism where one exists.
  • A small built-in CLI — anyask check/anyask ready answer "is this provider's SDK installed and its credentials set," with no network call.

Installation

pip install anyask                 # minimal install — no provider usable yet
pip install anyask[anthropic]      # + Anthropic only
pip install anyask[openai,gemini]  # + multiple providers
pip install anyask[all]            # + every provider SDK

Verify:

anyask version                     # installed version
anyask ready                       # sweep every provider's SDK/credential status
anyask check anthropic             # check one provider specifically, exit 0/1

Supported providers

openai, anthropic, gemini, vertexai, azure, mistral, cohere, bedrock, oci, and the nine OpenAI-compatible vendors: deepseek, groq, xai, together, fireworks, cerebras, perplexity, openrouter, moonshot.

What is anyask

A single-responsibility package for one job: call an LLM provider, get its raw response back. prompt is always a plain string and AskResponse.content is always a plain string — no multi-turn history, no system prompts, no multi-modal input/output, no streaming. That narrow contract is deliberate, not a missing feature — see SPEC.md for the full design and SPEC.md's out-of-scope list for exactly what's excluded and why.

Why do you need anyask

If you're calling more than one LLM vendor, you're already facing 18 SDKs with 18 different client shapes, auth patterns, and response formats. anyask is the thin, uniform layer underneath: one call signature, one normalized response shape (content/usage/finish_reason/raw), and nothing else — no opinions about retries, fallback, cost tracking, or agent orchestration. Build those on top if you need them, or just use anyask directly when you don't. It's also the option to reach for when install footprint actually matters — CI pipelines, container images, or a library that can't afford to drag in SDKs its own users never touch.

Documentation

Full docs, including the Quickstart, Providers reference, CLI Guide, and generated API Reference:

License

MIT

Metadata

Release files for anyask 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anyask 0.2.2
File Size Uploaded Provenance Actions
anyask-0.2.2.tar.gz 25.6 kB With provenance Details for anyask-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anyask 0.2.2
File Interpreter ABI Platform Actions
anyask-0.2.2-py3-none-any.whl Python 3 none any Details for anyask-0.2.2-py3-none-any.whl

Total release size: 64.1 kB

Release files / anyask-0.2.2.tar.gz

Download URL anyask-0.2.2.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3e8d81f20969be8ea16941bb9bf040da4e0a3529ae615512afc2fa49165fb34f
BLAKE2b-256 checksum
How to use checksums
1f225fed5899ceaf1a91f5d62c77a6c7a5d7dc42e65d0aae10d41412aa857546
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Release files / anyask-0.2.2-py3-none-any.whl

Download URL anyask-0.2.2-py3-none-any.whl
Size 38.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4e69b8d1901f4d58bff0e822114af2f4672eccb555d442f53578a0c7dbd51f9
BLAKE2b-256 checksum
How to use checksums
0e7bc0e3f7d5ee55174c130e80f17ae197d5b8a387a3b67f8f58b2ff4de538c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Security for anyask 0.2.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for anyask-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page