> ## Documentation Index
> Fetch the complete documentation index at: https://docs.checkthat-ai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Get started with CheckThat AI in under 5 minutes

Follow this quick guide to start using CheckThat AI's unified LLM platform with built-in fact-checking capabilities.

<Info>
  **What you'll need:**

  * Python 3.8 or higher
  * An API key from at least one provider (OpenAI, Anthropic, Google, xAI, or Together AI)
</Info>

## Step 1: Install the Python SDK

<Steps>
  <Step title="Install via pip">
    Install the CheckThat AI Python SDK:

    ```bash theme={null}
    pip install checkthat-ai
    ```

    <Check>
      The SDK is compatible with Python 3.8+ and includes full type hints for better development experience.
    </Check>
  </Step>

  <Step title="Verify installation">
    Verify the installation by checking the version:

    ```bash theme={null}
    python -c "import checkthat_ai; print('CheckThat AI SDK installed successfully!')"
    ```
  </Step>
</Steps>

## Step 2: Get your API keys

Choose which AI providers you want to use and get their API keys:

<CardGroup cols={2}>
  <Card title="OpenAI" icon="robot" href="https://platform.openai.com/api-keys">
    **Models**: GPT-5, GPT-5 nano, o3, o4-mini, GPT-4o

    Sign up at platform.openai.com
  </Card>

  <Card title="Anthropic" icon="brain" href="https://console.anthropic.com">
    **Models**: Claude Sonnet 4, Sonnet Opus 4.1, Claude 3.5 Sonnet

    Get API key from console.anthropic.com
  </Card>

  <Card title="Google AI" icon="google" href="https://ai.google.dev">
    **Models**: Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 1.5 Pro

    Generate key at ai.google.dev
  </Card>

  <Card title="xAI" icon="x" href="https://x.ai">
    **Models**: Grok 4, Grok 3, Grok 3 Mini

    Obtain key from x.ai platform
  </Card>
</CardGroup>

<Warning>
  You only need API keys for the providers whose models you plan to use. Each provider manages their own billing and rate limits.
</Warning>

## Step 3: Set up your environment

Store your API keys securely as environment variables:

<CodeGroup>
  ```bash Linux/macOS theme={null}
  # 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
  ```

  ```bash Windows theme={null}
  # Set environment variables in PowerShell
  $env:OPENAI_API_KEY="sk-proj-your-openai-key"
  $env:ANTHROPIC_API_KEY="sk-ant-your-anthropic-key"
  $env:GEMINI_API_KEY="your-gemini-api-key"
  $env:XAI_API_KEY="your-xai-api-key"
  $env:TOGETHER_API_KEY="your-together-api-key"
  ```
</CodeGroup>

## Step 4: Make your first request

Create a simple Python script to test CheckThat AI:

<CodeGroup>
  ```python Basic Example theme={null}
  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)
  ```

  ```python Multiple Providers theme={null}
  import os
  from checkthat_ai import CheckThatAI

  # Try different providers
  providers = {
      "OpenAI": (os.getenv("OPENAI_API_KEY"), "gpt-5-2025-08-07"),
      "Anthropic": (os.getenv("ANTHROPIC_API_KEY"), "claude-sonnet-4-20250514"),
      "Google": (os.getenv("GEMINI_API_KEY"), "gemini-2.5-pro-002"),
      "xAI": (os.getenv("XAI_API_KEY"), "grok-4-0709")
  }

  for provider_name, (api_key, model) in providers.items():
      if api_key:
          print(f"\n--- Testing {provider_name} ---")
          client = CheckThatAI(api_key=api_key)
          
          response = client.chat.completions.create(
              model=model,
              messages=[
                  {"role": "user", "content": "Hello from CheckThat AI!"}
              ]
          )
          
          print(f"{provider_name}: {response.choices[0].message.content[:100]}...")
  ```

  ```python Async Example theme={null}
  import asyncio
  import os
  from checkthat_ai import AsyncCheckThatAI

  async def main():
      client = AsyncCheckThatAI(api_key=os.getenv("OPENAI_API_KEY"))
      
      # Check available models first
      models = await client.models.list()
      
      response = await client.chat.completions.create(
          model="gpt-5-2025-08-07",  # Use latest available models
          messages=[
              {"role": "user", "content": "What is artificial intelligence?"}
          ]
      )
      
      print(response.choices[0].message.content)
      await client.close()

  # Run the async example
  asyncio.run(main())
  ```
</CodeGroup>

## Step 5: Explore advanced features

<CardGroup cols={2}>
  <Card title="Streaming Responses" icon="wifi">
    Get real-time streaming responses for better user experience:

    ```python theme={null}
    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)
    ```
  </Card>

  <Card title="Model Discovery" icon="search">
    Discover available models across all providers:

    ```python theme={null}
    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']}")
    ```
  </Card>

  <Card title="Error Handling" icon="shield-exclamation">
    Robust error handling for production use:

    ```python theme={null}
    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")
    ```
  </Card>

  <Card title="Structured Outputs" icon="brackets-curly">
    Generate type-safe structured responses:

    ```python theme={null}
    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
    )
    ```
  </Card>
</CardGroup>

## Next Steps

<Steps>
  <Step title="Read the API Reference">
    Explore the complete [API documentation](/api-reference/introduction) to learn about all available endpoints and features.
  </Step>

  <Step title="Check out the Python SDK guide">
    Dive deeper into the [Python SDK documentation](/api-reference/python-sdk) for advanced usage patterns and best practices.
  </Step>

  <Step title="Join the community">
    Get help and share your experience:

    * **GitHub**: [Report issues or contribute](https://github.com/nikhil-kadapala/checkthat-ai)
    * **PyPI**: [View package details](https://pypi.org/project/checkthat-ai/)
    * **Email**: [Contact support](mailto:kadapalanikhil@gmail.com)
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Installation Issues">
    **Problem**: `pip install checkthat-ai` fails

    **Solutions**:

    * 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`
  </Accordion>

  <Accordion title="Authentication Errors">
    **Problem**: Getting authentication errors with API keys

    **Solutions**:

    * 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
  </Accordion>

  <Accordion title="Import Errors">
    **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`
  </Accordion>
</AccordionGroup>

<Note>
  **Need more help?** Check our [GitHub repository](https://github.com/nikhil-kadapala/checkthat-ai) for issues and discussions, or contact us at [kadapalanikhil@gmail.com](mailto:kadapalanikhil@gmail.com).
</Note>
