Resources are objects attached to a session. Omnigent currently supports three resource types: files (user-uploaded binary artifacts the agent can read), terminals (interactive shell sessions the agent or user can attach to), and environments (sandboxed workspaces with filesystem access, diff support, and shell execution). Resources are created automatically by the runner as the session progresses, or explicitly by the user via upload or launch endpoints.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/omnigent-ai/omnigent/llms.txt
Use this file to discover all available pages before exploring further.
File resources are binary-safe — they are stored as raw bytes and served back with the original content type. Terminal resources use a WebSocket connection for interactive I/O (not covered by this REST reference — see the WebSocket terminal documentation).
Generic Resource Endpoints
List All Resources
GET /v1/sessions/{session_id}/resources
Returns the runner-authoritative resource inventory for a session. Requires the session to be bound to a runner.
Optional filter by resource type:
"environment", "terminal", or "file".SessionResourcePaginatedList:
Opaque resource identifier, e.g.
"default" or "terminal_bash_s1".Always
"session.resource".Resource kind:
"environment", "terminal", or "file".Owning session/conversation identifier.
Human-readable display name.
Resource-type-specific metadata dict.
For terminal resources: the environment ID the terminal runs in. Omitted for non-terminal resources.
Get a Resource by ID
GET /v1/sessions/{session_id}/resources/{resource_id}
Returns a single resource by its opaque ID, regardless of type.
File Resources
File resources are user-uploaded binary artifacts stored in the session’s file namespace.List Session Files
GET /v1/sessions/{session_id}/resources/files
Maximum files to return. Range: 1–1000.
Forward pagination cursor (file ID).
Backward pagination cursor.
Sort direction:
"desc" or "asc".Upload a File
POST /v1/sessions/{session_id}/resources/files
Accepts a multipart/form-data upload. The file is stored under the session’s file namespace and returned as a resource object.
201 Created:
Get File Metadata
GET /v1/sessions/{session_id}/resources/files/{file_id}
Returns metadata for a session file resource. Verifies that file_id belongs to session_id.
Download File Content
GET /v1/sessions/{session_id}/resources/files/{file_id}/content
Downloads the raw bytes of a session file. Response includes Content-Type set to the file’s media type.
Delete a File
DELETE /v1/sessions/{session_id}/resources/files/{file_id}
Deletes a session file resource and its stored bytes.
Terminal Resources
Terminal resources are interactive shell sessions running on the host inside the session’s environment.List Session Terminals
GET /v1/sessions/{session_id}/resources/terminals
Returns terminal resources for the session. Pagination parameters (limit, after, before, order) are forwarded to the runner.
Launch a Terminal
POST /v1/sessions/{session_id}/resources/terminals
Launches a terminal or returns an existing one (idempotent on terminal + session_key). User-initiated creates are gated on the agent spec’s terminals: block — the requested terminal name must be declared in the agent spec.
Get a Terminal
GET /v1/sessions/{session_id}/resources/terminals/{terminal_id}
Returns a single terminal resource object.
Close a Terminal
DELETE /v1/sessions/{session_id}/resources/terminals/{terminal_id}
Closes the terminal. Returns 404 for unknown terminals.
Transfer a Terminal
POST /v1/sessions/{session_id}/resources/terminals/{terminal_id}/transfer
Moves a terminal resource to another session without closing it. Used by native Claude /clear rotation where the tmux pane keeps running but ownership transfers to the new conversation.
Environment Resources
Environments are sandboxed workspaces with a filesystem, file watching, search, diff support, and shell execution.List Environments
GET /v1/sessions/{session_id}/resources/environments
Returns environment resources for the session.
Get an Environment
GET /v1/sessions/{session_id}/resources/environments/{environment_id}
Returns a single environment resource. The environment_id for the default workspace is typically "default".
Browse Filesystem (Root)
GET /v1/sessions/{session_id}/resources/environments/{environment_id}/filesystem
Lists the root directory of the environment.
Maximum entries to return.
Forward pagination cursor.
Sort direction.
Browse Filesystem (Path)
GET /v1/sessions/{session_id}/resources/environments/{environment_id}/filesystem/{relative_path}
Reads a file or lists a directory at relative_path (relative to the environment root). Returns file content or a paginated directory listing.
Write a File
PUT /v1/sessions/{session_id}/resources/environments/{environment_id}/filesystem/{relative_path}
Writes or replaces a file at the given path.
Edit a File (Text Replacement)
PATCH /v1/sessions/{session_id}/resources/environments/{environment_id}/filesystem/{relative_path}
Edits a file via text replacement.
Delete a Path
DELETE /v1/sessions/{session_id}/resources/environments/{environment_id}/filesystem/{relative_path}
Deletes a file or directory at the given path.
List Changed Files
GET /v1/sessions/{session_id}/resources/environments/{environment_id}/changes
Returns a flat list of all files changed since the session started (created, modified, or deleted). Backed by the runner’s filesystem watchdog.
Response:
Diff a File
GET /v1/sessions/{session_id}/resources/environments/{environment_id}/diff/{relative_path}
Returns before/after content for a changed file. Returns 404 when the file has not been modified this session.
Response:
Search Files
GET /v1/sessions/{session_id}/resources/environments/{environment_id}/search
Searches for files by name/path substring. Returns matching file entries (not directories).
Case-insensitive search substring. Must contain at least one non-whitespace character.
Comma-separated glob patterns to scope results, e.g.
"*.ts,src/**".Comma-separated glob patterns to exclude, e.g.
"**/node_modules,*.test.ts".Maximum results. Range: 1–500.
Run Shell Command
POST /v1/sessions/{session_id}/resources/environments/{environment_id}/shell
Executes a shell command in the environment.