Skip to main content
The OpenAI Agents API runs OpenAI’s Codex agent harness as a hosted service, in public beta since September 2026. An agent is a model, instructions, and tools. A session is a durable instance of it that runs in no environment, an OpenAI-hosted sandbox, or a self-hosted executor. Vaults hold credentials, automations run sessions on a schedule, and webhooks report session events. The Agents API has no config file. An agent is defined by API calls, under client.beta.agents, in the application that uses it. Agents without a sandbox move to Guild Native, and agents that work in the sandbox move to OpenClaw.
This guide covers the hosted Agents API. The open-source OpenAI Agents SDK (openai-agents or @openai/agents) runs the agent loop in your own application; port that code to a Guild TypeScript or Native agent.

Who this is for

Teams running agents on the OpenAI Agents API who want models from more than one provider, ready-made integrations, and agents that start from Slack mentions or GitHub events instead of only their own API calls.

Concept map

Before you start

Inventory

An agent’s definition is spread across your code: the saved agent, overrides on each session (a session’s tools array replaces the saved one), the environment, vault_ids, and review. If the agent was created in a script that isn’t in the repository, export it first:
The saved agent holds the model, instructions, tools, text.format, and multi_agent. A typical session holds the environment, vault_ids, and review. Then list, by name only, never secret values:
  • The instructions, the model, and any structured output schema.
  • Every function tool and the code in your app that answers it.
  • Every mcp tool: its server URL, allowed_tools, and the vault credential it uses.
  • The environment type, and whether the agent relies on Bash, file patches, or files under /workspace.
  • Skills in capability_directories, and plugins.
  • Automations (cron expression and timezone) and webhook handlers.
  • Vault credentials and environment variables, by name only.

Steps

Use this path for agents that run with environment: {"type": "none"}: instructions plus MCP or function tools, text in and out.
1

Scaffold a Native agent

--category and --owner stop the CLI from prompting, which a script or coding agent can’t answer. List categories with guild agent categories.
2

Move the instructions and tools

Copy instructions into PROMPT.md. Each mcp tool becomes the catalog integration for the same service, with only the operations the agent calls. Check the real names with guild integration operation list <owner~integration> --json. For an MCP server with no catalog integration, create one from the server’s URL in the web app by choosing the MCP protocol in Create an integration.A function tool your app answered becomes an integration operation, or moves to a TypeScript agent when it needs real logic.
3

Test

guild agent test collects files by walking your local directory and honoring .gitignore, the same way guild agent save does, so new files such as logic.ts are uploaded even without git add.
Then publish, and recreate each automation as a schedule trigger. Guild converts a timezone schedule to UTC:
App code that called sessions.create can use an API trigger or guild workspace chat --once instead.
The first guild agent save --wait --publish after guild agent init fails with “No saved state… use —force” because of the .gitignore the scaffold writes. Add --force to that first save for now.
You can also publish with the Publish Agent to Guild GitHub Action instead of guild agent save --publish. The Action needs an account API key with the agents:write scope:

Credentials and policies

Recreate each vault credential as a Guild credential on the matching integration. Use member scope for MCP servers that each person connected with their own account, and workspace or agent scope for service accounts. Like vaults, the credential proxy keeps secret values out of the agent. Guild splits a tool approval into two controls:
  • Who can call it. Add a credential policy rule scoped to the agent and workspace that allows or denies the operation. DENY wins over ALLOW.
  • Sign-off on each call. Add the ui_prompt built-in and have the agent confirm with the user before it calls the tool. The run pauses until someone answers.

What doesn’t map 1:1

codex exec-server runs the sandbox on your own compute. Guild runs agents in its own containers, so self-hosted environments move to Guild’s runtime.
A message sent to a busy Agents API session changes the turn in progress. On Guild, a follow-up message starts the next turn.
review: "auto_review" has a model review actions before they run. Guild has no automatic reviewer. Use credential policies to limit which operations the agent can call, and a ui_prompt confirmation where a person should sign off.
Guild has no computer-use tool. For browser work, use a browser integration from the catalog in an OpenClaw agent.
Guild has no outbound session webhooks. Have the agent post its result through an integration, such as Slack or GitHub. A one-off type: "once" automation, or an agent that schedules its own follow-ups with the automations tool, has no equivalent.
Guild connects to remote MCP servers by URL. An MCP server started with command and args needs a hosted HTTP endpoint first. Otherwise, move its tools to an integration built from the service’s OpenAPI spec.

Three ways to migrate

guild-migrate skill

Ask your coding agent: “Migrate the Agents API agent in this repository to Guild.” It finds the client.beta.agents calls and writes MIGRATION.md.

Publish Agent to Guild Action

Commit the port to your repository, then publish it from GitHub Actions with an account API key.

Migration agent

Point Migrate to Guild at your repository; it opens a draft pull request. The guild-migrate skill ships in the same package.

OpenClaw agents

AGENTS.md, skills, and the coding toolchain.

guild.yaml

Models, integrations, sub-agents, and builtins.
Migrating a team? Talk to us.
Last modified on November 9, 2026