{ "openapi": "3.1.0", "info": { "title": "FIM One API", "description": "All-in-one agent platform for Global × China enterprises — programmatic access to agents, conversations, knowledge bases, and more.", "version": "0.8.9" }, "paths": { "/api/chat/inject": { "post": { "summary": "Inject Message", "description": "Inject a user message into a running agent execution.\n\nThe message is queued for the agent to absorb at its next natural\nbreakpoint (between iterations). It is also persisted immediately\nto the conversation history.\n\nReturns 409 if no active execution exists for the conversation.", "operationId": "inject_message_api_chat_inject_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InjectMessageRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Inject Message Api Chat Inject Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/react": { "post": { "summary": "React Endpoint", "description": "Run a ReAct agent query with SSE progress updates.\n\nParameters\n----------\nrequest : Request\n The incoming HTTP request; used to detect client disconnects.\nbody : ChatStreamRequest\n JSON request body containing the query and optional parameters.", "operationId": "react_endpoint_api_react_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatStreamRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/dag": { "post": { "summary": "Dag Endpoint", "description": "Run a DAG planner pipeline with SSE progress updates.\n\nParameters\n----------\nrequest : Request\n The incoming HTTP request; used to detect client disconnects.\nbody : ChatStreamRequest\n JSON request body containing the query and optional parameters.", "operationId": "dag_endpoint_api_dag_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatStreamRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/conversations": { "post": { "tags": [ "conversations" ], "summary": "Create Conversation", "operationId": "create_conversation_api_conversations_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConversationCreate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "tags": [ "conversations" ], "summary": "List Conversations", "operationId": "list_conversations_api_conversations_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Size" } }, { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "default": "active", "title": "Status" } }, { "name": "q", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 200 }, { "type": "null" } ], "title": "Q" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/conversations/{conversation_id}": { "get": { "tags": [ "conversations" ], "summary": "Get Conversation", "operationId": "get_conversation_api_conversations__conversation_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "conversation_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Conversation Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "conversations" ], "summary": "Update Conversation", "operationId": "update_conversation_api_conversations__conversation_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "conversation_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Conversation Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConversationUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "conversations" ], "summary": "Delete Conversation", "operationId": "delete_conversation_api_conversations__conversation_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "conversation_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Conversation Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/agents": { "get": { "tags": [ "agents" ], "summary": "List Agents", "operationId": "list_agents_api_agents_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Size" } }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/agents/{agent_id}": { "get": { "tags": [ "agents" ], "summary": "Get Agent", "operationId": "get_agent_api_agents__agent_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Agent Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/knowledge-bases": { "get": { "tags": [ "knowledge-bases" ], "summary": "List Kbs", "operationId": "list_kbs_api_knowledge_bases_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/knowledge-bases/{kb_id}/retrieve": { "post": { "tags": [ "knowledge-bases" ], "summary": "Retrieve From Kb", "operationId": "retrieve_from_kb_api_knowledge_bases__kb_id__retrieve_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "kb_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Kb Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/KBRetrieveRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/me/api-keys": { "get": { "tags": [ "user-settings" ], "summary": "List My Api Keys", "description": "List the authenticated user's own API keys (paginated).", "operationId": "list_my_api_keys_api_me_api_keys_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedUserApiKeyResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "user-settings" ], "summary": "Create My Api Key", "description": "Create a new personal API key. The full key is returned only once.", "operationId": "create_my_api_key_api_me_api_keys_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserApiKeyCreateRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserApiKeyCreateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/me/api-keys/{key_id}/active": { "patch": { "tags": [ "user-settings" ], "summary": "Toggle My Api Key Active", "description": "Enable or disable one of the user's own API keys.", "operationId": "toggle_my_api_key_active_api_me_api_keys__key_id__active_patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "key_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Key Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserApiKeyToggleRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserApiKeyInfo" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/me/api-keys/{key_id}": { "delete": { "tags": [ "user-settings" ], "summary": "Delete My Api Key", "description": "Permanently delete one of the user's own API keys.", "operationId": "delete_my_api_key_api_me_api_keys__key_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "key_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Key Id" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } } }, "components": { "schemas": { "ApiResponse": { "properties": { "success": { "type": "boolean", "title": "Success", "default": true }, "data": { "title": "Data" }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } }, "type": "object", "title": "ApiResponse" }, "ChatStreamRequest": { "properties": { "q": { "type": "string", "title": "Q" }, "conversation_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Conversation Id" }, "agent_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Agent Id" }, "token": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Token" }, "image_ids": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Image Ids" }, "user_metadata": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "User Metadata" }, "doc_mode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Doc Mode" } }, "type": "object", "required": [ "q" ], "title": "ChatStreamRequest", "description": "Request body for ReAct/DAG streaming endpoints." }, "ConversationCreate": { "properties": { "title": { "type": "string", "title": "Title", "default": "" }, "mode": { "type": "string", "enum": [ "react", "dag", "auto" ], "title": "Mode", "default": "auto" }, "agent_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Agent Id" }, "model_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Model Name" } }, "type": "object", "title": "ConversationCreate" }, "ConversationUpdate": { "properties": { "title": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Title" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active", "archived" ] }, { "type": "null" } ], "title": "Status" }, "starred": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Starred" } }, "type": "object", "title": "ConversationUpdate" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "InjectMessageRequest": { "properties": { "conversation_id": { "type": "string", "title": "Conversation Id" }, "content": { "type": "string", "title": "Content" } }, "type": "object", "required": [ "conversation_id", "content" ], "title": "InjectMessageRequest", "description": "Request body for injecting a message into an active agent execution." }, "KBRetrieveRequest": { "properties": { "query": { "type": "string", "minLength": 1, "title": "Query" }, "top_k": { "type": "integer", "maximum": 50.0, "minimum": 1.0, "title": "Top K", "default": 5 } }, "type": "object", "required": [ "query" ], "title": "KBRetrieveRequest" }, "PaginatedResponse": { "properties": { "items": { "items": {}, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "page": { "type": "integer", "title": "Page" }, "size": { "type": "integer", "title": "Size" }, "pages": { "type": "integer", "title": "Pages" } }, "type": "object", "required": [ "items", "total", "page", "size", "pages" ], "title": "PaginatedResponse" }, "PaginatedUserApiKeyResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/UserApiKeyInfo" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "page": { "type": "integer", "title": "Page" }, "size": { "type": "integer", "title": "Size" }, "pages": { "type": "integer", "title": "Pages" } }, "type": "object", "required": [ "items", "total", "page", "size", "pages" ], "title": "PaginatedUserApiKeyResponse" }, "UserApiKeyCreateRequest": { "properties": { "name": { "type": "string", "maxLength": 100, "minLength": 1, "title": "Name" }, "scopes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Scopes" }, "expires_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Expires At" } }, "type": "object", "required": [ "name" ], "title": "UserApiKeyCreateRequest" }, "UserApiKeyCreateResponse": { "properties": { "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "key": { "type": "string", "title": "Key" }, "key_prefix": { "type": "string", "title": "Key Prefix" }, "scopes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Scopes" }, "expires_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Expires At" }, "created_at": { "type": "string", "title": "Created At" } }, "type": "object", "required": [ "id", "name", "key", "key_prefix", "created_at" ], "title": "UserApiKeyCreateResponse", "description": "Returned only at creation time -- includes the full key." }, "UserApiKeyInfo": { "properties": { "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "key_prefix": { "type": "string", "title": "Key Prefix" }, "scopes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Scopes" }, "is_active": { "type": "boolean", "title": "Is Active" }, "expires_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Expires At" }, "last_used_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Last Used At" }, "total_requests": { "type": "integer", "title": "Total Requests", "default": 0 }, "created_at": { "type": "string", "title": "Created At" } }, "type": "object", "required": [ "id", "name", "key_prefix", "is_active", "created_at" ], "title": "UserApiKeyInfo" }, "UserApiKeyToggleRequest": { "properties": { "is_active": { "type": "boolean", "title": "Is Active" } }, "type": "object", "required": [ "is_active" ], "title": "UserApiKeyToggleRequest" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" }, "input": { "title": "Input" }, "ctx": { "type": "object", "title": "Context" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "API Key (fim_xxx) or JWT token" } } }, "security": [ { "BearerAuth": [] } ], "servers": [ { "url": "https://your-domain.com", "description": "Your FIM One instance" } ] }