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

# Overview

> Pre-built integrations - start building immediately, no API setup required

## Available Integrations

Ziet provides built-in integrations with popular services. All integrations are **ready to use** - just import and start building.

<CardGroup cols={2}>
  <Card title="Google" icon="google" href="/integrations/google">
    Search, Images, News, Maps
  </Card>

  <Card title="Apify" icon="spider-web">
    Web scraping and data extraction
  </Card>

  <Card title="OpenAI" icon="openai">
    GPT-4, embeddings, chat completions
  </Card>

  <Card title="Anthropic" icon="robot">
    Claude AI models
  </Card>

  <Card title="Stripe" icon="stripe">
    Payments and subscriptions
  </Card>

  <Card title="SendGrid" icon="envelope">
    Transactional email
  </Card>

  <Card title="Twilio" icon="phone">
    SMS and voice calls
  </Card>

  <Card title="Slack" icon="slack">
    Team messaging and notifications
  </Card>
</CardGroup>

## How It Works

### Option 1: Default (Ziet's Keys)

By default, integrations use Ziet's API keys. **No setup required** - just import and use.

```python theme={null}
from ziet.integrations import google, openai

# Just use them - works out of the box
results = google.search("best restaurants SF")
summary = openai.chat([{"role": "user", "content": "Summarize these"}])
```

**Free tier limits**:

* Google Search: 100 searches/day
* OpenAI: 10,000 tokens/day
* Apify: 50 scrapes/day
* Other services: Reasonable usage limits

Perfect for development and prototyping.

### Option 2: Bring Your Own Keys

For production or higher limits, connect your own API keys in the [dashboard](https://dashboard.ziet.ai/integrations):

1. Go to **Integrations** in the dashboard
2. Click on the service (e.g., "OpenAI")
3. Click **Connect Your Account**
4. Enter your API key
5. Save

**Your code doesn't change** - Ziet automatically uses your keys:

```python theme={null}
# Same code, now using YOUR API key from dashboard
from ziet.integrations import openai

response = openai.chat([...])
```

## Basic Usage

### Import and Use

```python theme={null}
from ziet import Action, memory
from ziet.integrations import google, openai

@Action(
    id="research_topic",
    name="Research Topic",
    description="Research a topic using Google and OpenAI"
)
def research_topic(topic: str) -> None:
    # Search Google
    results = google.search(topic, num_results=10)
    memory.add(key="search_results", value=results)
    
    # Summarize with OpenAI
    prompt = f"Summarize these search results: {results}"
    summary = openai.chat([{"role": "user", "content": prompt}])
    memory.add(key="summary", value=summary)
```

### Use in Agents

```python theme={null}
from ziet import Agent
from ziet.integrations import google, openai, sendgrid

@Agent(
    id="research_agent",
    name="ResearchAgent",
    instructions="""
    Research the topic using Google search.
    Summarize findings with OpenAI.
    Email results to the user.
    """,
    actions=["search_google", "generate_summary", "send_email"]
)
class ResearchAgent:
    pass
```

## Common Patterns

### Search and Analyze

```python theme={null}
from ziet import Action, memory
from ziet.integrations import google, openai

@Action(
    id="search_and_analyze",
    name="Search and Analyze",
    description="Search and get AI analysis"
)
def search_and_analyze(query: str) -> None:
    # Search
    results = google.search(query, num_results=10)
    
    # Analyze with AI
    analysis = openai.chat([{
        "role": "user",
        "content": f"Analyze these search results: {results}"
    }])
    
    memory.add(key="analysis", value=analysis)
```

### Payment with Confirmation

```python theme={null}
from ziet import Action, memory
from ziet.integrations import stripe, sendgrid

@Action(
    id="process_and_notify",
    name="Process and Notify",
    description="Charge payment and send confirmation"
)
def process_and_notify(amount: int, email: str) -> None:
    # Charge payment
    payment = stripe.create_payment_intent(
        amount=amount * 100,  # Convert to cents
        currency="usd"
    )
    
    # Send confirmation
    sendgrid.send(
        to=email,
        subject="Payment Confirmed",
        body=f"<h1>Payment Successful</h1><p>Amount: ${amount}</p>",
        html=True
    )
    
    memory.add(key="payment_complete", value={"payment_id": payment["id"], "amount": amount})
```

## Best Practices

<AccordionGroup>
  <Accordion title="Start with defaults, upgrade later" icon="rocket">
    Use Ziet's keys for development. Add your own keys in production.

    ```python theme={null}
    # Development: Use Ziet's keys (no setup)
    from ziet.integrations import openai
    response = openai.chat([...])

    # Production: Add your key in dashboard (same code)
    ```
  </Accordion>

  <Accordion title="Handle errors gracefully" icon="shield">
    ```python theme={null}
    from ziet import Action, memory
    from ziet.integrations import google

    @Action(
        id="safe_search",
        name="Safe Search",
        description="Search with error handling",
        retries=2
    )
    def safe_search(query: str) -> None:
        try:
            results = google.search(query)
            memory.add(key="results", value=results)
        except Exception as e:
            memory.add(key="error", value=str(e))
            memory.add(key="results", value=[])
    ```
  </Accordion>

  <Accordion title="Cache results in memory" icon="database">
    ```python theme={null}
    from ziet import memory
    from ziet.integrations import google

    # Check cache first
    cached = memory.get(f"search_{query}")
    if cached:
        return

    # Call API and cache
    results = google.search(query)
    memory.add(key=f"search_{query}", value=results)
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Google" icon="google" href="/integrations/google">
    Search, Images, News, Maps
  </Card>

  <Card title="Actions" icon="bolt" href="/core/actions">
    Build actions with integrations
  </Card>

  <Card title="Agents" icon="robot" href="/core/agents">
    Orchestrate with agents
  </Card>

  <Card title="Memory" icon="database" href="/core/memory">
    Store integration results
  </Card>
</CardGroup>
