Skip to content

Submit prompts to AI agents and receive responses synchronously, asynchronously via SSE, or via a fully blocking synchronous call. Use these endpoints when you need to send a user or system message to an agent and consume the resulting message stream or final response. Cross-site (browser) requests are blocked on the GET variant — use the POST endpoint from web clients.


Submit a prompt via query string. Returns an SSE stream by default, or a JSON response if wait=true. Cross-site requests are blocked.

NameInTypeRequiredDescription
aiquerystringYesThe prompt text to send to the agent
sessionIDquerystringNoExisting session ID (24-character hex) to continue the conversation
providerIDquerystringNoOverride the model provider ID
modelIDquerystringNoOverride the model ID
endpointquerystringNoOverride the provider endpoint URL
baseURLquerystringNoOverride the base URL for the request
apiKeyquerystringNoAPI key for the model provider
keyquerystringNoAlternative API key parameter
waitquerystringNoIf true, returns a JSON response instead of an SSE stream
autoApprovequerystringNoAutomatically approve tool/permission prompts
agentquerystringNoAgent identifier to use for this prompt
systemquerystringNoSystem prompt override
workspacequerystringNoWorkspace ID to scope the prompt to
directoryquerystringNoWorking directory for the agent
{
"sessionID": "5f9b3a2e1c8d4f0001a2b3c4",
"messageID": "msg_01HXYZABCDEF",
"status": "completed",
"info": {
"id": "msg_01HXYZABCDEF",
"role": "assistant",
"finish": "stop"
},
"parts": [
{
"type": "text",
"text": "Here is the answer to your prompt."
}
]
}
const result = await client.agent.prompt.agentPromptGet({
ai: "Summarize the last three commits in this repository.",
sessionID: "5f9b3a2e1c8d4f0001a2b3c4",
providerID: "anthropic",
modelID: "claude-sonnet-4-20250514",
wait: "true"
});
Terminal window
curl -X GET "https://api.hoody.com/api/v1/agent/prompt?ai=Summarize%20the%20last%20three%20commits&sessionID=5f9b3a2e1c8d4f0001a2b3c4&wait=true" \
-H "Authorization: Bearer <token>"

Submit a prompt to an AI agent. Returns an SSE stream by default, or a JSON response if wait=true.

FieldTypeRequiredDescription
partsarrayYesMessage parts. Each part has type (currently "text") and text
sessionIDstringNoExisting session ID (24-character hex) to continue the conversation
modelobjectNoModel selection: { providerID, modelID }
model.providerIDstringNoModel provider identifier (required when model is set)
model.modelIDstringNoModel identifier (required when model is set)
endpointstringNoOverride the provider endpoint URL
apiKeystringNoAPI key for the model provider
waitbooleanNoIf true, returns a JSON response instead of an SSE stream
autoApprovebooleanNoAutomatically approve tool/permission prompts
agentstringNoAgent identifier to use for this prompt
systemstringNoSystem prompt override
workspacestringNoWorkspace ID to scope the prompt to
directorystringNoWorking directory for the agent
{
"parts": [
{ "type": "text", "text": "Refactor the authentication module to use async/await." }
],
"sessionID": "5f9b3a2e1c8d4f0001a2b3c4",
"model": {
"providerID": "anthropic",
"modelID": "claude-sonnet-4-20250514"
},
"wait": true,
"autoApprove": false,
"agent": "build",
"system": "You are a senior TypeScript engineer.",
"workspace": "ws_01HXYZABCDEF",
"directory": "/Users/me/projects/app"
}
{
"sessionID": "5f9b3a2e1c8d4f0001a2b3c4",
"messageID": "msg_01HXYZABCDEF",
"status": "completed",
"info": {
"id": "msg_01HXYZABCDEF",
"role": "assistant",
"finish": "stop"
},
"parts": [
{
"type": "text",
"text": "I've refactored the auth module. The key changes were..."
}
]
}
const result = await client.agent.prompt.agentPrompt({
parts: [
{ type: "text", text: "Refactor the authentication module to use async/await." }
],
sessionID: "5f9b3a2e1c8d4f0001a2b3c4",
model: {
providerID: "anthropic",
modelID: "claude-sonnet-4-20250514"
},
wait: true,
agent: "build",
workspace: "ws_01HXYZABCDEF",
directory: "/Users/me/projects/app"
});
Terminal window
curl -X POST "https://api.hoody.com/api/v1/agent/prompt" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"parts": [
{ "type": "text", "text": "Refactor the authentication module to use async/await." }
],
"sessionID": "5f9b3a2e1c8d4f0001a2b3c4",
"model": { "providerID": "anthropic", "modelID": "claude-sonnet-4-20250514" },
"wait": true
}'

Submit a prompt and wait for the full response. The server blocks until the agent finishes execution and returns the complete output.

FieldTypeRequiredDescription
partsarrayYesMessage parts. Each part has type (currently "text") and text
sessionIDstringNoExisting session ID (24-character hex) to continue the conversation
modelobjectNoModel selection: { providerID, modelID }
model.providerIDstringNoModel provider identifier (required when model is set)
model.modelIDstringNoModel identifier (required when model is set)
endpointstringNoOverride the provider endpoint URL
apiKeystringNoAPI key for the model provider
waitbooleanNoReserved flag for the synchronous variant
autoApprovebooleanNoAutomatically approve tool/permission prompts
agentstringNoAgent identifier to use for this prompt
systemstringNoSystem prompt override
workspacestringNoWorkspace ID to scope the prompt to
directorystringNoWorking directory for the agent
{
"parts": [
{ "type": "text", "text": "Write unit tests for the billing service." }
],
"sessionID": "5f9b3a2e1c8d4f0001a2b3c4",
"model": {
"providerID": "openai",
"modelID": "gpt-4o"
},
"autoApprove": true,
"agent": "build",
"workspace": "ws_01HXYZABCDEF",
"directory": "/Users/me/projects/billing"
}
{
"sessionID": "5f9b3a2e1c8d4f0001a2b3c4",
"messageID": "msg_01HXYZGHIJKL",
"status": "completed",
"info": {
"id": "msg_01HXYZGHIJKL",
"role": "assistant",
"finish": "stop"
},
"parts": [
{
"type": "text",
"text": "I've added 14 unit tests covering invoice creation, tax calculation, refunds, and edge cases."
}
]
}
const result = await client.agent.prompt.agentPromptSync({
parts: [
{ type: "text", text: "Write unit tests for the billing service." }
],
sessionID: "5f9b3a2e1c8d4f0001a2b3c4",
model: {
providerID: "openai",
modelID: "gpt-4o"
},
autoApprove: true,
agent: "build",
workspace: "ws_01HXYZABCDEF",
directory: "/Users/me/projects/billing"
});
Terminal window
curl -X POST "https://api.hoody.com/api/v1/agent/prompt/sync" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"parts": [
{ "type": "text", "text": "Write unit tests for the billing service." }
],
"sessionID": "5f9b3a2e1c8d4f0001a2b3c4",
"model": { "providerID": "openai", "modelID": "gpt-4o" },
"autoApprove": true
}'