Quickstart
Quickstart
Check the Agent Card, send a message to an agent, and jump into the generated API reference.
Base URL
https://humanitec.ru/flows/api/v1/{flow_id}Auth
Authorization: Bearer {token}Protocol
JSON-RPC 2.01. Prepare Values¶
The examples below need a flow identifier and an access token.
export HUMANITEC_TOKEN="your_token"
export HUMANITEC_FLOW_ID="my-agent"
export HUMANITEC_BASE_URL="https://humanitec.ru/flows/api/v1/${HUMANITEC_FLOW_ID}"
Tip
Use an API token in the Authorization: Bearer ... header for server integrations. Embedded widgets can use a short-lived embed session token.
2. Fetch The Agent Card¶
The Agent Card describes the flow, supported capabilities, available branches, and public variables.
3. Send A Message¶
Interactive calls use POST against the agent URL with a JSON-RPC body.
curl -X POST "${HUMANITEC_BASE_URL}" \
-H "Authorization: Bearer ${HUMANITEC_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "1",
"method": "message/send",
"params": {
"message": {
"messageId": "msg-1",
"role": "user",
"parts": [
{"kind": "text", "text": "Help me prepare a short project status"}
]
}
}
}'
4. Stream Responses¶
For streaming responses, switch the method to message/stream. The response is delivered as Server-Sent Events.
curl -N -X POST "${HUMANITEC_BASE_URL}" \
-H "Authorization: Bearer ${HUMANITEC_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "stream-1",
"method": "message/stream",
"params": {
"message": {
"messageId": "msg-stream-1",
"role": "user",
"parts": [
{"kind": "text", "text": "Tell me the next steps for launching the agent"}
]
}
}
}'