Create Completion
Create a completion for an agent
post/v1/agents/{UUID}/completions
Create a completion for an agent
Path Parameters
UUIDstring
Body Parameters
enable_conversation_historyboolean
Enable conversation history
messagesarray of object
streamboolean
Whether to stream the response using SSE
enable_agent_clarification_questionsboolean
optional
enable_editable_workflowboolean
optional
sourcesarray of union
optional
thread_idstring
optional
Optional thread identifier
toolsarray of object
optional
use_nested_youchat_updatesboolean
optional
Returns
idstring
contentarray of union
typeenum
"response"
intermediatary_resultsunknown
optional
Intermediate results (type unspecified)
sourcesarray of union
optional
curl https://api.you.com/v1/agents/$UUID/completions \
-H 'Content-Type: application/json' \
-H "X-API-Key: $YOU_API_API_KEY" \
-d '{
"enable_conversation_history": true,
"messages": [
{
"content": "string",
"role": "user"
}
],
"stream": true
}'
200 Example
{
"id": "id",
"content": [
{
"citations": [
{
"id": 0,
"type": "file",
"attributes": {
"foo": "bar"
},
"uri": "uri"
}
],
"text": "text",
"type": "thinking"
}
],
"type": "response",
"intermediatary_results": {},
"related_searches": [
{
"text": "text"
}
],
"sources": [
{
"snippet": "snippet",
"title": "title",
"type": "web",
"url": "url"
}
]
}