A BuildShip endpoint that calls CometAPI needs two contracts: the model response it consumes, and the application response it promises callers. I would keep those separate rather than expose the CometAPI node’s entire output as the backend API.
The official CometAPI BuildShip integration guide describes a REST API trigger, a CometAPI node or generic API Call node, secret-managed authentication, and output mapping. Its output-node and testing steps are the starting point for this design—not evidence that every model returns the same fields.
Put the boundary after the CometAPI call
For a text-generation endpoint, I would use this flow:
REST trigger → CometAPI call → extract and validate → application output
Keep the CometAPI key in BuildShip’s secret or credential storage, as the guide recommends. Before wiring the extraction step, check the installed node’s actual output schema and the current endpoint instructions. The guide was published in September 2025; a fresh reading does not prove that node names, UI labels, or endpoint details are unchanged.
The important mapping is from the selected CometAPI response to a field the application owns. For example, the backend could promise these two shapes:
{ "ok": true, "data": { "text": "Generated answer" }, "error": null }
{ "ok": false, "data": null, "error": { "code": "MODEL_OUTPUT_INVALID" } }
These are proposed application envelopes, not CometAPI response formats or documented error codes. The field path used to extract the answer must come from the actual node and selected response format; do not assume that a JSON-looking model answer and the node’s outer response are the same object.
Parse only where needed, extract the expected value, then validate it before returning success. For this example I would require text to be a non-empty string. If it is absent, null, or the wrong type, return the documented application error instead of coercing it into a plausible answer or forwarding the raw response. An upstream call failure should have a separate application error from a completed call whose output fails validation.
Test what callers receive
The guide includes a testing step. I would extend it with controlled fixtures at the mapping boundary:
| Input to the mapper | Expected application behavior |
|---|---|
| Expected text plus extra response metadata | Return only the promised success fields |
| Missing, null, or non-string answer | Return MODEL_OUTPUT_INVALID, never success |
| Malformed JSON where parsing is required | Return a controlled validation error, not a parser traceback |
| Failed CometAPI call | Return the separately documented upstream-failure response |
Check the final REST response body and chosen HTTP status as well as the node output. A successful call alone does not establish that callers received the promised contract. These are suggested tests, not reported results.
The tradeoff is an explicit adapter to maintain for the CometAPI node or API Call configuration you use. A model or node change can still require extraction changes and new tests; a stable envelope does not guarantee equivalent answer quality. But it gives that change a defined place to fail before it becomes a client-facing schema change.
For this CometAPI workflow, would you reject an invalid answer immediately, or expose a separately documented fallback result? I would avoid making a fallback indistinguishable from validated model output.