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

# API Introduction

> Integrate Realm's capabilities into your applications and push data to Realm with our API

## Getting Started

Realm provides REST APIs for using agents and managing documents from your own applications.

Create an API key to start using the API. See [API Keys](/admin/api) for how to create and manage keys.

### Base URL

Use the following base URL for all API requests:

<Tabs>
  <Tab title="Default Environment">
    ```
    https://app.withrealm.com/api/external/alpha
    ```
  </Tab>

  <Tab title="Single Tenant Environment">
    ```
    https://<tenant>.withrealm.com/api/external/alpha
    ```

    Replace `<tenant>` with your organization's subdomain.
  </Tab>
</Tabs>

### Authentication

All API requests require authentication using a Bearer token:

```bash theme={null}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  https://app.withrealm.com/api/external/alpha/agents
```

## Available APIs

**Chats** - Create conversations with agents, continue existing chats, and retrieve or delete chat history. Supports both standard and streaming responses.

**Documents** - Create, update, retrieve, and delete documents in your custom data sources. You can also upload files directly for indexing into your knowledge base.

**Data sources** - List the API data sources available in your organization. Use data source IDs when working with the Documents API.

**Agents** - List the agents your API key has access to. Use agent IDs when creating chats.

## Rate Limits

The API uses rate limiting to ensure fair usage. If you exceed the limit, you'll receive a `429 Too Many Requests` response.

Each endpoint has a rate limit of 600 requests per minute, enforced separately per endpoint. If you exceed the rate limit, the request will be queued for up to 3 seconds before being rejected. We recommend implementing exponential backoff in your client applications when receiving 429 responses.

For workspaces not on usage-based billing, API chat requests and workflow runs share a temporary daily allowance of 4,000 credits (EUR 40) per user. Standard requests use 10 credits and research requests use 40 credits. API keys owned by the same user share this allowance, which resets at 00:00 UTC.

## Need Help?

If you encounter any issues or have questions, please contact our team in Slack or via email: [support@withrealm.com](mailto:support@withrealm.com)
