Skip to main content

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.

Omnigent exposes a REST API under the /v1/ base path and a Server-Sent Events stream for real-time session output. Every resource — sessions, hosts, runners, policies, files, and terminals — is reachable through standard HTTP verbs. The Python client SDK (omnigent-client) wraps these endpoints with fully typed async methods, automatic SSE reconnection, and streaming helpers so you can build integrations without hand-rolling HTTP logic.

Base URL

EnvironmentBase URL
Local serverhttp://localhost:6767
ProductionYour deployed server URL
All API paths are relative to the server root. The /v1/ prefix applies to every resource endpoint; the utility endpoints /api/version and /health are at the top level.
The full OpenAPI specification is available at /openapi.json on any running Omnigent server. You can import it into any OpenAPI-compatible tool (Postman, Insomnia, Scalar, etc.) for interactive exploration.

Python SDK

Install the Python client alongside the Omnigent package, or standalone:
# Standalone client only
pip install omnigent-client

# Full Omnigent package (includes the client)
pip install omnigent
Instantiate OmnigentClient as an async context manager:
from omnigent_client import OmnigentClient

async with OmnigentClient(base_url="http://localhost:6767") as client:
    sessions = await client.sessions.list()
    for s in sessions:
        print(s.id, s.status)
Pass a Bearer token when authentication is enabled:
async with OmnigentClient(
    base_url="http://localhost:6767",
    headers={"Authorization": "Bearer eyJhbGciOiJIUzI1NiIs..."},
) as client:
    ...

One-shot query

For single-turn agent invocations you can use client.query() directly:
result = await client.query(model="my-agent", input="Summarize this PR")
print(result.text)
Stream text tokens as they arrive:
stream = await client.query(model="my-agent", input="Write a test", stream=True)
async for chunk in stream:
    print(chunk, end="", flush=True)

SDK Namespaces

OmnigentClient organises endpoints into namespaces:
NamespaceClassDescription
client.sessionsSessionsNamespaceCreate, list, stream, and manage sessions
client.filesFilesNamespaceUpload and download session file resources
client.responsesResponsesNamespaceLow-level /v1/responses streaming (legacy)
The session() and sessions_chat() helpers on OmnigentClient are higher-level abstractions built on top of these namespaces.

API Endpoints at a Glance

GroupBase PathPage
Sessions/v1/sessionsSessions
Session Events/v1/sessions/{id}/streamSession Events
Session Policies/v1/sessions/{id}/policiesSession Policies
Hosts/v1/hostsHosts
Runners/v1/runnersRunners
Resources/v1/sessions/{id}/resourcesResources
Agents/v1/agentsAgents & Registry
Server Policies/v1/policiesAgents & Registry
Policy Registry/v1/policy-registryAgents & Registry

Versioning

Two utility endpoints are available at the server root: GET /api/version — Returns the installed Omnigent package version:
{ "version": "0.1.0" }
GET /health — Liveness check with optional per-session runner status:
# Bare liveness
curl http://localhost:6767/health

# With runner/host status for a session
curl "http://localhost:6767/health?session_id=conv_abc123"

# Batch lookup for multiple sessions
curl "http://localhost:6767/health?session_ids=conv_abc,conv_def,conv_ghi"
Response shape for liveness with session info:
{
  "status": "ok",
  "session": {
    "id": "conv_abc123",
    "runner_online": true,
    "host_online": true
  }
}

Error Handling

The API returns standard HTTP status codes:
CodeMeaning
200 / 201 / 202Success
400Invalid input — check request body
401Unauthenticated
403Forbidden — insufficient permissions
404Resource not found
409Conflict (e.g. duplicate name, host offline)
422Validation error — see detail array
504Timeout communicating with host or runner
Validation errors (422) follow FastAPI’s standard shape:
{
  "detail": [
    {
      "loc": ["body", "handler"],
      "msg": "Field required",
      "type": "missing"
    }
  ]
}
Domain errors return a flat JSON body with code and message fields:
{
  "code": "not_found",
  "message": "Session conv_abc123 does not exist"
}
The Python SDK raises OmnigentError on any non-2xx response. Access error.code and error.message to inspect the failure:
from omnigent_client import OmnigentClient, OmnigentError

try:
    session = await client.sessions.get("conv_nonexistent")
except OmnigentError as e:
    print(e.code, e.message)

Build docs developers (and LLMs) love