Last reviewed: 2026-07-14

Direct answer

Before you compare CometAPI Chat Completions with Responses, verify the chat message structure used by the request itself. The chat reference documents a messages array for multi-message conversations and lists roles including system, developer, user, assistant, and tool. That role check is its own step. First confirm that the request carries the right conversation turns, then compare whether Chat Completions or Responses is the better endpoint family for the workflow you are documenting.

This order prevents a common tutorial problem: a reader asks which endpoint to use, but the example has not yet shown how instructions, user turns, assistant history, and tool results fit into the chat request. When the role structure is clear, endpoint comparison becomes much easier. Chat Completions can be explained as the documented multi-message chat path, while Responses can be compared when the workflow needs the features documented on the Responses reference, such as stateful response chaining, tool-oriented response objects, or the endpoint families the docs recommend there.

A minimal smoke-test workflow should use a test account, a disposable key, a placeholder model value selected from the current CometAPI docs or dashboard, and non-sensitive prompt text. Use <API_KEY_PLACEHOLDER> in shared notes and never paste a live key into tickets, docs, examples, screenshots, or logs.

  1. Setup assumptions: the operator has a CometAPI account, an API key stored outside shared notes, a documented model value, and access to the current Chat Completions and Responses references.
  2. Happy-path request plan: send one non-sensitive chat request with a short messages array that includes an instruction message and a user message; record whether the response has a success status and a documented response shape.
  3. Error-path check: repeat the request with one required field intentionally omitted in a private test environment; record whether the error is structured enough for the client to handle without guessing.
  4. Minimum assertions: status category, response object shape, role handling, request id or trace field if present, and whether the client redacts credentials in logs.
  5. Pass/fail logging fields: run_id, docs_checked_at, endpoint_family, request_fixture_id, status_category, response_shape_observed, error_shape_observed, credential_redaction_checked, result, and follow_up.
  6. What not to assert: model availability, pricing, limits, latency, uptime, billing totals, or provider-specific behavior from this narrow role smoke test alone.

Sanitized request sketch:

{
  "authorization": "Bearer <API_KEY_PLACEHOLDER>",
  "endpoint_family": "chat-completions",
  "model": "<MODEL_ID>",
  "messages": [
    {"role": "developer", "content": "Keep the answer short and neutral."},
    {"role": "user", "content": "Reply with one safe test sentence."}
  ]
}

Sanitized log-record template:

{
  "run_id": "chat-role-smoke-YYYYMMDD-001",
  "docs_checked_at": "2026-07-14",
  "endpoint_family": "chat-completions",
  "request_fixture_id": "fixture-chat-roles-basic",
  "status_category": "2xx-or-documented-error",
  "response_shape_observed": "placeholder",
  "error_shape_observed": "placeholder",
  "credential_redaction_checked": true,
  "result": "pass-or-fail",
  "follow_up": "placeholder"
}

For a broader release checklist, see Validate CometAPI Chat Completions for Production . For a closer schema companion, see Chat Schema Notes for Tutorial Maintainers . When you are ready to test against CometAPI, use Start with CometAPI .

Who this is for

This guide is for tutorial authors, integration maintainers, and operators who need to explain CometAPI chat message roles without turning a role lesson into a premature endpoint comparison. It is especially useful when a team is reviewing examples that mix conversation history, tool results, and endpoint-selection advice.

It also helps reviewers who see an example that says “use Chat Completions” or “use Responses” before it explains the request shape. In that situation, do not start by debating endpoint preference. Start by checking whether the tutorial shows the reader what each message role is doing and whether the example uses only source-backed claims.

Key takeaways

  • Treat message roles as a request-structure topic before discussing endpoint selection.
  • Use the chat reference to verify which roles belong in the messages array and how conversation history is represented.
  • Use the Responses reference when comparing endpoint families or checking workflows that the Responses page documents.
  • Keep test prompts non-sensitive and keep credentials out of copied examples.
  • Record what the smoke test proves and what it does not prove.
  • Link role-focused tutorials to adjacent endpoint and production-readiness material so readers can continue in the right direction.

