API reference documentation is currently available in English only. If you are viewing this page in another language, please switch to the English version — the full API endpoint list will appear in the left sidebar.
Base URL
Authentication
All API requests require authentication via an API key or JWT token.Using API Key
Include your API key in theAuthorization header:
Using JWT Token
The SSE streaming endpoints (/api/react, /api/dag and /api/auto) read the token from the request body, not from the Authorization header. The value can be a JWT access token or an API key:
Response Format
Success Response
Most endpoints that return a single resource or an acknowledgement wrap it in this structure (list endpoints and the sign-in endpoints return their payload directly):Error Response
Error responses carry a human-readabledetail, a machine-readable error_code (null for a few generic errors), and error_args with values for the message:
Paginated Responses
List endpoints return paginated results:Streaming (Server-Sent Events)
Chat endpoints (POST /api/react, POST /api/dag and POST /api/auto) return Server-Sent Events for real-time streaming. Each event has a type field indicating its content:
The conversation title is generated in the background after
end; read it from GET /api/conversations/{id}.
Example SSE Stream
Cursor-based resume
Every persisted SSE event is sent as{"cursor": <int>, "data": {...}}; the cursor increases monotonically within the assistant turn. Clients should track the highest cursor seen. When the connection drops mid-turn (network error, proxy timeout, server restart), the client can re-subscribe without re-running the agent:
cursor > 42 and ends with a terminal event: resume_done frame. Pass cursor: -1 to request a full replay from the beginning.
Error responses:
404 conversation_not_found— conversation id is invalid or not owned by the authenticated user404 no_recent_assistant_message— conversation has no persisted assistant turn to resume from (e.g., a brand-new conversation with no user messages yet)400 invalid_cursor— cursor is not a non-negative integer or-1
useSseResume hook in the playground) auto-retries network disconnects with exponential backoff (300ms → 1s → 3s, max 3 attempts) and distinguishes user-initiated abort from network error to avoid unintended reconnects. See the playground-page.tsx integration for the full pattern.
Resume is stateless — it replays from the assistant message’s stored
sse_events array. If the agent’s turn was interrupted before any assistant message was persisted (e.g., a crash before done), the dangling tool_use block is auto-repaired by DbMemory._repair_dangling_tool_calls on the next turn. Synthetic tool_result rows are persisted with metadata_.synthetic=true and metadata_.reason="interrupted" for audit.Business References
A system that embeds FIM One can tag each conversation with the id of the business object it is about, such as a contract number or a ticket id, and later reopen the latest conversation for that object.business_refis optional text. It is normalized to Unicode NFC, then surrounding whitespace is trimmed; an empty value means no reference. A value longer than 200 characters after normalization, or one containing control characters (C0 or C1), zero-width or other format characters, or the line and paragraph separators U+2028 and U+2029, is refused with422(invalid_business_reffor query parameters). The value is otherwise stored as given: it is not unique, not interpreted, and never passed to the model.- Filters and lookups match exactly and case-sensitively, after the same NFC normalization:
HT-1does not findht-1, while a reference sent in decomposed form finds the one stored in composed form. - A reference belongs to the conversation’s owner. Filters and lookups only ever consider the caller’s own conversations, and administrator lists and exports do not show it. The administrators’ full backup (
GET /api/admin/export/full-backup) leaves it out, so anything rebuilt from that backup has no references. The owner’s data export (GET /api/auth/me/export) includes it.
GET /api/conversations/latest orders by the newest message, falling back to the creation time, and considers active conversations unless status=archived is given. The list keeps its own order (starred first, then newest created).
Rate Limiting
Per-key rate limiting is planned for a future release. Currently there are no enforced per-key request limits, but please use the API responsibly.Pagination
List endpoints support pagination via query parameters:page(default: 1) — page number, starting from 1size(default: 20) — items per page, max 100
Timestamps
All timestamps are in ISO 8601 format with UTC timezone:Error Codes
Common error codes and their meanings:
Errors raised by the authentication layer for a bad
Authorization header (Invalid token, Token has expired, Invalid API key, API key is disabled) return 401 with error_code: null; rely on the status code and detail for those. Request validation failures return 422.
API Playground
Each endpoint page includes an interactive API Playground where you can:- Test requests directly from your browser
- View real responses
- Copy request code in multiple languages
- Authenticate with your API key
The API Playground runs requests from your browser, so ensure your API key has appropriate CORS permissions (usually enabled by default for same-origin requests).
SDK Availability
While FIM One API is fully REST-based, SDKs are available (or coming soon) in popular languages:- Python: Coming soon
- JavaScript/TypeScript: Coming soon
- Go: Coming soon
Versioning
The API carries the application version, reported byGET /api/version. Version is not included in the URL path; breaking changes will be signaled through major version bumps and a migration period.
Support
For API issues or questions:- Documentation: See detailed guides on each endpoint
- GitHub Issues: Report bugs at https://github.com/fim-ai/fim-one/issues
- Discord Community: Join our community for discussion