# API Introduction

The Guayaba Public API lets you create, manage, and chat with your AI agents programmatically — no web UI needed.

### Base URL

```
https://api.guayaba.run/api/v1
```

All endpoints are relative to this base URL.

### Quick Start

#### 1. Create an API key

Go to **Settings → API Keys** in the [Guayaba dashboard](https://app.guayaba.run/) and create a **Master Key**.

#### 2. List your agents

```
curl https://api.guayaba.run/api/v1/agents \
  -H "Authorization: Bearer g_master_YOUR_KEY"
```

#### 3. Start an agent

```
curl -X POST https://api.guayaba.run/api/v1/agents/{id}/start \
  -H "Authorization: Bearer g_master_YOUR_KEY"
```

#### 4. Chat with your agent

```
curl -X POST https://api.guayaba.run/api/v1/agents/{id}/chat \
  -H "Authorization: Bearer g_master_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello, what can you do?"}'
```

### Requirements

* An active Guayaba subscription (any tier).
* At least one API key (Master or Agent).
* Sufficient credits for billed operations.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.guayaba.run/documentation/api-guide/editor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
