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

# Raccoon AI Agents API

> Run autonomous AI agents programmatically

<Note>
  Agents API is currently in early beta. The API may change before general availability.
</Note>

The agent operates in sandboxed environments where they can execute code, access the web, manage files, and complete multistep tasks, all streaming results back in real-time.

The API is powered by Raccoon AI's Agents SDK.

## Key Concepts

### Sessions

Persistent workspaces identified by a UUID. The agent maintains context across turns: files, conversation history, credentials and processes persist.

### Turns

Single request-response cycles. Each turn builds on previous context within the same session. The agent sees prior work and continues incrementally.

### Modes

Control how the agent works:

| Mode | Use case |
| - | - |
| `auto` | General-purpose (default) |
| `code` | Software development |
| `deepsearch` | Research and analysis |
| `slides` | Presentations |
| `plan` | Planning before execution |

## How It Works

<Steps>
  <Step title="Start a turn">
    `POST /sessions/new` with your prompt, mode, and `session_id`.
  </Step>

  <Step title="Stream results">
    Connect to `wss://api.raccoonai.tech/ws/sessions/{sessionId}` to receive events as the agent executes.
  </Step>

  <Step title="Continue or branch">
    Reuse the same `session_id` to continue the session, or generate a new UUID to start fresh.
  </Step>
</Steps>

## Endpoints

| Method | Endpoint | Description |
| - | - | - |
| `POST` | `/sessions/new` | Start a turn |
| `GET` | `/sessions` | List sessions |
| `GET` | `/sessions/{sessionId}` | Get session details |
| `PUT` | `/sessions/{sessionId}/title` | Rename session |
| `DEL` | `/sessions/{sessionId}` | Delete session |
| `PUT` | `/media/upload` | Upload files |
| `WSS` | `/ws/sessions/{sessionId}` | Real-time events |

## Rate Limits

Rate limits are enforced based on your plan. The `X-Rate-Limit-Max-Concurrent` header indicates the maximum turns you can run simultaneously. Exceeding limits returns `429` with an `X-Rate-Limit-Retry-After` header.

For custom limits and pricing, [contact sales](https://raccoonai.tech/contact).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.