# Send a custom instruction (/en/api-reference/api-ref/conversational-ai/think)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Sends a custom text instruction to a specified Conversational AI agent instance.

- OpenAPI: /openapi/conversational-ai/rest-api.en.yaml
- Operation ID: agent-think
- Method: POST
- Path: /v2/projects/{appid}/agents/{agentId}/think

## Servers

- https://api.agora.io/api/conversational-ai-agent

## Parameters

- `appid` (path, required) - The App ID of the project.
- `agentId` (path, required) - The agent instance ID you obtained after successfully calling `join` to [Start a conversational AI agent](/en/api-reference/api-ref/conversational-ai/join).

## Request body

- `text` (string, required) - The custom instruction text to inject into the current conversation pipeline. The system processes this as user input.
No schema.
- `on_listening_action` (string) - The action to take when the agent is in a listening state:
- `inject`: Inject the custom text instruction into the current turn without interrupting it.
- `interrupt`: Immediately interrupt the current flow and initiate a new round of dialogue.
- `ignore`: Ignore the request.
No schema.
- `on_thinking_action` (string) - The action to take when the agent is in a thinking state:
- `interrupt`: Interrupt the current state and start a new conversation turn.
- `ignore`: Ignore the request.
No schema.
- `on_speaking_action` (string) - The action to take when the agent is in a speaking state:
- `interrupt`: Interrupt the current state and start a new conversation turn.
- `ignore`: Ignore the request.
No schema.
- `interruptable` (boolean) - Whether user speech can interrupt the injected instruction:
- `true`: User speech can interrupt the instruction.
- `false`: User speech cannot interrupt the instruction.
No schema.
- `metadata` (object) - Custom metadata in key-value pair format. Use this field to pass additional business information such as identifiers or model references.
No schema.

## Responses

### 200

The request was successful. The response body contains the result of the request.

- `agent_id` (string) - Unique identifier of the agent instance.
No schema.
- `channel` (string) - The name of the RTC channel where the agent is located.
No schema.
- `start_ts` (integer) - Timestamp indicating when the agent was created.
No schema.
### default

The request failed. The response body includes the error details.

- `detail` (string) - Detailed error information.
No schema.
- `reason` (string) - The reason for the failure.
No schema.
