C2AI2X Quickstart
The fastest integration path is:
- Get a platform-issued Bearer credential
- Build the minimum executable platform request
- Call
POST /api/execute - Handle either
200or202
1. Auth
The live public route uses platform admission with a Bearer credential.
- route auth contract:
admin_or_api_key - OpenAPI security:
bearerAuth
That means the external caller still sends Authorization: Bearer <token>, and zhen-platform-core decides whether the credential is valid for this ingress.
2. Minimum request
The current phase 1 executable subset requires:
domainrequired_scopesexecution_modetextorstructured_inputkey_idonly when the bearer actor isadmin
{
"domain": "zhenins",
"execution_mode": "sync",
"required_scopes": [],
"text": "I need an insurance consultation."
}
3. Recommended fields for a stable integration
Add these as soon as you move beyond the first successful request:
required_scopesattachmentsrequest_idtrace_ididempotency_keyproject_iduser_idsession_idexact_bridge
If you need to preserve neutral protocol objects such as Demand, Envelope, or AuthorizationGrant, carry them inside structured_input for platform translation and audit. They are not the frozen top-level HTTP contract of the current POST /api/execute route.
4. Sync example
curl -X POST "$BASE_URL/api/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"domain": "zhenins",
"execution_mode": "sync",
"required_scopes": [],
"text": "I need an insurance consultation."
}'
Success returns 200:
{
"output": {
"request_id": "req_...",
"trace_id": "trace_...",
"status": "completed"
},
"usage_applications": []
}
5. Async example
When execution_mode = "async", success returns 202:
{
"accepted": {
"status": "accepted",
"workflow_id": "wf_...",
"stream_url": "/api/workflows/wf_.../stream",
"query_url": "/api/workflows/wf_...",
"cancel_url": "/api/workflows/wf_.../cancel",
"message": "Workflow accepted. Connect to stream_url for real-time progress."
}
}
Consume the returned workflow URLs from zhen-platform-core. Do not call zhen-brain-core directly.