curl --request POST \
--url 'https://api.orq.ai/v2/agents/customer_support/responses' \
--header 'Authorization: Bearer $ORQ_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "Hi! I am testing your capabilities. Can you describe what you can do?"
}
]
}
}'{
"_id": "<string>",
"task_id": "<string>",
"output": [
{
"messageId": "<string>",
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>"
}
],
"metadata": {}
}
],
"created_at": "<string>",
"model": "<string>",
"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
}
}
}Initiates an agent conversation and returns a complete response. This endpoint manages the full lifecycle of an agent interaction, from receiving the initial message through all processing steps until completion. Supports synchronous execution (waits for completion) and asynchronous execution (returns immediately with task ID). The response includes all messages exchanged, tool calls made, and token usage statistics. Ideal for request-response patterns where you need the complete interaction result.
curl --request POST \
--url 'https://api.orq.ai/v2/agents/customer_support/responses' \
--header 'Authorization: Bearer $ORQ_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "Hi! I am testing your capabilities. Can you describe what you can do?"
}
]
}
}'{
"_id": "<string>",
"task_id": "<string>",
"output": [
{
"messageId": "<string>",
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>"
}
],
"metadata": {}
}
],
"created_at": "<string>",
"model": "<string>",
"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
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The unique key of identifier of the agent to invoke
The A2A message to send to the agent (user input or tool results)
Show child attributes
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.
Optional variables for template replacement in system prompt, instructions, and messages
Show child attributes
Information about the contact making the request. If the contact does not exist, it will be created automatically.
Show child attributes
Thread information to group related requests
Show child attributes
Memory configuration for the agent execution. Used to associate memory stores with specific entities like users or sessions.
Show child attributes
Optional metadata for the agent invocation as key-value pairs that will be included in traces
Show child attributes
If true, returns immediately without waiting for completion. If false (default), waits until the agent becomes inactive or errors.
If true, returns Server-Sent Events (SSE) streaming response with real-time events. If false (default), returns standard JSON response.
Show child attributes
Agent response successfully created and completed. Returns the full conversation including all messages, tool interactions, model used, and token usage statistics. In background mode, returns immediately with initial task details. In streaming mode, returns Server-Sent Events (SSE) with real-time events.
Response type from the create-response endpoint.
The unique response ID
The agent execution task ID
Array of messages from the agent execution
Show child attributes
ISO timestamp of response creation
Model used in provider/model format
Token usage from the agent execution
Show child attributes
Was this page helpful?