OpenAgentCore

module
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: MIT

README

The OpenAI Agents API, open source and self-hosted. Run Codex, Claude Code or MiniMax Code on your own machines with your own models, through the official OpenAI SDK.

Release License

Website · Documentation · Quickstart · Contributing

English · 简体中文

Deployment overview

  • Same API as OpenAI. Set OPENAI_BASE_URL and the official OpenAI SDK, or plain HTTP, works unchanged.
  • Your agent, your model. Each Session runs Codex, Claude Code or MiniMax Code natively, as it runs on your machine, with the model provider you configure. See Harness capabilities.
  • Compute that sleeps, workspaces that stay. On microsandbox, which keeps every workspace on independent storage, idle sandboxes release compute and resume on a compatible node with their files intact. E2B pauses idle sandboxes in place. Your own Linux, macOS or Windows machine also runs Sessions. See Sandbox Provider protocol.
  • Replaceable parts. Sandbox Providers, workspace filesystems, Harnesses and model providers plug in through defined protocols.

Quickstart

Install Core, Web and PostgreSQL on Linux or macOS with Docker:

curl -fsSL https://openagentcore.dev/install.sh | bash

On Windows, in PowerShell:

irm https://github.com/MiniMax-AI/OpenAgentCore/releases/latest/download/install.ps1 | iex

In Web, sign in with the Core key the installer prints, configure the public address, set a default model, issue a Project API key and add sandbox capacity (a node, E2B or OpenSandbox). Install Core and Web covers each step.

