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

# API Documentation

> REST API and MCP for building and managing AI agents

Everything an agent does through these interfaces runs on xpander: every call to a model or a company system is validated, credentialed at the moment of use, budgeted, and recorded under the person who asked. Pick the interface that fits:

> [card] [REST API](https://docs.xpander.ai/api-reference/rest-api.md)
>
> **REST API**
>
> HTTPS endpoints for agents, tasks, skills, knowledge and workflows, from any language.

> [card] [Model Context Protocol](https://docs.xpander.ai/api-reference/mcp.md)
>
> **MCP for Claude & IDEs**
>
> Reach agents and skills over MCP from Claude Desktop, Cursor, and other MCP clients.

## Quick Comparison

| Feature | REST API | Model Context Protocol |
| - | - | - |
| **Language Support** | Any language | Any MCP client |
| **Primary Use Case** | Control plane operations | Discovering & invoking agents |
| **Setup Complexity** | Minimal (API key) | MCP client config |
| **Best For** | CRUD operations, integrations | IDE/AI client integration |
| **Real-time** | Polling or webhooks | Server-Sent Events |

## Getting Started

**1. Get API Credentials**

Register at [chat.xpander.ai](https://chat.xpander.ai) (free on the cloud edition) or sign in to your organization's self-hosted app, then generate your API key under Settings

**2. Choose Your Integration**

* **REST API**: For universal access from any language
* **MCP Protocol**: For IDE and AI client integration

**3. Follow the Guide**

The REST page opens with a curl call, the MCP page with a client configuration.

## REST API

The REST API manages your resources:

```bash theme={"dark"}
# List agents
curl -X GET "https://api.xpander.ai/v1/agents" \
  -H "x-api-key: YOUR_API_KEY"

# Invoke an agent
curl -X POST "https://api.xpander.ai/v1/agents/{agent_id}/invoke" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": {"text": "Analyze this data"}}'
```

> [card] [Explore REST API](https://docs.xpander.ai/api-reference/rest-api.md)
>
> Every endpoint with its request and response schema

## Model Context Protocol - Expose to Claude & IDEs

Connect your agents and skills to Claude Desktop, Cursor, and other MCP clients. The endpoint signs the client in with OAuth 2.1 in the browser; no key goes into the file:

```json theme={"dark"}
{
  "mcpServers": {
    "xpander": {
      "command": "npx",
      "args": ["-y", "mcp-remote@latest", "https://mcp.xpander.ai"]
    }
  }
}
```

> [card] [Explore MCP Integration](https://docs.xpander.ai/api-reference/mcp.md)
>
> View complete MCP setup guide with examples

## Authentication

REST calls and webhooks authenticate with an API key; the MCP endpoint uses OAuth 2.1 instead:

```bash theme={"dark"}
export XPANDER_API_KEY="your-api-key"
```

Generate your API key under Settings in Xpander Chat ([chat.xpander.ai](https://chat.xpander.ai) on the cloud edition, your own address when self-hosted).

## Common Use Cases

> [accordion] Integrating with Existing Applications
>
> **Use REST API** for integrating xpander into existing applications written in any language. Perfect for microservices, web apps, and mobile applications.

> [accordion] IDE and AI Client Access
>
> **Use Model Context Protocol** for accessing agents from Claude Desktop, Cursor, VSCode, or any MCP-compatible client. Enables agent discovery and invocation from your development environment.

## API Resources

> [card] [REST API Endpoints](https://docs.xpander.ai/api-reference/v1/agents/list-agents.md)
>
> Browse all REST API endpoints

> [card] [Examples](https://github.com/xpander-ai/xpander.ai)
>
> View code examples and tutorials

> [card] [User Guide](https://docs.xpander.ai/use.md)
>
> Full documentation for using xpander

## Support & Community

> [card] [Slack Community](https://join.slack.com/t/xpandercommunity/shared_invite/zt-2mt2xkxkz-omM7f~_h2jcuzFudrYtZQQ)
>
> Join our community

> [card] [Discord](https://discord.gg/CUcp4WWh5g)
>
> Developer discussions

> [card] [GitHub](https://github.com/xpander-ai)
>
> View source code


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