Skip to main content
POST
/
v2
/
agents
/
run
{
  "key": "simple-agent-1",
  "role": "Assistant",
  "description": "A helpful assistant for general tasks",
  "instructions": "Be helpful and concise",
  "settings": {
    "max_iterations": 3,
    "max_execution_time": 300,
    "tool_approval_required": "none",
    "tools": [
      {
        "requires_approval": false,
        "display_name": "current_date",
        "type": "current_date"
      }
    ]
  },
  "message": {
    "role": "user",
    "parts": [
      {
        "kind": "text",
        "text": "What's today's date and day of the week?"
      }
    ]
  },
  "model": "openai/gpt-4o",
  "path": "Default/agents",
  "memory_stores": [],
  "team_of_agents": []
}
{
  "id": "01K62T9YTVYZY4MV3WCJSMBCB2",
  "contextId": "workspace123",
  "kind": "task",
  "status": {
    "state": "submitted",
    "timestamp": "2025-09-26T10:30:00.000Z"
  },
  "metadata": {
    "orq_workspace_id": "workspace123",
    "orq_agent_id": "01JKG6QJ5FGHCWA7RVMMZB82QY",
    "orq_agent_key": "simple-agent-1",
    "orq_created_by_id": "account123"
  }
}
The Agents APIs are currently in beta and subject to change. Please report any feedback you might have to the team.
This endpoint returns a task object and does not stream responses. For streaming, use the stream-run endpoint.

Examples

{
  "key": "simple-agent-1",
  "role": "Assistant",
  "description": "A helpful assistant for general tasks",
  "instructions": "Be helpful and concise",
  "settings": {
    "max_iterations": 3,
    "max_execution_time": 300,
    "tool_approval_required": "none",
    "tools": [
      {
        "requires_approval": false,
        "display_name": "current_date",
        "type": "current_date"
      }
    ]
  },
  "message": {
    "role": "user",
    "parts": [
      {
        "kind": "text",
        "text": "What's today's date and day of the week?"
      }
    ]
  },
  "model": "openai/gpt-4o",
  "path": "Default/agents",
  "memory_stores": [],
  "team_of_agents": []
}
{
  "id": "01K62T9YTVYZY4MV3WCJSMBCB2",
  "contextId": "workspace123",
  "kind": "task",
  "status": {
    "state": "submitted",
    "timestamp": "2025-09-26T10:30:00.000Z"
  },
  "metadata": {
    "orq_workspace_id": "workspace123",
    "orq_agent_id": "01JKG6QJ5FGHCWA7RVMMZB82QY",
    "orq_agent_key": "simple-agent-1",
    "orq_created_by_id": "account123"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
key
string
required

A unique identifier for the agent. This key must be unique within the same workspace and cannot be reused. When executing the agent, this key determines if the agent already exists. If the agent version differs, a new version is created at the end of the execution, except for the task. All agent parameters are evaluated to decide if a new version is needed.

Minimum length: 1
model
string
required

The language model that powers the agent. The model must support tool calling capabilities.

role
string
required

Specifies the agent's function and area of expertise.

Minimum length: 1
instructions
string
required

Provides context and purpose for the agent. Combined with the system prompt template to generate the agent's instructions.

Minimum length: 1
message
object
required

The A2A format message containing the task for the agent to perform.

path
string
required

Entity storage path in the format: project/folder/subfolder/...

The first element identifies the project, followed by nested folders (auto-created as needed).

With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.

Example:

"Default"

settings
object
required
task_id
string

Optional task ID to continue an existing agent execution. When provided, the agent will continue the conversation from the existing task state. The task must be in an inactive state to continue.

fallback_models
string[]

Optional array of fallback model IDs to use when the primary model fails. Models are tried in order. All models must support tool calling capabilities.

variables
object

Optional variables for template replacement in system prompt, instructions, and messages

contact
object

Information about the contact making the request. If the contact does not exist, it will be created automatically.

thread
object

Thread information to group related requests

memory
object

Memory configuration for the agent execution. Used to associate memory stores with specific entities like users or sessions.

description
string

A brief summary of the agent's purpose.

Minimum length: 1
system_prompt
string

A custom system prompt template for the agent. If omitted, the default template is used.

Minimum length: 1
memory_stores
string[]

The list of keys of the memory stores that are accessible to the agent.

knowledge_bases
object[]

Knowledge base configurations for the agent to access

team_of_agents
object[]

The agents that are accessible to this orchestrator. The main agent can hand off to these agents to perform tasks.

metadata
object

Optional metadata for the agent run as key-value pairs that will be included in traces

Response

200 - application/json

Agent task created successfully

A2A Task response format

id
string
required

The ID of the created agent execution task

contextId
string
required

The correlation ID for this execution

kind
enum<string>
required

A2A entity type

Available options:
task
status
object
required

Task status information

metadata
object

Task metadata containing workspace_id and trace_id for feedback