Skip to main content
Follow this quick guide to start using CheckThat AI’s unified LLM platform with built-in fact-checking capabilities.
What you’ll need:
  • Python 3.8 or higher
  • An API key from at least one provider (OpenAI, Anthropic, Google, xAI, or Together AI)

Step 1: Install the Python SDK

1

Install via pip

Install the CheckThat AI Python SDK:
pip install checkthat-ai
The SDK is compatible with Python 3.8+ and includes full type hints for better development experience.
2

Verify installation

Verify the installation by checking the version:
python -c "import checkthat_ai; print('CheckThat AI SDK installed successfully!')"

Step 2: Get your API keys

Choose which AI providers you want to use and get their API keys:
You only need API keys for the providers whose models you plan to use. Each provider manages their own billing and rate limits.

Step 3: Set up your environment

Store your API keys securely as environment variables:
# Add to your ~/.bashrc or ~/.zshrc
export OPENAI_API_KEY="sk-proj-your-openai-key"
export ANTHROPIC_API_KEY="sk-ant-your-anthropic-key"
export GEMINI_API_KEY="your-gemini-api-key"
export XAI_API_KEY="your-xai-api-key"
export TOGETHER_API_KEY="your-together-api-key"

# Reload your shell configuration
source ~/.bashrc  # or ~/.zshrc

Step 4: Make your first request

Create a simple Python script to test CheckThat AI:
import os
from checkthat_ai import CheckThatAI

# Initialize the client with your OpenAI API key
client = CheckThatAI(api_key=os.getenv("OPENAI_API_KEY"))

# IMPORTANT: Always check available models first
models = client.models.list()
print("Available models:", len(models["models_list"]), "providers")

# Make your first request
response = client.chat.completions.create(
    model="gpt-5-2025-08-07",  # Use latest available models
    messages=[
        {"role": "user", "content": "Fact-check this claim: The Earth is round"}
    ]
)

print(response.choices[0].message.content)

Step 5: Explore advanced features

Streaming Responses

Get real-time streaming responses for better user experience:
response = client.chat.completions.create(
    model="gpt-5-2025-08-07",  # Use latest models
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True
)

for chunk in response:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Model Discovery

Discover available models across all providers:
models = client.models.list()

for provider in models["models_list"]:
    print(f"\n{provider['provider']} Models:")
    for model in provider['available_models']:
        print(f"  - {model['name']}")

Error Handling

Robust error handling for production use:
from openai import RateLimitError, APITimeoutError
from checkthat_ai._exceptions import InvalidModelError

try:
    response = client.chat.completions.create(...)
except InvalidModelError as e:
    print(f"Invalid model: {e}")
except RateLimitError:
    print("Rate limit exceeded")
except APITimeoutError:
    print("Request timed out")

Structured Outputs

Generate type-safe structured responses:
from pydantic import BaseModel

class Response(BaseModel):
    answer: str
    confidence: float

response = client.chat.completions.parse(
    model="gpt-5-2025-08-07",
    messages=[...],
    response_format=Response
)

Next Steps

1

Read the API Reference

Explore the complete API documentation to learn about all available endpoints and features.
2

Check out the Python SDK guide

Dive deeper into the Python SDK documentation for advanced usage patterns and best practices.
3

Join the community

Get help and share your experience:

Troubleshooting

Problem: pip install checkthat-ai failsSolutions:
  • Ensure you have Python 3.8 or higher: python --version
  • Try upgrading pip: pip install --upgrade pip
  • Use a virtual environment: python -m venv venv && source venv/bin/activate
Problem: Getting authentication errors with API keysSolutions:
  • Verify your API key format matches the provider
  • Check that environment variables are properly set: echo $OPENAI_API_KEY
  • Ensure you have sufficient credits/quota with the provider
Problem: ImportError: No module named 'checkthat_ai'Solutions:
  • Verify installation: pip list | grep checkthat-ai
  • Check you’re using the correct Python environment
  • Reinstall the package: pip uninstall checkthat-ai && pip install checkthat-ai
Need more help? Check our GitHub repository for issues and discussions, or contact us at [email protected].