Then call it with the OpenAI SDK, with OPENAI_BASE_URL set to your API base URL (https://core.example/v1) and OPENAI_API_KEY to the Project API key:

from openai import OpenAI

client = OpenAI()  # reads OPENAI_BASE_URL and OPENAI_API_KEY
session = client.beta.agents.sessions.create(
    environment={"type": "openai_hosted"},
    input="Create /workspace/hello.txt with a short greeting, then describe it.",
    extra_body={"agent": {"x_agents_core": {"harness": "codex"}}},
)
print(session.id)

Run your first Session waits for the result and reads it back.

How it works

OpenAgentCore architecture

Applications and operators use these Core APIs:

API Path Used by
Agents API /v1 Your applications. Same protocol as OpenAI's Agents API
Core API /core/v1 Operators, through Web

Core keeps durable execution state. The Runtime runs the chosen Harness inside the Environment. Each connection is a defined protocol, so any part can be replaced on its own. See Architecture.

Documentation

I want to Start with
Install and operate an installation Install Core and Web, then Operations
Build an application on the API Run your first Session, then the Agents API guide
See a complete application Examples
Run agents on my own machine Run self-hosted Sessions
Check Harness capabilities and limits Harness capabilities
Understand the design Architecture
Add a sandbox, Harness or other component Develop OpenAgentCore

Contributing and license

Read CONTRIBUTING.md before changing code. Report bugs and ask questions in GitHub Issues. Released under the MIT License.

Directories

Path Synopsis
apps
daemon/cmd/oac-daemon command
Command oac-daemon is the reverse-WebSocket worker that connects a machine to an OpenAgentCore server and exposes a local agent CLI subprocess as a connector_type=agent_daemon target.
Command oac-daemon is the reverse-WebSocket worker that connects a machine to an OpenAgentCore server and exposes a local agent CLI subprocess as a connector_type=agent_daemon target.
daemon/internal/agent
Package agent defines the Runtime's native Harness adapter contract.
Package agent defines the Runtime's native Harness adapter contract.
daemon/internal/agent/codex
Package codex is the agent_kind="codex" adapter.
Package codex is the agent_kind="codex" adapter.
daemon/internal/agent/contracttest
Package contracttest provides shared assertions for Harness adapter tests.
Package contracttest provides shared assertions for Harness adapter tests.
daemon/internal/agent/installroot
Package installroot probes native adapter installations.
Package installroot probes native adapter installations.
daemon/internal/agent/mcode
Package mcode drives MiniMax Code through its native ACP stdio interface.
Package mcode drives MiniMax Code through its native ACP stdio interface.
daemon/internal/auth
Package auth reads the daemon credential profile written by oac-core-device: server URL, runtime row id (= device_id), and the long-lived runner_credential.
Package auth reads the daemon credential profile written by oac-core-device: server URL, runtime row id (= device_id), and the long-lived runner_credential.
daemon/internal/cli
Code generated by scripts/generate-harness-catalog.py; DO NOT EDIT.
Code generated by scripts/generate-harness-catalog.py; DO NOT EDIT.
daemon/internal/daemonize
Package daemonize gives `oac-daemon connect -b` a no-cgo way to detach from the controlling terminal on macOS, Linux and Windows.
Package daemonize gives `oac-daemon connect -b` a no-cgo way to detach from the controlling terminal on macOS, Linux and Windows.
daemon/internal/dispatch
Package dispatch wires inbound WebSocket frames to the agent layer.
Package dispatch wires inbound WebSocket frames to the agent layer.
daemon/internal/paths
Package paths resolves on-disk locations for oac-daemon state under ~/.oac/daemon/<profile>/ — one subdir per profile so "test" and "prod" servers can be connected in parallel without colliding.
Package paths resolves on-disk locations for oac-daemon state under ~/.oac/daemon/<profile>/ — one subdir per profile so "test" and "prod" servers can be connected in parallel without colliding.
daemon/internal/transport
Package transport carries proto.Envelope frames between the daemon and the server-side agentdaemon gateway:
Package transport carries proto.Envelope frames between the daemon and the server-side agentdaemon gateway:
contracts
agents-api
Package agentsapi embeds the generated OpenAPI documents of Core's three namespaces so Core can serve them at /docs.
Package agentsapi embeds the generated OpenAPI documents of Core's three namespaces so Core can serve them at /docs.
agents-api/v1
Code generated by scripts/generate-public-api.py; DO NOT EDIT.
Code generated by scripts/generate-public-api.py; DO NOT EDIT.
internal
agentbundle
Package agentbundle validates bounded regular-file capability archives.
Package agentbundle validates bounded regular-file capability archives.
agentcapabilities
Package agentcapabilities owns the packaged Runtime's inert installation data.
Package agentcapabilities owns the packaged Runtime's inert installation data.
agentdaemon/proto
Package proto defines the JSON wire format spoken by oac-daemon over the reverse WebSocket tunnel to the OpenAgentCore server.
Package proto defines the JSON wire format spoken by oac-daemon over the reverse WebSocket tunnel to the OpenAgentCore server.
agentdaemon/proto/prototest
Package prototest provides explicit capability fixtures and the shared wire scenarios for Core–Runtime contract tests.
Package prototest provides explicit capability fixtures and the shared wire scenarios for Core–Runtime contract tests.
agentplugin
Package agentplugin validates the supported inert Agents API Plugin format.
Package agentplugin validates the supported inert Agents API Plugin format.
agentskill
Package agentskill validates inert Skill bundles without native loading rules.
Package agentskill validates inert Skill bundles without native loading rules.
harnessconfig
Package harnessconfig defines the shared Harness declaration.
Package harnessconfig defines the shared Harness declaration.
harnessconfig/builtin
Package builtin is the set of Harnesses in this build.
Package builtin is the set of Harnesses in this build.
harnessconfig/claudesdk
Package claudesdk declares the Claude Code Harness.
Package claudesdk declares the Claude Code Harness.
harnessconfig/codex
Package codex declares the Codex Harness.
Package codex declares the Codex Harness.
harnessconfig/harnesstest
Package harnesstest supplies explicit Harness declarations for admission fixtures.
Package harnesstest supplies explicit Harness declarations for admission fixtures.
harnessconfig/mcode
Package mcode declares the MiniMax Code Harness.
Package mcode declares the MiniMax Code Harness.
machineapi
Package machineapi is the code of the machine connection API: every request and response body of Core's /api/v1 routes.
Package machineapi is the code of the machine connection API: every request and response body of Core's /api/v1 routes.
modelprovider
Package modelprovider validates the frozen upstream connection supplied to a native Harness.
Package modelprovider validates the frozen upstream connection supplied to a native Harness.
obs/log
Package log wraps log/slog with a context-aware handler that injects W3C trace IDs from ctx so a single request — HTTP, WS envelope, sweeper tick — can be grepped end-to-end by `trace_id`.
Package log wraps log/slog with a context-aware handler that injects W3C trace IDs from ctx so a single request — HTTP, WS envelope, sweeper tick — can be grepped end-to-end by `trace_id`.
providerassets
Package providerassets exposes the generated node distribution declarations.
Package providerassets exposes the generated node distribution declarations.
runtimebootstrap
Package runtimebootstrap owns the Provider-to-Runtime connection input.
Package runtimebootstrap owns the Provider-to-Runtime connection input.
runtimefs
Package runtimefs provides ordinary Runtime state files and process locks.
Package runtimefs provides ordinary Runtime state files and process locks.
packages
agents-client/v1
Package v1 configures the official Go SDK for the OpenAgentCore Agents API.
Package v1 configures the official Go SDK for the OpenAgentCore Agents API.
scripts
harness-catalog command
Command harness-catalog projects the built-in Harness declarations and the model-provider protocol vocabulary for tooling.
Command harness-catalog projects the built-in Harness declarations and the model-provider protocol vocabulary for tooling.
openapi-split command
Command openapi-split emits internal contracts and exports Go definitions for the public contract extension overlay and the Core client types.
Command openapi-split emits internal contracts and exports Go definitions for the public contract extension overlay and the Core client types.
services
core/cmd/device command
Command device provisions or revokes an execution device using operator DB access.
Command device provisions or revokes an execution device using operator DB access.
core/cmd/environment-key command
Command environment-key manages executor principal credentials using operator DB authority.
Command environment-key manages executor principal credentials using operator DB authority.
core/cmd/oac command
core/cmd/provider-artifacts command
provider-artifacts generates distribution declarations from registered adapters.
provider-artifacts generates distribution declarations from registered adapters.
core/cmd/sandbox-node command
sandbox-node hosts the selected local Provider and dials its owning Core.
sandbox-node hosts the selected local Provider and dials its owning Core.
core/cmd/server command
Package main runs the standalone Agents API service.
Package main runs the standalone Agents API service.
core/cmd/specification-contract command
specification-contract maintains the generated deployment contract projections of the node installer and the TypeScript client.
specification-contract maintains the generated deployment contract projections of the node installer and the TypeScript client.
core/internal/adminaudit
Package adminaudit carries non-secret administrator provenance into business transactions, and owns the rules for recording it and the audit log's read models.
Package adminaudit carries non-secret administrator provenance into business transactions, and owns the rules for recording it and the audit log's read models.
core/internal/agentnetwork
Package agentnetwork validates the public Environment network field.
Package agentnetwork validates the public Environment network field.
core/internal/agents
Package agents owns saved Agents: reusable configuration a tenant keeps independently of Sessions, with the optional model provider bundle that its x_agents_core.model_provider describes.
Package agents owns saved Agents: reusable configuration a tenant keeps independently of Sessions, with the optional model provider bundle that its x_agents_core.model_provider describes.
core/internal/api
Code generated by scripts/generate-public-api.py; DO NOT EDIT.
Code generated by scripts/generate-public-api.py; DO NOT EDIT.
core/internal/automations
Package automations owns Automations: saved schedules that deliver a target Session create or instructions, and the invocation records of each delivery.
Package automations owns Automations: saved schedules that deliver a target Session create or instructions, and the invocation records of each delivery.
core/internal/coremetrics
Package coremetrics collects bounded operational measurements for administrators.
Package coremetrics collects bounded operational measurements for administrators.
core/internal/credentialcrypto
Package credentialcrypto encrypts execution-service credentials at rest.
Package credentialcrypto encrypts execution-service credentials at rest.
core/internal/databaseurl
Package databaseurl reads Core's PostgreSQL connection settings, shared by the server and its maintenance commands.
Package databaseurl reads Core's PostgreSQL connection settings, shared by the server and its maintenance commands.
core/internal/deployment
Package deployment owns the managed sandbox deployment: the provider, specification and configuration an administrator selects, its generations, and the sandbox nodes that enroll with it, authenticate, report their readiness and serve its generations.
Package deployment owns the managed sandbox deployment: the provider, specification and configuration an administrator selects, its generations, and the sandbox nodes that enroll with it, authenticate, report their readiness and serve its generations.
core/internal/deployment/placement
Package placement decides whether the sandbox deployment admits new hosted work and which node receives it.
Package placement decides whether the sandbox deployment admits new hosted work and which node receives it.
core/internal/echotext
Package echotext decides whether an error message may repeat a caller-supplied value.
Package echotext decides whether an error message may repeat a caller-supplied value.
core/internal/environmentconfig
Package environmentconfig owns the Environment configuration vocabulary: setup (env, setup commands, packages and capability directories), Skills, Plugins and initial files, with their validation and public metadata projections.
Package environmentconfig owns the Environment configuration vocabulary: setup (env, setup commands, packages and capability directories), Skills, Plugins and initial files, with their validation and public metadata projections.
core/internal/environmenttemplates
Package environmenttemplates owns Environment Templates: saved, tenant-owned hosted Environment configuration that Sessions reference at creation.
Package environmenttemplates owns Environment Templates: saved, tenant-owned hosted Environment configuration that Sessions reference at creation.
core/internal/execution
Package execution delivers durable Turns through the existing daemon protocol.
Package execution delivers durable Turns through the existing daemon protocol.
core/internal/files
Package files owns source Files: Project-owned uploaded bytes with immutable metadata, independent of Sessions and of the workspace copies made from them.
Package files owns source Files: Project-owned uploaded bytes with immutable metadata, independent of Sessions and of the workspace copies made from them.
core/internal/identity
Package identity defines execution-service principals independently of product users.
Package identity defines execution-service principals independently of product users.
core/internal/items
Package items owns public Items: it projects execution observations to the supported Item variants, merges them into stored Items and builds the ordered public events that report each Item change.
Package items owns public Items: it projects execution observations to the supported Item variants, merges them into stored Items and builds the ordered public events that report each Item change.
core/internal/jsonobject
Package jsonobject normalizes stored JSON object documents.
Package jsonobject normalizes stored JSON object documents.
core/internal/metadata
Package metadata owns the rules for resource metadata: string key and value pairs that Agents, Sessions and Vaults carry for their applications.
Package metadata owns the rules for resource metadata: string key and value pairs that Agents, Sessions and Vaults carry for their applications.
core/internal/modelconfiguration
Package modelconfiguration owns each Harness's deployment default model configuration: its safe view, the encrypted complete bundle that Session creation freezes, the private revision that pairs with it, and the rules for replacing, removing and resolving it.
Package modelconfiguration owns each Harness's deployment default model configuration: its safe view, the encrypted complete bundle that Session creation freezes, the private revision that pairs with it, and the rules for replacing, removing and resolving it.
core/internal/nativeinstaller
Package nativeinstaller serves qualified native distributions.
Package nativeinstaller serves qualified native distributions.
core/internal/oauthrefresh
Package oauthrefresh exchanges a stored OAuth refresh grant for an access token.
Package oauthrefresh exchanges a stored OAuth refresh grant for an access token.
core/internal/persistence/postgres/agentpg
Package agentpg stores saved Agents in PostgreSQL.
Package agentpg stores saved Agents in PostgreSQL.
core/internal/persistence/postgres/auditpg
Package auditpg stores write and administrator audit records in PostgreSQL.
Package auditpg stores write and administrator audit records in PostgreSQL.
core/internal/persistence/postgres/automationpg
Package automationpg stores Automations and their invocations in PostgreSQL.
Package automationpg stores Automations and their invocations in PostgreSQL.
core/internal/persistence/postgres/coremetricspg
Package coremetricspg reads the Core metrics that PostgreSQL holds: the deployment's root Turn queue and its history, and the database size.
Package coremetricspg reads the Core metrics that PostgreSQL holds: the deployment's root Turn queue and its history, and the database size.
core/internal/persistence/postgres/deploymentpg
Package deploymentpg stores the sandbox deployment, its retained generations and its nodes in PostgreSQL.
Package deploymentpg stores the sandbox deployment, its retained generations and its nodes in PostgreSQL.
core/internal/persistence/postgres/filepg
Package filepg stores Files in PostgreSQL: metadata in source_files and content in large objects.
Package filepg stores Files in PostgreSQL: metadata in source_files and content in large objects.
core/internal/persistence/postgres/modelconfigurationpg
Package modelconfigurationpg stores deployment default model configurations in PostgreSQL.
Package modelconfigurationpg stores deployment default model configurations in PostgreSQL.
core/internal/persistence/postgres/pgtest
Package pgtest opens PostgreSQL databases for Core tests.
Package pgtest opens PostgreSQL databases for Core tests.
core/internal/persistence/postgres/pgunit
Package pgunit runs Core's PostgreSQL transactions: pooled transactions for public and administrative work, and the execution owner's transactions on the connection that holds the database's execution lease.
Package pgunit runs Core's PostgreSQL transactions: pooled transactions for public and administrative work, and the execution owner's transactions on the connection that holds the database's execution lease.
core/internal/persistence/postgres/placementpg
Package placementpg loads the placement facts of the sandbox deployment and applies the placements package placement decides, on the caller's transaction-bound queries.
Package placementpg loads the placement facts of the sandbox deployment and applies the placements package placement decides, on the caller's transaction-bound queries.
core/internal/persistence/postgres/projectpg
Package projectpg stores Projects and their API keys in PostgreSQL.
Package projectpg stores Projects and their API keys in PostgreSQL.
core/internal/persistence/postgres/runtimehistorypg
Package runtimehistorypg stores and reads bounded periodic Runtime telemetry.
Package runtimehistorypg stores and reads bounded periodic Runtime telemetry.
core/internal/persistence/postgres/sessionpg
Package sessionpg stores Sessions in PostgreSQL and decides nothing.
Package sessionpg stores Sessions in PostgreSQL and decides nothing.
core/internal/persistence/postgres/skillpg
Package skillpg stores Skills and their versions in PostgreSQL.
Package skillpg stores Skills and their versions in PostgreSQL.
core/internal/persistence/postgres/templatepg
Package templatepg stores Environment Templates in PostgreSQL.
Package templatepg stores Environment Templates in PostgreSQL.
core/internal/persistence/postgres/vaultpg
Package vaultpg stores Vaults and Credentials in PostgreSQL.
Package vaultpg stores Vaults and Credentials in PostgreSQL.
core/internal/persistence/postgres/workspacepg
Package workspacepg stores independent workspace configurations and durable Environment filesystem ownership.
Package workspacepg stores independent workspace configurations and durable Environment filesystem ownership.
core/internal/processconfig
Package processconfig is the process settings Core loads from its environment.
Package processconfig is the process settings Core loads from its environment.
core/internal/projects
Package projects owns Core Projects and their API keys.
Package projects owns Core Projects and their API keys.
core/internal/providercontract
Package providercontract describes explicit resource-provider operations.
Package providercontract describes explicit resource-provider operations.
core/internal/publicorigin
Package publicorigin owns OAC_PUBLIC_URL's one rule, shared by Core and the installer.
Package publicorigin owns OAC_PUBLIC_URL's one rule, shared by Core and the installer.
core/internal/runtime
Package runtime connects execution devices without product dependencies.
Package runtime connects execution devices without product dependencies.
core/internal/runtimedevice
Package device defines persistence data shared by daemon gateways and their stores.
Package device defines persistence data shared by daemon gateways and their stores.
core/internal/runtimegateway
Package gateway is the server-side hub of the agent_daemon connector.
Package gateway is the server-side hub of the agent_daemon connector.
core/internal/runtimeobs
Package runtimeobs resolves durable Session identity to provider-owned Runtime observations.
Package runtimeobs resolves durable Session identity to provider-owned Runtime observations.
core/internal/runtimeobs/otlpexporter
Package otlpexporter sends sanitized Runtime observation records to an operator-configured OTLP/HTTP metrics endpoint.
Package otlpexporter sends sanitized Runtime observation records to an operator-configured OTLP/HTTP metrics endpoint.
core/internal/sandbox
Package sandbox defines the Sandbox Provider contract for authorized compute.
Package sandbox defines the Sandbox Provider contract for authorized compute.
core/internal/sandbox/contracttest
Package contracttest runs shared lifecycle assertions against real adapters backed by controlled native transports.
Package contracttest runs shared lifecycle assertions against real adapters backed by controlled native transports.
core/internal/sandbox/e2b
Code generated by contractgen; DO NOT EDIT.
Code generated by contractgen; DO NOT EDIT.
core/internal/sandbox/e2b/internal/contractgen command
Command contractgen projects the adapter's Go declarations into its Python artifacts.
Command contractgen projects the adapter's Go declarations into its Python artifacts.
core/internal/sandbox/microsandbox
Package microsandbox is the pure-Go client for the colocated SDK helper.
Package microsandbox is the pure-Go client for the colocated SDK helper.
core/internal/sandbox/node
Package node transports the finite sandbox Provider contract.
Package node transports the finite sandbox Provider contract.
core/internal/sandbox/opensandbox
Package opensandbox runs Core-managed sandboxes on an operator's OpenSandbox server through its official Go SDK.
Package opensandbox runs Core-managed sandboxes on an operator's OpenSandbox server through its official Go SDK.
core/internal/sandbox/providers
Node-local adapter configuration and construction.
Node-local adapter configuration and construction.
core/internal/sessions
Package sessions owns the Session vocabulary: Sessions, Turns and their statuses, inputs, Environments and their provisioning failures, function calls, Item and Artifact reads, executor credentials, and the errors Session operations return.
Package sessions owns the Session vocabulary: Sessions, Turns and their statuses, inputs, Environments and their provisioning failures, function calls, Item and Artifact reads, executor credentials, and the errors Session operations return.
core/internal/skills
Package skills owns Skills: tenant-owned bundles with immutable, numbered versions and a default version.
Package skills owns Skills: tenant-owned bundles with immutable, numbered versions and a default version.
core/internal/textvalue
Package textvalue holds the one error shared by every domain for request text that Core cannot store.
Package textvalue holds the one error shared by every domain for request text that Core cannot store.
core/internal/vaults
Package vaults owns Vaults and their Credentials: the resources, OAuth access-token refresh, and the MCP credential selection that Session creation freezes and execution resolves into a bearer token.
Package vaults owns Vaults and their Credentials: the resources, OAuth access-token refresh, and the MCP credential selection that Session creation freezes and execution resolves into a bearer token.
core/internal/workspacefs
Package workspacefs defines the independent workspace filesystem boundary.
Package workspacefs defines the independent workspace filesystem boundary.
core/internal/workspacefs/nfs
Package nfs implements workspace storage on an operator-mounted kernel NFS filesystem.
Package nfs implements workspace storage on an operator-mounted kernel NFS filesystem.
core/internal/workspacefs/providers
Package providers composes workspace filesystem adapters at process startup.
Package providers composes workspace filesystem adapters at process startup.
core/internal/workspaces
Package workspaces owns durable Environment filesystem identities.
Package workspaces owns durable Environment filesystem identities.
core/internal/writeaudit
Package writeaudit carries authenticated, non-secret request provenance to business transactions, and owns the rules for recording it and its read models.
Package writeaudit carries authenticated, non-secret request provenance to business transactions, and owns the rules for recording it and its read models.
core/migrations
Package migrations owns only the OpenAgentCore database schema.
Package migrations owns only the OpenAgentCore database schema.
core/tests/fixtures command
Command fixtures prepares internal records for official-client recovery tests.
Command fixtures prepares internal records for official-client recovery tests.
web command
Command oac-web serves the Core Web build and its authenticated API proxy.
Command oac-web serves the Core Web build and its authenticated API proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL