> ## Documentation Index
> Fetch the complete documentation index at: https://docs.refuseless.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a message (Anthropic Messages API)

> Anthropic Messages API translated onto the same models and billing as chat completions. Accepts `x-api-key` or a Bearer token. Use `stream: true` for Anthropic SSE events. Errors use the Anthropic error shape.



## OpenAPI

````yaml /openapi.json post /v1/messages
openapi: 3.1.0
info:
  title: Refuseless API
  version: 1.0.0
  description: >-
    OpenAI-compatible hosted inference for a named lineup of refusal-removed
    open weights.
servers:
  - url: https://api.refuseless.com
security:
  - bearerAuth: []
paths:
  /v1/messages:
    post:
      tags:
        - Completions
      summary: Create a message (Anthropic Messages API)
      description: >-
        Anthropic Messages API translated onto the same models and billing as
        chat completions. Accepts `x-api-key` or a Bearer token. Use `stream:
        true` for Anthropic SSE events. Errors use the Anthropic error shape.
      operationId: createMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessagesRequest'
            example:
              model: glm-5.3-abliterated
              max_tokens: 512
              messages:
                - role: user
                  content: Write a tight system prompt.
      responses:
        '200':
          description: Message object, or event stream when stream=true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageObject'
        '400':
          description: Missing model or invalid messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicError'
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicError'
        '404':
          description: Unknown model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicError'
        '429':
          description: Model busy or warming, or plan limit - honor retry-after
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicError'
        '503':
          description: Gateway or model unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicError'
components:
  schemas:
    MessagesRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          example: glm-5.3-abliterated
        messages:
          type: array
          items:
            $ref: '#/components/schemas/AnthropicMessage'
        system:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: true
        max_tokens:
          type: integer
          description: Output limit. Defaults to the model's max output.
        stream:
          type: boolean
          default: false
        temperature:
          type: number
        top_p:
          type: number
        top_k:
          type: integer
        stop_sequences:
          type: array
          items:
            type: string
          maxItems: 4
        tools:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              description:
                type: string
              input_schema:
                type: object
                additionalProperties: true
        tool_choice:
          type: object
          additionalProperties: true
        thinking:
          type: object
          properties:
            type:
              type: string
              enum:
                - enabled
                - disabled
                - adaptive
            budget_tokens:
              type: integer
        output_config:
          type: object
          properties:
            effort:
              type: string
              enum:
                - low
                - medium
                - high
                - xhigh
                - max
        reasoning_effort:
          type: string
          enum:
            - 'off'
            - low
            - high
            - max
    MessageObject:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          example: message
        role:
          type: string
          example: assistant
        model:
          type: string
        content:
          type: array
          items:
            type: object
            additionalProperties: true
        stop_reason:
          type: string
          enum:
            - end_turn
            - max_tokens
            - tool_use
        stop_sequence:
          type: string
          nullable: true
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            cache_read_input_tokens:
              type: integer
            cache_creation_input_tokens:
              type: integer
    AnthropicError:
      type: object
      properties:
        type:
          type: string
          example: error
        error:
          type: object
          properties:
            type:
              type: string
              example: invalid_request_error
            message:
              type: string
    AnthropicMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
        content:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: true
          description: >-
            String, or an array of text, image, document, tool_use, or
            tool_result blocks.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-default: YOUR_API_KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.