Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.clearmaas.com/llms.txt

Use this file to discover all available pages before exploring further.

POSTCreate a message

OpenAPI

/openapi.yaml post /messages
openapi: 3.1.0
info:
  title: ClearMaas API
  version: '2026.04'
  description: ClearMaas is an OpenAI-compatible API gateway.
  contact:
    name: ClearMaas Support
    email: support@clearmaas.com
    url: https://clearmaas.com
servers:
  - url: https://api.clearmaas.com/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /messages:
    post:
      tags:
        - Messages
      summary: Create a message
      operationId: createMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnthropicMessageRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessageResponse'
components:
  schemas:
    AnthropicMessageRequest:
      type: object
      required:
        - model
        - messages
        - max_tokens
      properties:
        model:
          type: string
          example: anthropic/claude-sonnet-4.6
        messages:
          type: array
          items:
            type: object
            required: [role, content]
            properties:
              role:
                type: string
                enum: [user, assistant]
              content:
                oneOf:
                  - type: string
                  - type: array
                    items:
                      type: object
        system:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
        max_tokens:
          type: integer
        stop_sequences:
          type: array
          items:
            type: string
        stream:
          type: boolean
        temperature:
          type: number
        top_p:
          type: number
        top_k:
          type: integer
        tools:
          type: array
          items:
            type: object
        tool_choice:
          type: object
        thinking:
          type: object
          properties:
            type:
              type: string
              enum: [enabled, disabled, adaptive]
            budget_tokens:
              type: integer
        metadata:
          type: object
    AnthropicMessageResponse:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum: [message]
        role:
          type: string
          enum: [assistant]
        content:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum: [text, tool_use, thinking]
              text:
                type: string
        model:
          type: string
        stop_reason:
          type: string
          enum: [end_turn, max_tokens, stop_sequence, tool_use]
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key (sk-clearmaas-...)
      description: Pass `Authorization: Bearer sk-clearmaas-...` header.