Skip to main content
GET
/
v2
/
agents
/
{agent_key}
/
responses
/
{task_id}
Get response
curl --request GET \
  --url https://api.orq.ai/v2/agents/{agent_key}/responses/{task_id} \
  --header 'Authorization: Bearer <token>'
{
  "_id": "<string>",
  "task_id": "<string>",
  "output": [
    {
      "messageId": "<string>",
      "role": "user",
      "parts": [
        {
          "kind": "text",
          "text": "<string>"
        }
      ],
      "metadata": {}
    }
  ],
  "created_at": "<string>",
  "model": "<string>",
  "status": "in_progress",
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123,
    "prompt_tokens_details": {
      "cached_tokens": 123,
      "cache_creation_tokens": 123,
      "audio_tokens": 123
    },
    "completion_tokens_details": {
      "reasoning_tokens": 123,
      "accepted_prediction_tokens": 123,
      "rejected_prediction_tokens": 123,
      "audio_tokens": 123
    }
  },
  "finish_reason": "stop",
  "pending_tool_calls": [
    {
      "id": "<string>",
      "type": "function",
      "function": {
        "name": "<string>",
        "arguments": "<string>"
      }
    }
  ],
  "telemetry": {
    "trace_id": "<string>",
    "span_id": "<string>"
  },
  "error": "<string>"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

agent_key
string
required

The unique key identifier of the agent

task_id
string
required

The agent execution task ID returned from create response

Response

Response retrieved successfully. Returns the current state of the agent execution including output messages, model used, token usage, and status.

Response type from the get-response endpoint. Includes a status field indicating the current state of the agent execution.

_id
string
required

The unique response ID

task_id
string
required

The agent execution task ID

output
Agent Response Message · object[]
required

Array of messages from the agent execution

created_at
string
required

ISO timestamp of response creation

model
string
required

Model used in provider/model format

status
enum<string>
required

Current status of the agent response

Available options:
in_progress,
completed,
failed
usage
object

Token usage from the agent execution

finish_reason
enum<string>

The reason why the agent stopped generating

Available options:
stop,
length,
tool_calls,
content_filter,
function_call,
max_iterations,
max_time
pending_tool_calls
object[]

Tool calls awaiting user response (when finish_reason is function_call)

telemetry
Telemetry · object

Telemetry information for correlating the response with traces

error
string

Error message when status is failed