Documentation Index
Fetch the complete documentation index at: https://docs.fim.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
For SSE streaming endpoints (/api/react and /api/dag), you can pass the token in the request body instead:
Response Format
Success Response
All successful API responses follow this structure:Error Response
Error responses include an error code and human-readable message:Paginated Responses
List endpoints return paginated results:Streaming (Server-Sent Events)
Chat endpoints (POST /api/react and POST /api/dag) return Server-Sent Events for real-time streaming. Each event has a type field indicating its content:
| Event Type | Description |
|---|---|
step | ReAct reasoning step (tool calls, thinking). For models with extended thinking (Claude, o-series, DeepSeek-R1), includes real-time thinking_delta content during tool-decision phases |
step_progress | DAG step progress (started/iteration/completed). May include thinking_delta content when the underlying agent streams reasoning tokens |
phase | Pipeline phase transition (planning/executing/analyzing) |
compact | Context compaction occurred |
answer | Streamed answer text (start/delta/done) |
done | Final result payload |
suggestions | Suggested follow-up questions |
title | Auto-generated conversation title |
end | Stream terminator (always last) |
Example SSE Stream
Cursor-based resume
Every SSE event carries a monotoniccursor integer scoped to the conversation. 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.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:| Error Code | HTTP Status | Meaning |
|---|---|---|
unauthorized | 401 | Invalid or missing authentication |
forbidden | 403 | User lacks permission for this resource |
not_found | 404 | Resource does not exist |
bad_request | 400 | Invalid request parameters |
rate_limit_exceeded | 429 | Too many requests (planned) |
internal_error | 500 | Server error |
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 current API version isv0.8.0. 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