ConnectOnionConnectOnion
Back to Home

Models

Use the latest AI models from OpenAI, Google, and Anthropic with a single interface.

Quick Start (60 Seconds)

Easiest Way: Use Managed Keys

No API key setup required! Authenticate once and get 100K free tokens to start.

Terminal
$co auth
main.py
1from connectonion import Agent 2 3# Add co/ prefix - that's it! 4agent = Agent("assistant", model="co/gpt-5") 5response = agent.input("Explain quantum computing")
Python REPL
Interactive
Quantum computing harnesses quantum mechanical phenomena...

Bonus: Star our repo for an additional 100K tokens!

Alternative: Bring Your Own Keys

For production or high-volume usage, use your own API keys for direct billing.

Terminal
$export OPENAI_API_KEY="sk-..."
main.py
1from connectonion import Agent 2 3# Use model names directly 4agent = Agent("assistant", model="gpt-5") 5response = agent.input("Explain quantum computing")
Python REPL
Interactive
Quantum computing harnesses quantum mechanical phenomena...

Available Models

GPT-5 Series

gpt-5Best for coding and agentic tasks across domains
gpt-5-miniFaster, cost-efficient version for well-defined tasks
gpt-5-nanoFastest, most cost-efficient version

Reasoning Models

o1Advanced reasoning and problem solving
o1-miniFast reasoning, cost-effective

Model Selection Guide

Best for Coding

main.py
1agent = Agent("coder", model="gpt-5") 2# Alternative: claude-opus-4.1

Fast Responses

main.py
1agent = Agent("quick", model="gpt-5-nano") 2# Alternative: gemini-1.5-flash

Cost-Optimized

main.py
1agent = Agent("budget", model="gpt-5-nano") 2# Alternative: gemini-1.5-flash-8b

Multimodal

main.py
1agent = Agent("vision", model="gemini-2.5-pro") 2# Supports: audio, video, images, PDF

Two Ways to Use Models

Option 1: Managed Keys

Recommended for getting started

Terminal
$co auth
main.py
1# Use any model with co/ prefix 2agent = Agent("assistant", model="co/gpt-5") 3agent = Agent("assistant", model="co/gemini-2.5-pro") 4agent = Agent("assistant", model="co/claude-opus-4.1")

✓ 100K free tokens to start

✓ Access to all providers

✓ No API key management

Option 2: Your Own Keys

For production or high-volume usage

Terminal
$export OPENAI_API_KEY="sk-..."
$export GEMINI_API_KEY="AIza..."
$export ANTHROPIC_API_KEY="sk-ant-..."
main.py
1# Use models without co/ prefix 2agent = Agent("assistant", model="gpt-5") 3agent = Agent("assistant", model="gemini-2.5-pro") 4agent = Agent("assistant", model="claude-opus-4.1")

✓ Production deployments

✓ Direct billing

✓ Existing infrastructure

Smart Model Selection

Automatically select the best model based on your needs:

main.py
1def select_model(task_type: str, speed_priority: bool = False) -> str: 2 """Select optimal model based on requirements.""" 3 4 if speed_priority: 5 return { 6 "code": "gpt-5-mini", 7 "chat": "gpt-5-nano", 8 "analysis": "gemini-1.5-flash" 9 }.get(task_type, "gpt-5-nano") 10 else: 11 return { 12 "code": "gpt-5", 13 "reasoning": "gemini-2.5-pro", 14 "analysis": "claude-opus-4.1" 15 }.get(task_type, "gpt-5") 16 17# Use appropriate model 18model = select_model("code", speed_priority=False) 19agent = Agent("coder", model=model)
Python REPL
Interactive
Selected model: gpt-5

Fallback Chain

Try multiple models if one fails:

main.py
1def create_agent_with_fallback(name: str): 2 """Try multiple models if one fails.""" 3 4 model_chain = [ 5 "gpt-5", # Best overall 6 "claude-opus-4.1", # Strong alternative 7 "gemini-2.5-pro", # Multimodal option 8 "gpt-5-mini" # Faster fallback 9 ] 10 11 for model in model_chain: 12 try: 13 return Agent(name, model=model) 14 except Exception as e: 15 print(f"Failed with {model}: {e}") 16 continue 17 18 raise Exception("No models available") 19 20# Will use best available model 21agent = create_agent_with_fallback("assistant")
Python REPL
Interactive
Using model: gpt-5

Model Comparison

ModelProviderContextStrengths
gpt-5OpenAI200KBest for coding & agentic tasks
gemini-2.5-proGoogle2MMultimodal, huge context
claude-opus-4.1Anthropic200KMost capable Claude

Key Benefits

  • Get started in 60 seconds with managed keys (co auth)
  • 100K free tokens + bonus credits for starring our repo
  • Same code works everywhere - just change the model name or add/remove co/ prefix
  • Tool support identical across all models and providers
  • Easy transition from managed keys to your own keys when ready for production