AgentConnect
Decisions

Try a chat API gate

Evaluates a draft Decision gate for protocol against a sample call on a daemon serving the agent, in the state the live gate builds (currentMessage.text, no history; the agent and source are bound here), then applies the draft condition. Writes nothing and never stores the sample. Needs edit access to the agent. An unsupported daemon returns not_applied without a model call; 503 when no serving daemon is connected; a provider failure returns unavailable, which admits the call and never means skip.

POST
/v1/orgs/{orgId}/agents/{agentId}/api/{protocol}/gate/preview

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

orgId*string
agentId*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
protocol*string

Value in

  • "ai-sdk-ui"
  • "ag-ui"

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/orgs/string/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/api/ai-sdk-ui/gate/preview" \  -H "Content-Type: application/json" \  -d '{    "gate": {      "decisionId": "string",      "when": {        "type": "choice",        "thresholds": {          "property1": 0,          "property2": 0        }      },      "type": "gate"    },    "state": {      "currentMessage": {        "text": "string"      }    }  }'
{  "mode": "live",  "readiness": {    "status": "ready"  },  "evaluation": {    "status": "answered",    "answer": {      "type": "boolean",      "value": true,      "probability": 0    },    "model": "string",    "usage": {      "inputTokens": 0,      "outputTokens": 0    }  },  "chain": [    {      "stepId": "string",      "decisionId": "string",      "evaluation": {        "status": "answered",        "answer": {          "type": "boolean",          "value": true,          "probability": 0        },        "model": "string",        "usage": {          "inputTokens": 0,          "outputTokens": 0        }      }    }  ],  "detail": {    "seq": 0,    "at": "string",    "messageId": "string",    "title": "string",    "decisionId": "string",    "outcome": "triggered",    "reason": "string",    "answer": {      "type": "boolean",      "value": true,      "probability": 0    },    "matchedKeys": [      "string"    ],    "latencyMs": 0,    "requestedModel": "string",    "actualModel": "string",    "usage": {      "inputTokens": 0,      "outputTokens": 0    },    "detailsExpired": true,    "snapshot": {      "decisionId": "string",      "providerId": "string",      "model": "string",      "question": {        "type": "choice",        "instructions": "string",        "criteria": {          "property1": "string",          "property2": "string"        }      },      "condition": {        "type": "choice",        "thresholds": {          "property1": 0,          "property2": 0        }      },      "sessionMode": "string"    },    "input": {      "agent": {        "name": "string",        "description": "string"      },      "currentMessage": {        "id": "string",        "sender": {          "id": "string"        },        "text": "string",        "quote": {          "sender": "string",          "text": "string"        },        "threadId": "string",        "time": "string",        "truncated": true      },      "history": [        {          "id": "string",          "sender": {            "id": "string"          },          "text": "string",          "quote": {            "sender": "string",            "text": "string"          },          "threadId": "string",          "time": "string",          "truncated": true        }      ],      "historyOmitted": 0,      "context": {        "partial": true,        "reasons": [          "string"        ],        "omittedMessages": 0      }    },    "fullAnswer": {      "type": "boolean",      "value": true,      "probability": 0    },    "chain": [      {        "stepId": "string",        "decisionId": "string",        "evaluation": {          "status": "answered",          "answer": {            "type": "boolean",            "value": true,            "probability": 0          },          "model": "string",          "usage": {            "inputTokens": 0,            "outputTokens": 0          }        }      }    ],    "steps": [      {        "stepId": "string",        "decisionId": "string",        "providerId": "string",        "model": "string",        "question": {          "type": "choice",          "instructions": "string",          "criteria": {            "property1": "string",            "property2": "string"          }        },        "condition": {          "type": "choice",          "thresholds": {            "property1": 0,            "property2": 0          }        },        "rawRequest": {          "text": "string",          "truncated": true        },        "rawResponse": {          "text": "string",          "truncated": true        }      }    ],    "rawRequest": {      "text": "string",      "truncated": true    },    "rawResponse": {      "text": "string",      "truncated": true    },    "evidence": {      "snapshotSeq": 0,      "suppliedBackground": 0    }  },  "consumer": {    "type": "gate",    "outcome": "trigger",    "notAppliedReason": "off",    "reason": "string",    "matched": true,    "matchedKeys": [      "string"    ],    "target": {      "agentId": "string",      "name": "string"    }  }}