Sources checked

Contract details to verify

AreaWhat to verifySource URLAccessedSafe candidate wording
Chat endpoint familyConfirm the documented Chat Completions endpoint and request family before writing examples.https://apidoc.cometapi.com/api/text/chat2026-07-14“CometAPI documents Chat Completions for multi-message chat requests.”
Message rolesConfirm the role names and how each role is intended to appear in the messages array.https://apidoc.cometapi.com/api/text/chat2026-07-14“The chat reference lists role values for instructions, user turns, assistant history, and tool results; verify the exact role names before publishing code.”
Conversation historyConfirm how prior assistant and user turns should be represented.https://apidoc.cometapi.com/api/text/chat2026-07-14“Conversation history belongs in the documented message list, using the role values shown in the chat reference.”
Endpoint comparisonConfirm when the Responses endpoint is relevant before recommending an endpoint family.https://apidoc.cometapi.com/api/text/responses2026-07-14“Compare endpoint families only after the chat message structure is clear.”
Support pathConfirm the current help page before sending readers to support resources.https://apidoc.cometapi.com/support/help-center2026-07-14“Use the current help documentation for support and escalation details.”

Failure modes

  • Evidence gap: the team cannot inspect the failing log, source page, pull request, or local command output. The safe action is to stop and record the missing evidence instead of guessing.
  • Scope drift: the repair changes models, endpoints, retry behavior, or permissions when the actual issue is only unclear message-role structure. Keep the fix tied to the observed issue.
  • Environment mismatch: the local check uses different credentials, feature flags, account settings, or runtime configuration than the hosted path. Record the mismatch before treating the result as proof.
  • Role confusion: the tutorial uses a user message for durable developer instructions, omits assistant history that the example depends on, or shows a tool result without explaining the matching tool-call context.
  • Endpoint shortcut: the tutorial recommends Responses or Chat Completions before it explains what the request needs. Put request shape first, then endpoint choice.
  • Overclaiming: the article treats one successful role smoke test as proof of production readiness. A role smoke test is useful, but it does not prove cost, rate-limit behavior, reliability, or provider-specific support.
  • Weak handoff: the final note says the issue is fixed but omits the request fixture, result, changed files, and remaining uncertainty. That makes the next maintainer repeat the investigation.

Reader next step

Take one existing chat tutorial and mark every message role in the first request example. Confirm that the instruction message, user message, any prior assistant message, and any tool-result message each have a clear reason to exist. Then compare your marked request with the current CometAPI chat reference before you edit endpoint-selection wording.

If the example passes that role check, move to endpoint choice. Use How to Choose the Right CometAPI Endpoint for a Tutorial to decide whether the article should stay with Chat Completions or introduce Responses. If the example does not pass, repair the message structure first and rerun the small smoke test with redacted logs.

FAQ

Should a tutorial start with endpoint comparison or message roles?

Start with message roles when the reader is still learning how a chat request is shaped. Endpoint comparison is easier after the reader understands how conversation turns are represented.

Which role should hold durable instructions?

Use the role guidance in the current chat reference. The page distinguishes instruction roles such as system and developer from user, assistant, and tool messages. Do not convert old examples automatically; check the model family and the current documentation before changing public code.

Can I copy a model value from an old example?

Do not rely on old examples alone. Use a placeholder in public tutorial drafts and verify the model value against current CometAPI documentation or account tools before running a private test.

What should I log from a role smoke test?

Log the documentation access date, request fixture id, endpoint family, status category, observed response shape, observed error shape, credential-redaction result, and follow-up action. Avoid logging full prompts, full responses, credentials, prices, limits, or account-specific details.

Does a successful role smoke test prove production readiness?

No. It only checks a narrow request-structure path. Production readiness also needs source-backed checks for endpoint choice, errors, retries, observability, account configuration, and any provider-specific behavior your application depends on.