Getting Started
API overview
Use the MuChat API to chat with your agents, export conversations, and check service availability.
What is the MuChat API?
Send messages to an AI agent and retrieve conversation transcripts through an HTTPS API. Responses use JSON, errors follow RFC 9457, and conversation exports use cursor pagination. Query also supports streaming with Server-Sent Events (SSE).
Base URL:
https://api.mu.chatQuick Start
Get your channel API key
Open the dashboard, select your agent, then go to Deploy → API → Setup / Manage and create or copy its channel key.
Store the key in your server's environment variables.
Send your first message
curl --request POST 'https://api.mu.chat/v2/chat' \
--header 'Authorization: Bearer YOUR_CHANNEL_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"query":"Hello!","external_message_id":"message-001","stream":false}'The response contains data.message and data.metadata. Read the query reference for the full response schema and examples.
Continue the conversation
Send data.metadata.conversation_id with your next query. Give each new message a new external_message_id; keep the original ID and body when retrying the same request.
Set stream: true to receive streaming events.
Endpoints
| Method | Endpoint | Authentication |
|---|---|---|
GET | Health — /v2/health | None |
POST | Send a query — /v2/chat | Channel API key |
GET | Export conversations — /v2/agents/{agent_id}/conversations/export | Platform API key |
Query identifies the agent from the channel key. Export requires agent_id in the URL path and a platform key belonging to the agent's organization.
Export conversation text
Create a platform key in Settings → Developer → API keys, then request the first page:
curl --get 'https://api.mu.chat/v2/agents/YOUR_AGENT_ID/conversations/export' \
--header 'Authorization: Bearer YOUR_PLATFORM_API_KEY' \
--data-urlencode 'limit=20'Read data[].messages[].content_text and follow pagination.next_cursor while pagination.has_more is true. The first page returns up to 20 newest threads by creation time. Each row matches a CSV thread and includes its complete public transcript, with messages oldest first. Pagination retrieves older threads. The export reference includes filters, limits, response fields and a complete Python example.
Response Headers
| Header | Availability | Description |
|---|---|---|
X-Request-ID | All three endpoints | Request identifier to include when contacting support. |
X-RateLimit-Limit | Export | Maximum requests in the rate-limit window: 30 per minute per organization. |
X-RateLimit-Remaining | Export | Requests remaining in the current window. |
X-RateLimit-Reset | Export | Unix timestamp in seconds when the current window resets. |
Retry-After | Export 429 / limiter unavailable 503 | Seconds to wait before retrying. |
Health checks whether the API process responds; it does not verify database or AI provider availability. See Error Handling for error responses and retries.