OpenAI · Schema

SessionResource

A Managed Agents session.

LLMOpenAIArtificial IntelligenceGenerative AIChatbotsFoundation ModelsT1

Properties

Name Type Description
metadata object Custom string key-value pairs attached to the session.
id string The ID of the session.
object string The object type. Always `agent.session`.
created_at integer The Unix timestamp, in seconds, when the session was created.
last_active_at integer The Unix timestamp, in seconds, when the session was last active.
status object The current status of the session.
required_actions array Actions that must be completed before the session can continue.
error stringnull The error that caused the session to fail, if any.
agent object The agent running in the session.
environment object The execution environment for the session.
vault_ids array The IDs of vaults made available to the session.
usage object Best-effort token usage for the session, or null if unknown. Recorded usage may change.
View JSON Schema on GitHub

JSON Schema

openai-session-resource-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/openai/main/json-schema/openai-session-resource-schema.json",
  "title": "SessionResource",
  "description": "A Managed Agents session.",
  "x-generated": "2026-09-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openai-agents-api-openapi.yml#/components/schemas/SessionResource",
  "type": "object",
  "properties": {
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "minLength": 0
      },
      "propertyNames": {
        "type": "string",
        "minLength": 0
      },
      "minProperties": 0,
      "description": "Custom string key-value pairs attached to the session."
    },
    "id": {
      "type": "string",
      "minLength": 0,
      "description": "The ID of the session."
    },
    "object": {
      "type": "string",
      "enum": [
        "agent.session"
      ],
      "default": "agent.session",
      "x-stainless-const": true,
      "description": "The object type. Always `agent.session`."
    },
    "created_at": {
      "type": "integer",
      "format": "int64",
      "description": "The Unix timestamp, in seconds, when the session was created."
    },
    "last_active_at": {
      "type": "integer",
      "format": "int64",
      "description": "The Unix timestamp, in seconds, when the session was last active."
    },
    "status": {
      "$ref": "#/$defs/SessionStatusResource",
      "description": "The current status of the session."
    },
    "required_actions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SessionRequiredActionResource"
      },
      "minItems": 0,
      "maxItems": 2000,
      "description": "Actions that must be completed before the session can continue."
    },
    "error": {
      "description": "The error that caused the session to fail, if any.",
      "type": [
        "string",
        "null"
      ],
      "minLength": 0
    },
    "agent": {
      "$ref": "#/$defs/SessionAgentResource",
      "description": "The agent running in the session."
    },
    "environment": {
      "$ref": "#/$defs/EnvironmentResource",
      "description": "The execution environment for the session."
    },
    "vault_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 0
      },
      "minItems": 0,
      "maxItems": 2000,
      "description": "The IDs of vaults made available to the session."
    },
    "usage": {
      "anyOf": [
        {
          "$ref": "#/$defs/TokenUsageResource"
        },
        {
          "type": "null"
        }
      ],
      "description": "Best-effort token usage for the session, or null if unknown. Recorded usage may change."
    }
  },
  "required": [
    "metadata",
    "id",
    "object",
    "created_at",
    "last_active_at",
    "status",
    "required_actions",
    "error",
    "agent",
    "environment",
    "vault_ids",
    "usage"
  ],
  "additionalProperties": false,
  "$defs": {
    "AgentToolResource": {
      "oneOf": [
        {
          "$ref": "#/$defs/AgentToolResourceFunction"
        },
        {
          "$ref": "#/$defs/AgentToolResourceProgrammaticToolCalling"
        },
        {
          "$ref": "#/$defs/AgentToolResourceMcp"
        },
        {
          "$ref": "#/$defs/AgentToolResourceWebSearch"
        }
      ],
      "x-oai-discriminator-values": [
        "function",
        "programmatic_tool_calling",
        "mcp",
        "web_search"
      ],
      "description": "A tool available to the agent."
    },
    "AgentToolResourceFunction": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "function"
          ],
          "default": "function",
          "x-stainless-const": true,
          "description": "The type of the object. Always `function`."
        },
        "name": {
          "type": "string",
          "minLength": 0,
          "description": "The name of the function."
        },
        "description": {
          "type": "string",
          "minLength": 0,
          "description": "A description of what the function does."
        },
        "parameters": {
          "type": "object",
          "additionalProperties": {},
          "propertyNames": {
            "type": "string",
            "minLength": 0
          },
          "minProperties": 0,
          "description": "A JSON Schema object describing the function's arguments."
        },
        "defer_loading": {
          "type": "boolean",
          "description": "Whether the function is deferred and discovered through tool search."
        }
      },
      "required": [
        "type",
        "name",
        "description",
        "parameters",
        "defer_loading"
      ],
      "additionalProperties": false,
      "description": "A function defined by the application."
    },
    "AgentToolResourceMcp": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "mcp"
          ],
          "default": "mcp",
          "x-stainless-const": true,
          "description": "The type of the object. Always `mcp`."
        },
        "server_label": {
          "type": "string",
          "minLength": 0,
          "description": "A label used to identify the MCP server in tool calls."
        },
        "credential_id": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 0,
          "description": "The attached vault credential selected for this MCP server, if any. Optional when exactly one attached credential matches the server URL."
        },
        "transport": {
          "$ref": "#/$defs/McpTransportResource",
          "description": "The transport used to connect to the MCP server."
        },
        "request_metadata": {
          "type": "object",
          "additionalProperties": {},
          "propertyNames": {
            "type": "string",
            "minLength": 0
          },
          "minProperties": 0,
          "description": "Metadata included with requests to this MCP server."
        },
        "allowed_tools": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string",
            "minLength": 0
          },
          "minItems": 0,
          "maxItems": 2000,
          "description": "The MCP tools the agent may call."
        },
        "required": {
          "type": "boolean",
          "description": "Whether this MCP server must initialize before the first turn."
        },
        "connection_origin": {
          "$ref": "#/$defs/McpConnectionOriginResource",
          "description": "Where outbound MCP HTTP connections originate."
        }
      },
      "required": [
        "type",
        "server_label",
        "credential_id",
        "transport",
        "request_metadata",
        "allowed_tools",
        "required",
        "connection_origin"
      ],
      "additionalProperties": false,
      "description": "Tools provided by a remote MCP server."
    },
    "AgentToolResourceProgrammaticToolCalling": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "programmatic_tool_calling"
          ],
          "default": "programmatic_tool_calling",
          "x-stainless-const": true,
          "description": "The type of the object. Always `programmatic_tool_calling`."
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether tools can be called from model-generated code."
        }
      },
      "required": [
        "type",
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Enables calling tools from model-generated code."
    },
    "AgentToolResourceWebSearch": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "web_search"
          ],
          "default": "web_search",
          "x-stainless-const": true,
          "description": "The type of the object. Always `web_search`."
        },
        "mode": {
          "$ref": "#/$defs/WebSearchModeResource",
          "description": "The source used for web search results."
        },
        "context_size": {
          "$ref": "#/$defs/WebSearchContextSizeResource",
          "description": "The amount of search context made available to the model. Defaults to `medium`."
        },
        "allowed_domains": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string",
            "minLength": 0
          },
          "minItems": 0,
          "maxItems": 2000,
          "description": "Allowed search domains, or `null` when the search is unrestricted."
        },
        "location": {
          "anyOf": [
            {
              "$ref": "#/$defs/WebSearchLocationResource"
            },
            {
              "type": "null"
            }
          ],
          "description": "Approximate location used to localize search results, if provided."
        }
      },
      "required": [
        "type",
        "mode",
        "context_size",
        "allowed_domains",
        "location"
      ],
      "additionalProperties": false,
      "description": "Web search."
    },
    "EnvironmentPackagesResource": {
      "type": "object",
      "properties": {
        "python": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 0,
            "maxLength": 1048576
          },
          "minItems": 0,
          "maxItems": 16384,
          "description": "Python packages installed in the environment."
        },
        "system": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 0,
            "maxLength": 1048576
          },
          "minItems": 0,
          "maxItems": 16384,
          "description": "System packages installed in the environment."
        },
        "npm": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 0,
            "maxLength": 1048576
          },
          "minItems": 0,
          "maxItems": 16384,
          "description": "npm packages installed globally in the environment."
        }
      },
      "required": [
        "python",
        "system",
        "npm"
      ],
      "additionalProperties": false,
      "description": "Packages installed in an OpenAI-hosted environment."
    },
    "EnvironmentResource": {
      "oneOf": [
        {
          "$ref": "#/$defs/EnvironmentResourceNone"
        },
        {
          "$ref": "#/$defs/EnvironmentResourceOpenaiHosted"
        },
        {
          "$ref": "#/$defs/EnvironmentResourceSelfHosted"
        }
      ],
      "x-oai-discriminator-values": [
        "none",
        "openai_hosted",
        "self_hosted"
      ],
      "description": "The execution environment for a session."
    },
    "EnvironmentResourceNone": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "none"
          ],
          "default": "none",
          "x-stainless-const": true,
          "description": "The type of the object. Always `none`."
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false,
      "description": "The session talks to CCA without selecting or provisioning an execution environment."
    },
    "EnvironmentResourceOpenaiHosted": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "openai_hosted"
          ],
          "default": "openai_hosted",
          "x-stainless-const": true,
          "description": "The type of the object. Always `openai_hosted`."
        },
        "id": {
          "type": "string",
          "minLength": 0,
          "description": "The public ID of the environment."
        },
        "packages": {
          "$ref": "#/$defs/EnvironmentPackagesResource",
          "description": "Packages installed in the environment."
        },
        "network": {
          "$ref": "#/$defs/NetworkPolicyResource",
          "description": "The effective network access policy for the environment."
        },
        "capability_directories": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 0
          },
          "minItems": 0,
          "maxItems": 2000,
          "description": "Directories that contain capabilities exposed to the agent."
        },
        "skills": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HostedSkillResource"
          },
          "minItems": 0,
          "maxItems": 2000,
          "description": "Skills installed in the environment, excluding their archive contents."
        },
        "plugins": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HostedPluginResource"
          },
          "minItems": 0,
          "maxItems": 2000,
          "description": "Plugins installed in the environment, excluding their archive contents."
        },
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HostedEnvironmentFileResource"
          },
          "minItems": 0,
          "maxItems": 50,
          "description": "Files available in the environment, excluding their contents."
        }
      },
      "required": [
        "type",
        "id",
        "packages",
        "network",
        "capability_directories",
        "skills",
        "plugins",
        "files"
      ],
      "additionalProperties": false,
      "description": "An environment hosted by OpenAI."
    },
    "EnvironmentResourceSelfHosted": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "self_hosted"
          ],
          "default": "self_hosted",
          "x-stainless-const": true,
          "description": "The type of the object. Always `self_hosted`."
        },
        "remote_url": {
          "type": "string",
          "minLength": 0,
          "description": "Pass this URL unchanged to `codex exec-server --remote` when connecting this environment."
        },
        "id": {
          "type": "string",
          "minLength": 0,
          "description": "The public ID of the environment."
        },
        "workspace_directory": {
          "type": "string",
          "minLength": 0,
          "description": "The absolute project directory inside the environment. Defaults to `/workspace`."
        },
        "capability_directories": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 0
          },
          "minItems": 0,
          "maxItems": 2000,
          "description": "Directories that contain capabilities exposed to the agent."
        }
      },
      "required": [
        "type",
        "remote_url",
        "id",
        "workspace_directory",
        "capability_directories"
      ],
      "additionalProperties": false,
      "description": "An environment hosted by the application."
    },
    "HostedEnvironmentFileResource": {
      "oneOf": [
        {
          "$ref": "#/$defs/HostedEnvironmentFileResourceFileId"
        },
        {
          "$ref": "#/$defs/HostedEnvironmentFileResourceInline"
        }
      ],
      "x-oai-discriminator-values": [
        "file_id",
        "inline"
      ],
      "description": "Metadata for a file materialized in an OpenAI-hosted execution environment."
    },
    "HostedEnvironmentFileResourceFileId": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "file_id"
          ],
          "default": "file_id",
          "x-stainless-const": true,
          "description": "The type of the object. Always `file_id`."
        },
        "id": {
          "type": "string",
          "minLength": 0,
          "description": "The session-scoped ID of the file in the execution environment."
        },
        "file_id": {
          "type": "string",
          "minLength": 0,
          "description": "The ID of the uploaded file."
        },
        "path": {
          "type": "string",
          "minLength": 0,
          "description": "The file's absolute path inside the environment."
        },
        "size_bytes": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "description": "The decoded file size in bytes."
        }
      },
      "required": [
        "type",
        "id",
        "file_id",
        "path",
        "size_bytes"
      ],
      "additionalProperties": false,
      "description": "A file copied from the OpenAI Files API."
    },
    "HostedEnvironmentFileResourceInline": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "inline"
          ],
          "default": "inline",
          "x-stainless-const": true,
          "description": "The type of the object. Always `inline`."
        },
        "id": {
          "type": "string",
          "minLength": 0,
          "description": "The session-scoped ID of the file in the execution environment."
        },
        "path": {
          "type": "string",
          "minLength": 0,
          "description": "The file's absolute path inside the environment."
        },
        "size_bytes": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "description": "The decoded file size in bytes."
        }
      },
      "required": [
        "type",
        "id",
        "path",
        "size_bytes"
      ],
      "additionalProperties": false,
      "description": "A file supplied inline when the session was created."
    },
    "HostedPluginResource": {
      "oneOf": [
        {
          "$ref": "#/$defs/HostedPluginResourceInline"
        }
      ],
      "x-oai-discriminator-values": [
        "inline"
      ],
      "description": "A plugin installed in an OpenAI-hosted environment."
    },
    "HostedPluginResourceInline": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "inline"
          ],
          "default": "inline",
          "x-stainless-const": true,
          "description": "The type of the object. Always `inline`."
        },
        "name": {
          "type": "string",
          "minLength": 0,
          "description": "The installed plugin name."
        },
        "description": {
          "type": "string",
          "minLength": 0,
          "description": "The installed plugin description."
        }
      },
      "required": [
        "type",
        "name",
        "description"
      ],
      "additionalProperties": false,
      "description": "A plugin installed from an inline ZIP archive."
    },
    "HostedSkillResource": {
      "oneOf": [
        {
          "$ref": "#/$defs/HostedSkillResourceSkillReference"
        },
        {
          "$ref": "#/$defs/HostedSkillResourceInline"
        }
      ],
      "x-oai-discriminator-values": [
        "skill_reference",
        "inline"
      ],
      "description": "A skill installed in an OpenAI-hosted environment."
    },
    "HostedSkillResourceInline": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "inline"
          ],
          "default": "inline",
          "x-stainless-const": true,
          "description": "The type of the object. Always `inline`."
        },
        "name": {
          "type": "string",
          "minLength": 0,
          "description": "The installed skill name."
        },
        "description": {
          "type": "string",
          "minLength": 0,
          "description": "The installed skill description."
        }
      },
      "required": [
        "type",
        "name",
        "description"
      ],
      "additionalProperties": false,
      "description": "A skill installed from an inline ZIP archive."
    },
    "HostedSkillResourceSkillReference": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "skill_reference"
          ],
          "default": "skill_reference",
          "x-stainless-const": true,
          "description": "The type of the object. Always `skill_reference`."
        },
        "skill_id": {
          "type": "string",
          "minLength": 0,
          "description": "The referenced skill ID."
        },
        "version": {
          "type": "string",
          "minLength": 0,
          "description": "The concrete skill version installed for this session."
        },
        "name": {
          "type": "string",
          "minLength": 0,
          "description": "The installed skill name."
        },
        "description": {
          "type": "string",
          "minLength": 0,
          "description": "The installed skill description."
        }
      },
      "required": [
        "type",
        "skill_id",
        "version",
        "name",
        "description"
      ],
      "additionalProperties": false,
      "description": "A skill installed from the Skills API."
    },
    "InputTokensDetailsResource": {
      "type": "object",
      "properties": {
        "cached_tokens": {
          "type": "integer",
          "format": "int64",
          "description": "The number of input tokens retrieved from the prompt cache."
        }
      },
      "required": [
        "cached_tokens"
      ],
      "additionalProperties": false,
      "description": "A breakdown of input token usage for a session or turn."
    },
    "McpConnectionOriginResource": {
      "type": "string",
      "enum": [
        "service",
        "environment"
      ],
      "description": "Where outbound MCP HTTP connections originate."
    },
    "McpTransportResource": {
      "oneOf": [
        {
          "$ref": "#/$defs/McpTransportResourceHttp"
        },
        {
          "$ref": "#/$defs/McpTransportResourceStdio"
        }
      ],
      "x-oai-discriminator-values": [
        "http",
        "stdio"
      ],
      "description": "The transport used to connect to an MCP server."
    },
    "McpTransportResourceHttp": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "http"
          ],
          "default": "http",
          "x-stainless-const": true,
          "description": "The type of the object. Always `http`."
        },
        "server_url": {
          "type": "string",
          "minLength": 0,
          "description": "The URL of the MCP server."
        }
      },
      "required": [
        "type",
        "server_url"
      ],
      "additionalProperties": false,
      "description": "Connects to an MCP server over HTTP."
    },
    "McpTransportResourceStdio": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "stdio"
          ],
          "default": "stdio",
          "x-stainless-const": true,
          "description": "The type of the object. Always `stdio`."
        },
        "command": {
          "type": "string",
          "minLength": 0,
          "description": "The command used to start the MCP server."
        },
        "args": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 0
          },
          "minItems": 0,
          "maxItems": 2000,
          "description": "Arguments passed to the MCP server command."
        },
        "cwd": {
          "type": "string",
          "minLength": 0,
          "description": "The working directory used to start the MCP server."
        },
        "env_vars": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 0
          },
          "minItems": 0,
          "maxItems": 2000,
          "description": "Environment variable names inherited from the execution environment."
        }
      },
      "required": [
        "type",
        "command",
        "args",
        "cwd",
        "env_vars"
      ],
      "additionalProperties": false,
      "description": "Starts an MCP server as a local process."
    },
    "MultiAgentConfigResource": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether subagent tools are enabled. Defaults to false."
        },
        "max_concurrent_subagents": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295,
          "description": "Maximum number of subagents that may run concurrently, or null when disabled. Defaults to 6 when enabled."
        }
      },
      "required": [
        "enabled",
        "max_concurrent_subagents"
      ],
      "additionalProperties": false,
      "description": "The resolved configuration for creating and coordinating subagents."
    },
    "NetworkAccessResource": {
      "type": "string",
      "enum": [
        "enabled",
        "disabled",
        "restricted"
      ],
      "x-enumDescriptions": [
        "Allows unrestricted network access.",
        "Disables network access.",
        "Allows access only to configured domains."
      ],
      "description": "The network access mode for an OpenAI-hosted environment."
    },
    "NetworkPolicyResource": {
      "type": "object",
      "properties": {
        "access": {
          "$ref": "#/$defs/NetworkAccessResource",
          "description": "The environment's network access mode."
        },
        "allowed_domains": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 0
          },
          "minItems": 0,
          "maxItems": 2000,
          "description": "Domains the environment may access when network access is restricted."
        }
      },
      "required": [
        "access",
        "allowed_domains"
      ],
      "additionalProperties": false,
      "description": "Network access for an OpenAI-hosted environment."
    },
    "OutputTokensDetailsResource": {
      "type": "object",
      "properties": {
        "reasoning_tokens": {
          "type": "integer",
          "format": "int64",
          "description": "The number of output tokens used for reasoning."
        }
      },
      "required": [
        "reasoning_tokens"
      ],
      "additionalProperties": false,
      "description": "A breakdown of output token usage for a session or turn."
    },
    "ReasoningEffortResource": {
      "type": "string",
      "enum": [
        "none",
        "minimal",
        "low",
        "medium",
        "high",
        "xhigh",
        "max"
      ],
      "description": "The amount of reasoning effort used by an agent."
    },
    "ReasoningResource": {
      "type": "object",
      "properties": {
        "effort": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReasoningEffortResource"
            },
            {
              "type": "null"
            }
          ],
          "description": "The requested reasoning effort, or `null` when the model selects its own default."
        },
        "summary": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReasoningSummaryResource"
            },
            {
              "type": "null"
            }
          ],
          "description": "The requested reasoning summary format, or `null` when summaries are disabled."
        }
      },
      "required": [
        "effort",
        "summary"
      ],
      "additionalProperties": false,
      "description": "The reasoning configuration used by an agent."
    },
    "ReasoningSummaryResource": {
      "type": "string",
      "enum": [
        "concise",
        "detailed",
        "auto"
      ],
      "x-enumDescriptions": [
        "Returns a concise reasoning summary when supported.",
        "Returns a detailed reasoning summary when supported.",
        "Automatically selects the most detailed summary supported by the model."
      ],
      "description": "The reasoning summary format requested from an agent."
    },
    "ServiceTierResource": {
      "type": "string",
      "enum": [
        "auto",
        "default",
        "flex",
        "priority",
        "fast"
      ],
      "description": "The service-tier policy configured for an agent."
    },
    "SessionAgentResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 0,
          "description": "The ID of the agent."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 0,
          "description": "The reusable agent's name when the session was created, or null if no name was saved. Later changes to the agent's name do not affect this value."
        },
        "model": {
          "type": "string",
          "minLength": 0,
          "description": "The model used by the agent."
        },
        "reasoning": {
          "$ref": "#/$defs/ReasoningResource",
          "description": "The agent's reasoning configuration."
        },
        "text": {
          "$ref": "#/$defs/TextResource",
          "description": "Configuration for text generated by the agent."
        },
        "service_tier": {
          "$ref": "#/$defs/ServiceTierResource",
          "description": "The effective service-tier policy for model requests. Defaults to `auto`."
        },
        "instructions": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 0,
          "description": "Custom instructions appended to the agent's default base instructions."
        },
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AgentToolResource"
          },
          "minItems": 0,
          "maxItems": 2000,
          "description": "Tools available to the agent."
        },
        "multi_agent": {
          "$ref": "#/$defs/MultiAgentConfigResource",
          "description": "Configuration for creating and coordinating subagents."
        }
      },
      "required": [
        "id",
        "name",
        "model",
        "reasoning",
        "text",
        "service_tier",
        "instructions",
        "tools",
        "multi_agent"
      ],
      "additionalProperties": false,
      "description": "The effective agent configuration for a session."
    },
    "SessionRequiredActionResource": {
      "oneOf": [
        {
          "$ref": "#/$defs/SessionRequiredActionResourceFunctionCall"
        },
        {
          "$ref": "#/$defs/SessionRequiredActionResourceEnvironmentConnection"
        }
      ],
      "x-oai-discriminator-values": [
        "function_call",
        "environment_connection"
      ],
      "description": "An action that must be completed before a session can continue."
    },
    "SessionRequiredActionResourceEnvironmentConnection": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "environment_connection"
          ],
          "default": "environment_connection",
          "x-stainless-const": true,
          "description": "The type of the object. Always `environment_connection`."
        },
        "environment_id": {
          "type": "string",
          "minLength": 0,
          "description": "The ID of the environment to reconnect."
        }
      },
      "required": [
        "type",
        "environment_id"
      ],
      "additionalProperties": false,
      "description": "Reconnect a session environment."
    },
    "SessionRequiredActionResourceFunctionCall": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "function_call"
          ],
          "default": "function_call",
          "x-stainless-const": true,
          "description": "The type of the object. Always `function_call`."
        },
        "turn_id": {
          "ty

# --- truncated at 32 KB (38 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/openai/refs/heads/main/json-schema/openai-session-resource-schema.json

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/openai-session-resource"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.