Skip to main content

POST /v1/agents/{agent_id}/invoke

Invoke an agent and receive a synchronous response.

Request

Path Parameters

string
required
The unique identifier of the agent to invoke

Request Body

string
required
The input query or prompt for the agent
object
Additional parameters for the agent
string
Session ID for maintaining conversation context

Response

object
required
The agent’s response
object
Token usage information
object
Additional metadata

Examples

Basic Invocation

With Parameters

Response Example

Error Responses

400 Bad Request

Missing required field:

404 Not Found

Agent doesn’t exist:

429 Rate Limited

Best Practices

  1. Include Session ID for conversations to maintain context
  2. Set Appropriate Timeouts as agent processing can take time
  3. Handle Errors Gracefully with retry logic for 5xx errors
  4. Monitor Token Usage to optimize costs

See Also