## List agents

`AgentListPage beta().agents().list(AgentListParamsparams = AgentListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/agents`

Lists reusable agents in the current project. See [agent configuration](/api/docs/guides/agents-api/configuration).

### Parameters

- `AgentListParams params`

  - `Optional<String> after`

    Return resources after this resource ID in the selected order.

  - `Optional<Long> limit`

    The maximum number of resources to return.

  - `Optional<Order> order`

    The order in which resources are returned. Defaults to `desc`.

    - `ASC("asc")`

      Returns resources in ascending order.

    - `DESC("desc")`

      Returns resources in descending order.

### Returns

- `class Agent:`

  A reusable agent scoped to the caller's project.

  - `String id`

    The ID of the reusable agent.

  - `long createdAt`

    The Unix timestamp, in seconds, when the agent was created.

  - `Optional<String> instructions`

    Custom instructions appended to the agent's default base instructions.

  - `Metadata metadata`

    Custom string key-value pairs attached to the agent.

  - `String model`

    The requested model name used for inference.

  - `MultiAgentConfig multiAgent`

    The resolved configuration for creating and coordinating subagents.

    - `boolean enabled`

      Whether subagent tools are enabled. Defaults to false.

    - `Optional<Long> maxConcurrentSubagents`

      Maximum number of subagents that may run concurrently, or null when disabled. Defaults to 6 when enabled.

  - `Optional<String> name`

    A human-readable name for the agent, or null if it is unnamed.

  - `JsonValue; object_ "agent"constant`

    The object type. Always `agent`.

    - `AGENT("agent")`

  - `AgentReasoning reasoning`

    The resolved reasoning configuration, including the model default for an omitted effort.

    - `Optional<Effort> effort`

      The requested reasoning effort, or `null` when the model selects its own default.

      - `NONE("none")`

      - `MINIMAL("minimal")`

      - `LOW("low")`

      - `MEDIUM("medium")`

      - `HIGH("high")`

      - `XHIGH("xhigh")`

      - `MAX("max")`

    - `Optional<Summary> summary`

      The requested reasoning summary format, or `null` when summaries are disabled.

      - `CONCISE("concise")`

        Returns a concise reasoning summary when supported.

      - `DETAILED("detailed")`

        Returns a detailed reasoning summary when supported.

      - `AUTO("auto")`

        Automatically selects the most detailed summary supported by the model.

  - `ServiceTier serviceTier`

    The resolved service-tier policy used for model requests.

    - `AUTO("auto")`

    - `DEFAULT("default")`

    - `FLEX("flex")`

    - `PRIORITY("priority")`

    - `FAST("fast")`

  - `AgentText text`

    The resolved configuration for text generated by the agent.

    - `TextFormat format`

      The effective output format. Defaults to ordinary text.

      - `JsonValue;`

        - `JsonValue; type "text"constant`

          The type of the object. Always `text`.

          - `TEXT("text")`

      - `JsonSchema`

        - `Schema schema`

          The JSON Schema that generated text must match.

        - `JsonValue; type "json_schema"constant`

          The type of the object. Always `json_schema`.

          - `JSON_SCHEMA("json_schema")`

    - `Verbosity verbosity`

      The amount of text produced by the agent. Defaults to `medium`.

      - `LOW("low")`

      - `MEDIUM("medium")`

      - `HIGH("high")`

  - `List<PersistedAgentTool> tools`

    Tools available to the agent.

    - `Function`

      - `boolean deferLoading`

        Whether the function is deferred and discovered through tool search.

      - `String description`

        A description of what the function does.

      - `String name`

        The name of the function.

      - `Parameters parameters`

        A JSON Schema object describing the function's arguments.

      - `JsonValue; type "function"constant`

        The type of the object. Always `function`.

        - `FUNCTION("function")`

    - `JsonValue;`

      - `JsonValue; type "tool_search"constant`

        The type of the object. Always `tool_search`.

        - `TOOL_SEARCH("tool_search")`

    - `ProgrammaticToolCalling`

      - `boolean enabled`

        Whether tools can be called from model-generated code.

      - `JsonValue; type "programmatic_tool_calling"constant`

        The type of the object. Always `programmatic_tool_calling`.

        - `PROGRAMMATIC_TOOL_CALLING("programmatic_tool_calling")`

    - `Mcp`

      - `Optional<List<String>> allowedTools`

        The MCP tools the agent may call, or null when all server tools are allowed.

      - `ConnectionOrigin connectionOrigin`

        Where outbound MCP HTTP connections originate.

        - `SERVICE("service")`

        - `ENVIRONMENT("environment")`

      - `Optional<String> credentialId`

        The vault credential selected for this MCP server, if any.

      - `RequestMetadata requestMetadata`

        Metadata included with requests to this MCP server.

      - `boolean required`

        Whether this MCP server must initialize before the first turn.

      - `String serverLabel`

        A label used to identify the MCP server in tool calls.

      - `PersistedMcpTransport transport`

        The credential-free transport used to connect to the MCP server.

        - `Http`

          - `Headers headers`

            Non-secret HTTP headers sent to the MCP server.

          - `String serverUrl`

            The URL of the MCP server.

          - `JsonValue; type "http"constant`

            The type of the object. Always `http`.

            - `HTTP("http")`

        - `Stdio`

          - `List<String> args`

            Arguments passed to the MCP server command.

          - `String command`

            The command used to start the MCP server.

          - `String cwd`

            The working directory used to start the MCP server.

          - `List<String> envVars`

            Environment variable names inherited from the execution environment.

          - `JsonValue; type "stdio"constant`

            The type of the object. Always `stdio`.

            - `STDIO("stdio")`

      - `JsonValue; type "mcp"constant`

        The type of the object. Always `mcp`.

        - `MCP("mcp")`

    - `WebSearch`

      - `Optional<List<String>> allowedDomains`

        Allowed search domains, or `null` when the search is unrestricted.

      - `ContextSize contextSize`

        The amount of search context made available to the model. Defaults to `medium`.

        - `LOW("low")`

        - `MEDIUM("medium")`

        - `HIGH("high")`

      - `Optional<Location> location`

        Approximate location used to localize search results, if provided.

        - `Optional<String> city`

          The city name.

        - `Optional<String> country`

          The two-letter ISO country code, such as `US`.

        - `Optional<String> region`

          The region or state name.

        - `Optional<String> timezone`

          The IANA timezone, such as `America/Los_Angeles`.

      - `Mode mode`

        The source used for web search results.

        - `DISABLED("disabled")`

        - `CACHED("cached")`

        - `LIVE("live")`

      - `JsonValue; type "web_search"constant`

        The type of the object. Always `web_search`.

        - `WEB_SEARCH("web_search")`

  - `long updatedAt`

    The Unix timestamp, in seconds, when the agent was last updated.

### Example

```java
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.agents.AgentListPage;
import com.openai.models.beta.agents.AgentListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        AgentListPage page = client.beta().agents().list();
    }
}
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "created_at": 0,
      "instructions": "instructions",
      "metadata": {
        "foo": "string"
      },
      "model": "model",
      "multi_agent": {
        "enabled": true,
        "max_concurrent_subagents": 1
      },
      "name": "name",
      "object": "agent",
      "reasoning": {
        "effort": "none",
        "summary": "concise"
      },
      "service_tier": "auto",
      "text": {
        "format": {
          "type": "text"
        },
        "verbosity": "low"
      },
      "tools": [
        {
          "defer_loading": true,
          "description": "description",
          "name": "name",
          "parameters": {
            "foo": "bar"
          },
          "type": "function"
        }
      ],
      "updated_at": 0
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id",
  "object": "list"
}
```
