# Quick Start

Get your first AI agent running in 5 minutes.

## 🚀 Installation

{% tabs %}
{% tab title="Python" %}
```bash
pip install glaip-sdk
```
{% endtab %}

{% tab title="CLI" %}
```bash
pipx install glaip-sdk  # or: pip install --user glaip-sdk
```
{% endtab %}

{% tab title="Development" %}
```bash
git clone <repository-url>
cd ai-agent-platform-sdk
pip install -e .
```
{% endtab %}
{% endtabs %}

## ⚙️ Configure

{% tabs %}
{% tab title="macOS/Linux" %}
```bash
export AIP_API_URL="https://your-api-url.com"
export AIP_API_KEY="your-api-key"
```
{% endtab %}

{% tab title="Windows (PowerShell)" %}
```powershell
$env:AIP_API_URL="https://your-api-url.com"
$env:AIP_API_KEY="your-api-key"
```
{% endtab %}

{% tab title="Interactive" %}
```bash
aip init
# Follow the prompts to set your configuration
```
{% endtab %}
{% endtabs %}

## ✅ Verify

Test your connection:

```bash
aip status
```

Expected output: `✅ Connected to AIP API`

{% hint style="info" %}
If you see connection errors, check your `AIP_API_URL` and `AIP_API_KEY` environment variables.
{% endhint %}

## 🐍 Python: Create Your First Agent

```python
from glaip_sdk import Client

# Initialize the client (automatically loads environment variables)
client = Client()

# Create a simple AI agent
agent = client.create_agent(
    name="hello-world-agent",
    instruction="You are a friendly AI assistant."
)

# Run the agent
agent.run("Hello! How are you today?")

# Clean up
agent.delete()
```

## 💻 CLI: Create Your First Agent

```bash
# Create agent
aip agents create \
  --name "hello-world-agent" \
  --instruction "You are a friendly AI assistant."

# List agents to get the ID
aip agents list

# Run the agent (replace <AGENT_ID> with actual ID)
aip agents run <AGENT_ID> \
  --input "Hello! How are you today?"

# Clean up
aip agents delete <AGENT_ID>
```

## 🧹 Clean Up

Always clean up resources when testing:

{% tabs %}
{% tab title="Python" %}
```python
# Delete the agent (preferred method)
agent.delete()

# Alternative: delete by ID if you don't have the object
client.delete_agent("agent-id")
```
{% endtab %}

{% tab title="CLI" %}
```bash
# Delete the agent
aip agents delete <AGENT_ID>

# List to confirm deletion
aip agents list
```
{% endtab %}
{% endtabs %}

## 🎯 What Just Happened?

1. **Installation**: You installed the SDK and CLI tools
2. **Configuration**: You set up API credentials for authentication
3. **Verification**: You confirmed the connection to the AIP backend
4. **Creation**: You created an AI agent with basic instructions
5. **Execution**: You ran the agent and got a response
6. **Cleanup**: You removed the test agent

## 🔍 Troubleshooting

| Issue                | Solution                          |
| -------------------- | --------------------------------- |
| `401 Unauthorized`   | Check your `AIP_API_KEY`          |
| `404 Not Found`      | Verify your `AIP_API_URL`         |
| `Connection refused` | Ensure the AIP backend is running |
| Import errors        | Check Python version (3.10+)      |

## 🚀 Next Steps

* **Learn More**: Check out Core Concepts
* **Build Tools**: Create custom tools in Tools Guide (Python SDK or CLI with --file)
* **Connect Services**: Learn about MCPs in MCPs Guide
* **Advanced Usage**: Explore Streaming & Renderers

{% hint style="info" %}
**Note**: All tools must contain actual Python code with the `@tool_plugin` decorator and inherit from `BaseTool`. The CLI supports file uploads via `--file` option.
{% endhint %}

***

_Congratulations! You've successfully created and run your first AI agent. The AIP SDK makes it simple to build powerful AI applications._ 🎉
