Overview
The Agents API allows you to create, manage, and interact with AI agents. Agents are AI assistants with custom instructions, tools, and capabilities. All agent endpoints are prefixed with/api/agents.
List Agents
Retrieve accessible agents:Query Parameters
Maximum number of agents to return
Cursor for pagination
Response
Get Agent
Retrieve a specific agent by ID:Path Parameters
Agent ID
Response
Unique agent identifier
Agent name
Agent description
System instructions for the agent
Model identifier (e.g.,
gpt-4, claude-3-opus)Provider identifier (e.g.,
openai, anthropic)Array of enabled tool identifiers
Tool-specific resources (e.g., file_ids for code_interpreter)
User ID of the agent creator
Avatar configuration
Create Agent
Create a new AI agent:Request Body
Agent name (max 256 characters)
Brief description of the agent’s purpose
System instructions that define the agent’s behavior
Model to use (e.g.,
gpt-4, claude-3-opus)AI provider (e.g.,
openai, anthropic, google)Array of tool identifiers to enable
Tool-specific resources and configurations
Sampling temperature (0-2)
Nucleus sampling parameter (0-1)
Response
Returns the created agent object with HTTP status 201.Update Agent
Update an existing agent:Path Parameters
Agent ID to update
Request Body
All fields from Create Agent are optional for updates. Only include fields you want to change.Response
Returns the updated agent object.Delete Agent
Delete an agent:Path Parameters
Agent ID to delete
Response
Revert Agent Version
Revert an agent to a previous version:Path Parameters
Agent ID
Request Body
Version number to revert to
Chat with Agent
Send a message to an agent and get a streaming response:Request Body
Conversation ID (use UUID or
new for new conversation)ID of the agent to chat with
User message text
ID of the parent message for threading
File attachments
Response
Returns a stream ID for Server-Sent Events (SSE) streaming:Stream Agent Response
Subscribe to an agent’s streaming response:Path Parameters
Stream ID (usually equals conversationId)
Query Parameters
Set to
true for reconnection (sends sync event with resume state)Response
Server-Sent Events (SSE) stream with the following event types:Message Event
Sync Event (on reconnection)
Error Event
Abort Generation
Abort an ongoing agent response:Request Body
Stream ID to abort
Conversation ID
Abort key (alternative identifier)
Response
Get Active Jobs
Get all active generation jobs for the current user:Response
Check Generation Status
Check if there’s an active generation for a conversation:Path Parameters
Conversation ID
Response
Whether generation is currently active
Stream ID if active
Job status:
running, completed, or failedContent generated so far
Complete resume state for reconnection
OpenAI-Compatible API
LibreChat provides an OpenAI-compatible API for agents:Chat Completions
Available Tools
Agents can use the following tools:code_interpreter- Execute Python codeweb_search- Search the webcalculator- Perform calculationsfile_search- Search uploaded documentsdalle- Generate images- Custom MCP (Model Context Protocol) tools
Permissions
Agent access is controlled by permissions:- VIEW: Can view agent details
- USE: Can chat with agent
- EDIT: Can modify agent configuration
- DELETE: Can delete agent
- SHARE: Can share agent with others