CometAPI Chat API

Chat completions across LLM providers.

OpenAPI Specification

cometapi-chat-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: CometAPI Unified Audio Chat API
  description: CometAPI is an OpenAI-compatible aggregator that exposes a single REST surface for 500+ AI models from multiple vendors (OpenAI, Anthropic, Google, xAI, DeepSeek, Alibaba, and more). Endpoints follow OpenAI's request/response shapes for chat, embeddings, images, video, and speech, so existing OpenAI SDK clients can switch by changing only the base URL and API key.
  version: 1.0.0
  contact:
    name: CometAPI
    url: https://www.cometapi.com/
servers:
- url: https://api.cometapi.com/v1
  description: Production
security:
- bearerAuth: []
tags:
- name: Chat
  description: Chat completions across LLM providers.
paths:
  /chat/completions:
    post:
      operationId: createChatCompletion
      summary: Create chat completion
      description: Send a chat completion request to any supported LLM. The `model` field selects the upstream provider (e.g. `gpt-5.5`, `claude-4-7-opus`, `gemini-2.5-pro`, `deepseek-v4`).
      tags:
      - Chat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
      responses:
        '200':
          description: Completion response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
        '401':
          description: Invalid API key.
        '429':
          description: Rate limit or budget exceeded.
components:
  schemas:
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
        model:
          type: string
        created:
          type: integer
        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
    ChatCompletionRequest:
      type: object
      required:
      - model
      - messages
      properties:
        model:
          type: string
          description: Routing key for the upstream model.
          example: gpt-5.5
        messages:
          type: array
          items:
            type: object
            required:
            - role
            - content
            properties:
              role:
                type: string
                enum:
                - system
                - user
                - assistant
                - tool
              content:
                type: string
        stream:
          type: boolean
          default: false
        temperature:
          type: number
          minimum: 0
          maximum: 2
        max_tokens:
          type: integer
        tools:
          type: array
          items:
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
externalDocs:
  description: CometAPI Documentation
  url: https://apidoc.cometapi.com/