API 참조 문서는 현재 영어로만 제공됩니다. 다른 언어로 이 페이지를 보고 있다면 영어 버전으로 전환하세요 — 왼쪽 사이드바에 전체 API 엔드포인트 목록이 표시됩니다.
기본 URL
인증
모든 API 요청은 API 키 또는 JWT 토큰을 통한 인증이 필요합니다.API 키 사용
Authorization 헤더에 API 키를 포함하세요:
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:
응답 형식
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:
페이지 매김 응답
목록 엔드포인트는 페이지 매김된 결과를 반환합니다: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).
속도 제한
키별 속도 제한은 향후 릴리스에서 계획되어 있습니다. 현재는 강제된 키별 요청 제한이 없지만, API를 책임감 있게 사용해 주시기 바랍니다.페이지네이션
목록 엔드포인트는 쿼리 매개변수를 통한 페이지네이션을 지원합니다:page(기본값: 1) — 페이지 번호, 1부터 시작size(기본값: 20) — 페이지당 항목 수, 최대 100
타임스탬프
모든 타임스탬프는 UTC 시간대의 ISO 8601 형식입니다: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 플레이그라운드
각 엔드포인트 페이지에는 다음을 수행할 수 있는 대화형 API 플레이그라운드가 포함되어 있습니다:- 브라우저에서 직접 요청 테스트
- 실제 응답 보기
- 여러 언어로 요청 코드 복사
- API 키로 인증
API 플레이그라운드는 브라우저에서 요청을 실행하므로, API 키에 적절한 CORS 권한이 있는지 확인하세요(일반적으로 동일 출처 요청에 대해 기본적으로 활성화됨).
SDK 가용성
FIM One API는 완전히 REST 기반이지만, 인기 있는 언어로 SDK를 사용할 수 있습니다(또는 곧 출시될 예정입니다):- Python: 곧 출시 예정
- JavaScript/TypeScript: 곧 출시 예정
- Go: 곧 출시 예정
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.
지원
API 문제 또는 질문의 경우:- 문서: 각 엔드포인트에 대한 자세한 가이드 참조
- GitHub Issues: https://github.com/fim-ai/fim-one/issues에서 버그 보고
- Discord Community: 커뮤니티에 참여하여 토론