Last reviewed: 2026-06-14
Direct answer
CometAPI organises its text-generation surface into two main endpoint paths under a single base URL: the chat completions path at /api/text/chat and the responses path at /api/text/responses. A separate reference at /overview/models lists the model identifiers you can pass to either endpoint. Before writing integration code, you should confirm the current base URL, the authentication scheme, and the exact request and response field shapes in the official docs, because these details can change between releases.
The base URL is published on the CometAPI docs overview page at https://apidoc.cometapi.com/. All endpoint paths in this article are relative to that base URL. Do not hard-code the full host into your code without checking the docs first; verify it at the time of integration.
For broader release checks, see Validate CometAPI Chat Completions for Production.
Who this is for
This article is for backend engineers, integration architects, and technical leads who are:
- Scoping a new CometAPI integration and want an overview of the available endpoint families before reading individual reference pages.
- Running an endpoint audit to confirm that existing code still targets the correct paths and fields.
- Preparing a smoke-test plan to validate connectivity before handing off to a QA or staging environment.
If you are deciding whether to use the chat completions endpoint or the responses endpoint for a new project, see Choose between CometAPI Chat Completions and Responses.
Key takeaways
- CometAPI exposes a text-generation endpoint family under two documented paths: /api/text/chat and /api/text/responses. Confirm the exact host and any versioning prefix in the docs before deploying.
- The models reference at /overview/models is the authoritative source for currently supported model identifiers. Do not use model IDs sourced from third-party lists or older docs without cross-checking this page first.
- Both text endpoints share an OpenAI-compatible request structure according to CometAPI product positioning, but verify the exact field names, required fields, and response shape in each endpoint’s own reference page rather than assuming full parity.
- Authentication method, token format, and any required headers must be confirmed in the official docs. Do not hard-code assumptions about header names or token prefixes.
- A smoke test before cutover should exercise the happy path (a valid minimal request returning a non-empty response) and at least one error path (a missing or wrong auth credential). Log the HTTP status, a short outcome field, and the ISO-8601 timestamp for each test run.
Endpoint family overview
The base URL
The authoritative base URL for CometAPI API calls is published at the docs overview (https://apidoc.cometapi.com/). All paths below are relative to that base. Confirm the exact scheme, host, and any path prefix in the docs before writing configuration files.
Chat completions: /api/text/chat
The chat completions endpoint accepts a messages array and returns a completion. It follows a request shape that CometAPI describes as OpenAI-compatible. The exact required fields, optional parameters, and response envelope are documented at https://apidoc.cometapi.com/api/text/chat. Verify:
- The exact path, including any version prefix.
- The HTTP method (confirm POST or the method shown in the reference).
- The required request body fields (typically a model identifier and a messages array, but confirm field names).
- The response envelope field that carries the generated text.
- Any field that carries usage or token-count information, if you need it for cost accounting.
Responses endpoint: /api/text/responses
The responses endpoint is documented separately at https://apidoc.cometapi.com/api/text/responses. It may differ from the chat completions endpoint in request shape, response structure, or supported parameters. Before using it in production, read its reference page directly rather than inheriting assumptions from the chat completions docs. For a side-by-side comparison of when to choose each, see Choose between CometAPI Chat Completions and Responses.
Models reference: /overview/models
The models reference page at https://apidoc.cometapi.com/overview/models lists the model identifiers currently available through CometAPI. Use this page as the source of truth when selecting a model for your integration. Model availability, identifier strings, and capability flags can change; do not cache a model list from an earlier date without checking for updates.
OpenAI compatibility
CometAPI describes its API as OpenAI-compatible on the product homepage at https://www.cometapi.com/. Treat this as a statement of general compatibility direction rather than a guarantee of field-for-field parity. Verify each field you depend on in the CometAPI-specific reference pages before assuming an OpenAI SDK will work without configuration changes.
Smoke-test workflow
Setup assumptions
- You have a valid CometAPI API key stored as an environment variable (e.g. COMETAPI_KEY). Never embed real credentials in source code or test scripts.
- You know the current base URL from the docs overview and have set it as COMETAPI_BASE_URL in your environment.
- You have chosen a model identifier from the models reference and set it as COMETAPI_MODEL.
Happy-path request plan
Send a minimal POST to $COMETAPI_BASE_URL/api/text/chat with a short, low-token messages array (e.g. a single user turn asking for a one-word answer). Confirm:
- The HTTP status is 200.
- The response body is valid JSON.
- The response contains the field that carries the generated text (confirm field name in the docs).
- The generated text is non-empty and non-null.
Error-path check
Repeat the same request with a deliberately invalid or missing API key. Confirm:
- The HTTP status is in the 4xx range (the exact code is documented in the auth or error reference).
- The response body contains an error or message field.
- No generated content is returned.
Minimum assertions
- Happy path: status 200, response JSON parses without error, content field non-empty.
- Error path: status 4xx, no content field with generated text.
What the smoke test must not assert
- Do not assert on the exact wording, length, or semantic content of the generated text.
- Do not assert on specific latency thresholds, token counts, or pricing fields unless you have a contractual SLA to test against.
- Do not assert that a specific model identifier will remain available; always source model IDs from the current models reference.
Log record template (placeholder values only)
run_id: timestamp_utc: endpoint: /api/text/chat test_case: happy_path | error_path http_status: outcome: pass | fail notes: <brief human note, no credentials or full response bodies>
Record one row per test case per run. Do not log API keys, full request payloads, or full response bodies.
Failure modes
- Evidence gap: the agent 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 agent edits files that are not connected to the observed failure. Keep the repair tied to the failing signal and leave unrelated cleanup for a separate task.
- Environment mismatch: the local check uses different versions, credentials, feature flags, or runtime settings than the hosted path. Record the mismatch before treating the result as proof.
- Unreviewed fallback: the agent changes models, endpoints, permissions, or retry behavior to make a run pass without preserving the review boundary. Treat access and provider failures as operational blockers, not topic failures.
- Weak handoff: the final note says the issue is fixed but omits the command, result, changed files, and remaining uncertainty. That makes the next operator repeat the investigation.
Sources checked
- CometAPI documentation - accessed 2026-06-14; purpose: verify current CometAPI documentation navigation.
- CometAPI chat completions reference - accessed 2026-06-14; purpose: verify chat completion contract areas.
- CometAPI responses reference - accessed 2026-06-14; purpose: verify responses endpoint contract areas.
- CometAPI models overview - accessed 2026-06-14; purpose: verify model catalog discovery guidance.
- CometAPI homepage - accessed 2026-06-14; purpose: verify product positioning and canonical public site context.
Contract details to verify
| Area | What to verify | Source URL | Accessed | Safe candidate wording |
|---|---|---|---|---|
| Base URL | Exact HTTPS host and any path prefix for all API calls | https://apidoc.cometapi.com/ | 2026-06-14 | “The base URL shown in the CometAPI docs overview” |
| Authentication | Header name, token format, and prefix (e.g. Bearer or key=) | https://apidoc.cometapi.com/api/text/chat | 2026-06-14 | “Authentication method shown in the chat completions reference” |
| Chat completions path | Full path including any versioning, HTTP method | https://apidoc.cometapi.com/api/text/chat | 2026-06-14 | “The chat completions path documented at /api/text/chat” |
| Chat completions request fields | Required and optional body fields, field types, messages array shape | https://apidoc.cometapi.com/api/text/chat | 2026-06-14 | “Fields listed in the chat completions reference” |
| Chat completions response envelope | Field carrying generated text, usage fields, finish reason | https://apidoc.cometapi.com/api/text/chat | 2026-06-14 | “Response shape shown in the chat completions reference” |
| Responses endpoint path and method | Full path, HTTP method, whether it differs from chat completions | https://apidoc.cometapi.com/api/text/responses | 2026-06-14 | “The responses endpoint path documented at /api/text/responses” |
| Responses request/response shape | Whether fields match or differ from chat completions | https://apidoc.cometapi.com/api/text/responses | 2026-06-14 | “Field shape shown in the responses reference” |
| OpenAI compatibility scope | Which SDK methods or fields are covered vs. not covered | https://www.cometapi.com/ | 2026-06-14 | “Compatibility scope described on the CometAPI product homepage” |
Reader next step
Compare the workflow against Start with CometAPI.
Use How to Smoke-test the CometAPI Chat Completion Contract as the next comparison point. Keep Review a CometAPI chat completions contract nearby for setup and permission checks.
FAQ
Where do I find the exact base URL for CometAPI API requests? The base URL is published on the docs overview page at https://apidoc.cometapi.com/. Always confirm it there before setting it in configuration files or SDKs.
Are the chat completions and responses endpoints interchangeable? They are separate endpoints with potentially different request shapes and response fields. Read both reference pages before deciding which one your integration should use. The Choose between CometAPI Chat Completions and Responses guide covers the trade-offs in detail.
Can I use the OpenAI Python or Node SDK with CometAPI? CometAPI describes itself as OpenAI-compatible, but field-level parity must be verified in the CometAPI docs. You may need to set a custom base URL and confirm that the SDK parameters you use are supported. Check the chat completions reference and the product homepage for current compatibility notes.
How do I find out which model IDs are valid for my API key? Check the models reference at https://apidoc.cometapi.com/overview/models. Do not rely on model ID lists from older articles or third-party sources without cross-checking this page first.
What is the safest way to store the CometAPI base URL in my project? Store it as an environment variable (e.g. COMETAPI_BASE_URL) and read it at runtime. Avoid hard-coding the full host in source code so that future base-URL changes require only a config update.
What should I do if the smoke test returns an unexpected 4xx error on the happy path? Confirm the authentication header name and token format in the docs, verify the model identifier against the models reference, and check that your request body contains all required fields. Do not assume the field names match the OpenAI contract without verification.
Start with CometAPI