Agents API (Beta)
Access LibreChat agents programmatically via OpenAI-compatible and Open Responses API endpoints
Beta Feature
The Agents API is currently in beta. Endpoints, request/response formats, and behavior may change as we iterate toward a stable release.
LibreChat exposes your agents through two API-compatible interfaces, allowing external applications, scripts, and services to interact with your agents programmatically.
Overview
The Agents API provides two interfaces:
- OpenAI-compatible Chat Completions —
POST /api/agents/v1/chat/completions - Open Responses API —
POST /api/agents/v1/responses
Both are authenticated via API keys and support streaming responses, making it easy to integrate LibreChat agents into existing workflows that already use OpenAI SDKs or similar tooling.
LibreChat is adopting Open Responses as its primary API framework for serving agents. While the Chat Completions endpoint provides backward compatibility with existing OpenAI-compatible tooling, the Open Responses endpoint represents the future direction. See our blog post for more on this decision.
Enabling the Agents API
The Agents API is gated behind the remoteAgents interface configuration. All permissions default to false.
See Interface Configuration — remoteAgents for all available options.
Note: Admin users have all remote agent permissions enabled by default.
API Key Management
Once remoteAgents.use and remoteAgents.create are enabled, users can generate API keys from the LibreChat UI. These keys authenticate requests to the Agents API.
Endpoints
Chat Completions (OpenAI-compatible)
Use any OpenAI-compatible SDK by pointing it at your LibreChat instance. The model parameter corresponds to an agent ID.
Example with curl:
Example with OpenAI SDK (Python):
List Models
Returns available agents as models. Useful for discovering which agents are accessible with your API key.
Open Responses API
The Open Responses endpoint follows the Open Responses specification, an open inference standard initiated by OpenAI and built by the open-source AI community. It is designed for agentic workflows with native support for reasoning, tool use, structured outputs, and streaming semantic events.
Token Usage Tracking
All Agents API requests track token usage against the user's balance (when token spending is configured). Both input and output tokens are counted, including cache tokens for providers that support them (OpenAI, Anthropic).
Roadmap
- Open Responses as primary interface — We plan to expand the Open Responses endpoint with full support for agentic loops, tool orchestration, and streaming semantic events.
- Anthropic Messages API — We may add support for the Anthropic Messages API format as an additional interface in the future.
Related Documentation
- Agents — Creating and configuring agents
- Interface Configuration — remoteAgents — Access control settings
- Token Usage — Configuring token spending and balance
- Open Responses Specification — The open inference standard
How is this guide?