cookbook/90_models/cometapi/README.md
This cookbook demonstrates how to use CometAPI with the Agno framework. CometAPI provides unified access to multiple LLM providers (GPT, Claude, Gemini, DeepSeek, Qwen, and more) through a single OpenAI-compatible interface.
Prerequisites: Fork and clone this repository if needed
python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate
COMETAPI_KEYGet your API key from: https://api.cometapi.com/console/token
export COMETAPI_KEY=sk-***
uv pip install -U openai duckduckgo-search duckdb agno
python cookbook/92_models/cometapi/basic_stream.py
python cookbook/92_models/cometapi/basic.py
python cookbook/92_models/cometapi/async_basic.py
python cookbook/92_models/cometapi/async_basic_stream.py
python cookbook/92_models/cometapi/tool_use.py
python cookbook/92_models/cometapi/tool_use_stream.py
python cookbook/92_models/cometapi/async_tool_use.py
python cookbook/92_models/cometapi/async_tool_use_stream.py
python cookbook/92_models/cometapi/structured_output.py
python cookbook/92_models/cometapi/image_agent.py
python cookbook/92_models/cometapi/image_agent_with_memory.py
python cookbook/92_models/cometapi/multi_model.py
CometAPI provides access to multiple LLM providers through a unified interface. For the most up-to-date list of supported models and pricing information, please visit:
š Official Model List & Pricing: https://api.cometapi.com/pricing
gpt-5-mini (default)gpt-5-chat-latestchatgpt-4o-latestgpt-5-nanogpt-4o-minio4-mini-2025-04-16o3-pro-2025-06-10claude-opus-4-1-20250805claude-sonnet-4-20250514claude-3-7-sonnet-latestclaude-3-5-haiku-latestgemini-2.5-progemini-2.5-flashgemini-2.0-flashgrok-4-0709grok-3grok-3-minideepseek-v3.1deepseek-v3deepseek-r1-0528deepseek-chatdeepseek-reasonerqwen3-30b-a3bqwen3-coder-plus-2025-07-22Note: Model availability and names may change. Always refer to the official pricing page for the most current information.
If you encounter authentication errors, make sure your API key is correctly set:
from agno.models.cometapi import CometAPI
# Test API key
model = CometAPI()
available_models = model.get_available_models()
print(f"Found {len(available_models)} available models")
https://api.cometapi.com/v1/https://api.cometapi.com/v1/models/models endpoint to get real-time model availability