OpenAI Agents API

The Agents API from OpenAI — 21 operation(s) for agents.

GitHub OpenAPI
Business capability
Agent Infrastructure & Agentic Commerce AE-100

Operations 33

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /agents/environments/{environment_id} Check an agent's execution environment · Retrieve an agent environment #
Ask an LLM
“How do I see what an agent's execution environment is connected to?”
“Can I check the safe metadata of an agent environment?”
Tell an agent
Show agent environment {environment_id}.
Check the connection status of execution environment {environment_id}.
GET /agents/environments/{environment_id}/files List files on an agent environment · List agent environment files #
Ask an LLM
“Which files are live on an agent's execution environment?”
“Can I list only the files in one directory of an agent environment?”
Tell an agent
List files on agent environment {environment_id}.
Show files in directory {path} of environment {environment_id}.
POST /agents/environments/{environment_id}/files Copy a file into an agent environment · Create an agent environment file #
Ask an LLM
“How do I copy a file into an agent's execution environment?”
“Can I install a file into an agent environment from a Files API file?”
Tell an agent
Copy a file into agent environment {environment_id}.
Install a file into execution environment {environment_id}.
GET /agents/sessions/{session_id}/subagents List subagents in an agent session · List session subagents #
Ask an LLM
“What subagents has an agent session spawned?”
“Can I include closed subagents when listing a session's subagents?”
Tell an agent
List subagents in agent session {session_id}.
Show the subagents of session {session_id}, including closed ones.
GET /agents/sessions/{session_id}/subagents/{subagent_id} Get one subagent in an agent session · Retrieve a session subagent #
Ask an LLM
“How do I look up a single subagent inside an agent session?”
“What does one subagent in a session return?”
Tell an agent
Get subagent {subagent_id} in session {session_id}.
Show the details of subagent {subagent_id} from session {session_id}.
GET /agents/sessions/{session_id}/subagents/{subagent_id}/items List an agent's own items across turns · List subagent items #
Ask an LLM
“What items has a subagent produced across all its turns?”
“Can I list every item a subagent created in a session?”
Tell an agent
List the items of subagent {subagent_id} in session {session_id}.
Show all items subagent {subagent_id} created in session {session_id}.
GET /agents/sessions/{session_id}/subagents/{subagent_id}/turns List all turns of a subagent · List subagent turns #
Ask an LLM
“How do I see every turn a subagent took, including after a resume?”
“What turns has a subagent gone through in an agent session?”
Tell an agent
List all turns of subagent {subagent_id} in session {session_id}.
Show every turn subagent {subagent_id} took in session {session_id}.
GET /agents/sessions/{session_id}/subagents/{subagent_id}/turns/{turn_id} Get one turn of a subagent · Retrieve a subagent turn #
Ask an LLM
“How do I read a single turn from a subagent?”
“What did a subagent say in one specific turn?”
Tell an agent
Get turn {turn_id} of subagent {subagent_id} in session {session_id}.
Show the contents of turn {turn_id} from subagent {subagent_id} in session {session_id}.
GET /agents/sessions/{session_id}/subagents/{subagent_id}/turns/{turn_id}/items List items in one subagent turn · List subagent turn items #
Ask an LLM
“Which items were produced in one turn of a subagent?”
“Can I list only the items from a single subagent turn?”
Tell an agent
List items in turn {turn_id} of subagent {subagent_id} in session {session_id}.
Show what subagent {subagent_id} produced in turn {turn_id} of session {session_id}.
GET /agents List reusable agents · List agents #
Ask an LLM
“Which reusable agents exist in my project?”
“Can I sort my reusable agents by name?”
Tell an agent
List reusable agents.
Show my project's reusable agents ordered by {order}.
POST /agents Create a reusable agent · Create an agent #
Ask an LLM
“How do I create a reusable agent without storing credentials?”
“Can I give a new reusable agent custom instructions and tools?”
Tell an agent
Create reusable agent {name} on model {model}.
Create reusable agent {name} with tools {tools} and instructions {instructions}.
GET /agents/{agent_id} Get a reusable agent · Retrieve an agent #
Ask an LLM
“How do I look up a reusable agent by ID?”
“What model and instructions does a reusable agent use?”
Tell an agent
Show reusable agent {agent_id}.
Get the configuration of reusable agent {agent_id}.
POST /agents/{agent_id} Update a reusable agent · Update an agent #
Ask an LLM
“How do I change the model or instructions of a reusable agent?”
“Can I rename a reusable agent?”
Tell an agent
Update reusable agent {agent_id} to use model {model}.
Rename reusable agent {agent_id} to {name}.
DELETE /agents/{agent_id} Delete a reusable agent · Delete an agent #
Ask an LLM
“How do I delete a reusable agent?”
“Can I remove a reusable agent from my project?”
Tell an agent destructive · confirm first
Delete reusable agent {agent_id}.
Remove reusable agent {agent_id} from my project.
GET /agents/environments/templates List reusable agent environment templates · List agent environment templates #
Ask an LLM
“Which reusable agent environment templates are available?”
“Can I sort the agent environment templates?”
Tell an agent
List reusable agent environment templates.
Show agent environment templates ordered by {order}.
POST /agents/environments/templates Create a reusable agent environment template · Create an agent environment template #
Ask an LLM
“How do I create a reusable agent environment template without exposing setup commands?”
“Can I set up packages, setup commands and network access for an agent environment template?”
Tell an agent
Create reusable agent environment template {name} with packages {packages}.
Create reusable agent environment template {name} with setup commands {setup_commands} and network {network}.
GET /agents/environments/templates/{environment_template_id} Get a reusable agent environment template · Retrieve an agent environment template #
Ask an LLM
“How do I look up a reusable agent environment template?”
“What packages and skills does an agent environment template include?”
Tell an agent
Show reusable agent environment template {environment_template_id}.
Get the configuration of agent environment template {environment_template_id}.
POST /agents/environments/templates/{environment_template_id} Update a reusable agent environment template · Update an agent environment template #
Ask an LLM
“How do I change the packages or setup commands of an agent environment template?”
“Can I rename an agent environment template?”
Tell an agent
Update reusable agent environment template {environment_template_id} to use packages {packages}.
Rename reusable agent environment template {environment_template_id} to {name}.
DELETE /agents/environments/templates/{environment_template_id} Delete a reusable agent environment template · Delete an agent environment template #
Ask an LLM
“How do I delete a reusable agent environment template?”
“Can I remove an agent environment template and its setup commands?”
Tell an agent destructive · confirm first
Delete reusable agent environment template {environment_template_id}.
Remove agent environment template {environment_template_id} and its setup commands.
GET /agents/sessions List managed agent sessions · List agent sessions #
Ask an LLM
“Which managed agent sessions exist?”
“Can I list only the sessions of one reusable agent?”
Tell an agent
List managed agent sessions.
Show managed sessions for reusable agent {agent_id}.
POST /agents/sessions Start a managed agent session · Create an agent session #
Ask an LLM
“How do I start a hosted agent session that runs my agent's turns?”
“Can I submit initial input to a new agent session and stream its events?”
Tell an agent
Create an agent session in environment {environment}.
Start a session with agent {agent_id} and initial input {input}.
GET /agents/sessions/{session_id} Get a managed agent session's state · Retrieve an agent session #
Ask an LLM
“What is the current state of my hosted agent session?”
“Can I check a managed session's metadata and reasoning effort?”
Tell an agent
Show agent session {session_id}.
Get the current state of managed session {session_id}.
POST /agents/sessions/{session_id} Change a managed agent session's settings · Update an agent session #
Ask an LLM
“How do I change the model or reasoning effort of a hosted agent session?”
“Can I update the metadata on a managed session after it starts?”
Tell an agent
Update session {session_id} with agent settings {agent}.
Set metadata {metadata} on managed session {session_id}.
DELETE /agents/sessions/{session_id} Delete a managed agent session · Delete an agent session #
Ask an LLM
“How do I delete a hosted agent session I no longer need?”
“Can I cancel a still-open turn by deleting its session?”
Tell an agent destructive · confirm first
Delete agent session {session_id}.
Remove managed session {session_id} and its outputs.
GET /agents/sessions/{session_id}/artifacts List artifacts published by a session · List agent session artifacts #
Ask an LLM
“Which artifacts did my agent publish during a session?”
“Can I list only the artifacts from one environment?”
Tell an agent
List artifacts from session {session_id}.
Show {limit} artifacts from session {session_id} in environment {environment_id}.
GET /agents/sessions/{session_id}/artifacts/{artifact_id} Get an agent session artifact's metadata · Retrieve an agent session artifact #
Ask an LLM
“What metadata is stored for one of my agent's published artifacts?”
“Can I look up a session artifact by its ID?”
Tell an agent
Show artifact {artifact_id} from session {session_id}.
Get the metadata of session artifact {artifact_id} in {session_id}.
DELETE /agents/sessions/{session_id}/artifacts/{artifact_id} Delete an agent session artifact · Delete an agent session artifact #
Ask an LLM
“How do I delete an artifact my agent published without touching its file?”
“Can I remove a session artifact by its ID?”
Tell an agent destructive · confirm first
Delete artifact {artifact_id} from session {session_id}.
Remove session artifact {artifact_id} in {session_id} but keep its file.
GET /agents/sessions/{session_id}/artifacts/{artifact_id}/content Download an agent session artifact's bytes · Retrieve agent session artifact content #
Ask an LLM
“How do I download the bytes of an artifact my agent published?”
“Can I fetch session artifact content after its environment expired?”
Tell an agent
Download content of artifact {artifact_id} from session {session_id}.
Fetch the bytes of session artifact {artifact_id} in {session_id}.
GET /agents/sessions/{session_id}/events Stream live events for a session · Stream agent session events #
Ask an LLM
“How do I stream live events for a hosted agent session?”
“Can I watch a session's events as they happen?”
Tell an agent
Stream live events for session {session_id}.
Watch session {session_id} events in real time.
POST /agents/sessions/{session_id}/events Submit input events to a session · Create agent session input events #
Ask an LLM
“How do I submit a message, cancellation or tool result to an agent session?”
“Can I send several events to a session in one request?”
Tell an agent
Submit events {events} to session {session_id}.
Send {events} to session {session_id} with idempotency key {key}.
GET /agents/sessions/{session_id}/items List items produced by a session's root agent · List agent session items #
Ask an LLM
“What did my agent and its subagents produce in a session?”
“Can I list a session's root agent items in order?”
Tell an agent
List root agent items for session {session_id}.
Show {limit} items from session {session_id} ordered {order}.
GET /agents/sessions/{session_id}/turns List a session's turns · List agent session turns #
Ask an LLM
“Which turns did my agent take in a session?”
“Can I list session turns after a certain cursor?”
Tell an agent
List turns for session {session_id}.
Show {limit} turns of session {session_id} after {after}.
GET /agents/sessions/{session_id}/turns/{turn_id} Get a session turn's status and usage · Retrieve an agent session turn #
Ask an LLM
“What is the current status and usage of one turn in my session?”
“Can I see why a session turn failed?”
Tell an agent
Show turn {turn_id} in session {session_id}.
Get the status and timestamps of session turn {turn_id} in {session_id}.

Work with this as data

Every API 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 apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • 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 API
curl "https://apis.io/api/v1/apis/openai:openai-agents-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

openai-agents-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenAI Agents API
  description: The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
  version: 2.3.0
  termsOfService: https://openai.com/policies/terms-of-use
  contact:
    name: OpenAI Support
    url: https://help.openai.com/
  license:
    name: MIT
    identifier: MIT
servers:
- url: https://api.openai.com/v1
security:
- ApiKeyAuth: []
tags:


# --- truncated at 32 KB (334 KB total) ---
# Full source: https://artifacts.apis.io/openai/openapi/openai-agents-api-openapi.yml