CometAPI · Schema

CometAPI Chat Completion Response

Schema for a /chat/completions response from CometAPI (OpenAI-compatible).

AIAggregatorAudioChatEmbeddingsGenerative AIImagesLLMMulti-ModelOpenAI-CompatibleVideo

Properties

Name Type Description
id string
object string
model string
created integer Unix timestamp.
choices array
usage object
View JSON Schema on GitHub

JSON Schema

cometapi-chat-completion-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/cometapi/refs/heads/main/json-schema/cometapi-chat-completion-schema.json",
  "title": "CometAPI Chat Completion Response",
  "description": "Schema for a /chat/completions response from CometAPI (OpenAI-compatible).",
  "type": "object",
  "required": ["id", "model", "choices"],
  "properties": {
    "id": { "type": "string" },
    "object": {
      "type": "string",
      "const": "chat.completion"
    },
    "model": { "type": "string" },
    "created": {
      "type": "integer",
      "description": "Unix timestamp."
    },
    "choices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": { "type": "integer" },
          "message": {
            "type": "object",
            "properties": {
              "role": { "type": "string" },
              "content": { "type": "string" }
            }
          },
          "finish_reason": { "type": "string" }
        }
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "prompt_tokens": { "type": "integer" },
        "completion_tokens": { "type": "integer" },
        "total_tokens": { "type": "integer" }
      }
    }
  }
}