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

# Create message

> Generate using the Anthropic Messages protocol, as JSON or SSE. Requires inference:write. max_tokens is required. Native tool-use, thinking, image and hosted web-tool shapes are forwarded to the selected model.



## OpenAPI

````yaml /openapi.json post /v1/messages
openapi: 3.1.0
info:
  title: Limitless API
  version: 0.2.0
  description: >-
    Customer inference, scoped organization administration, policies, and health
    probes for Limitless at https://trylimitless.ai. This deployment uses
    sandbox credits and test payments but sends real inference requests. Model
    features depend on the active backend. The OpenAI SDK base URL is
    https://trylimitless.ai/v1.
servers:
  - url: https://trylimitless.ai
    description: >-
      Limitless sandbox API: test payments and real inference. OpenAI SDK
      clients add /v1 to this origin.
security:
  - customerKey: []
tags:
  - name: Health
  - name: Models
  - name: Inference
  - name: Credits
  - name: Organization
  - name: Projects
  - name: Project keys
  - name: Admin keys
  - name: Spending limits
  - name: Reports
  - name: Policies
paths:
  /v1/messages:
    post:
      tags:
        - Inference
      summary: Create message
      description: >-
        Generate using the Anthropic Messages protocol, as JSON or SSE. Requires
        inference:write. max_tokens is required. Native tool-use, thinking,
        image and hosted web-tool shapes are forwarded to the selected model.
      operationId: createMessage
      parameters:
        - name: anthropic-version
          in: header
          required: false
          schema:
            type: string
            default: '2023-06-01'
          description: Messages protocol version.
        - name: anthropic-beta
          in: header
          required: false
          schema:
            type: string
            maxLength: 512
          description: Model-supported beta protocol flags.
        - name: X-Limitless-Session-ID
          in: header
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 512
          description: >-
            Optional cache-affinity hint, isolated to this organization and
            project. X-Abliteration-Session-ID is accepted for compatibility.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnthropicMessagesRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesResponse'
            text/event-stream:
              schema:
                type: string
                description: >-
                  SSE records emitted when stream=true. Parse this endpoint’s
                  native event format; network chunks can split events.
          description: Successful response.
          headers:
            X-Request-ID:
              description: Gateway request ID for Activity and support.
              schema:
                type: string
                format: uuid
        '400':
          $ref: '#/components/responses/Messages400'
        '401':
          $ref: '#/components/responses/Messages401'
        '402':
          $ref: '#/components/responses/Messages402'
        '403':
          $ref: '#/components/responses/Messages403'
        '404':
          $ref: '#/components/responses/Messages404'
        '409':
          $ref: '#/components/responses/Messages409'
        '413':
          $ref: '#/components/responses/Messages413'
        '415':
          $ref: '#/components/responses/Messages415'
        '422':
          $ref: '#/components/responses/Messages422'
        '429':
          $ref: '#/components/responses/Messages429'
        '500':
          $ref: '#/components/responses/Messages500'
        '502':
          $ref: '#/components/responses/Messages502'
        '503':
          $ref: '#/components/responses/Messages503'
        '504':
          $ref: '#/components/responses/Messages504'
      security:
        - customerKey: []
        - customerHeaderKey: []
components:
  schemas:
    AnthropicMessagesRequest:
      properties:
        model:
          type: string
          minLength: 1
          maxLength: 200
        max_tokens:
          type: integer
          maximum: 999990
          minimum: 1
          description: >-
            Positive output bound; limited by the model’s configured maximum.
            Chat/Responses default to 1,024 when omitted. Send exactly one
            output-bound field.
        messages:
          items:
            $ref: '#/components/schemas/AnthropicMessage'
          type: array
          minItems: 1
        system:
          anyOf:
            - type: string
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
        stream:
          type: boolean
          default: false
        temperature:
          anyOf:
            - type: number
            - type: 'null'
        top_p:
          anyOf:
            - type: number
            - type: 'null'
        top_k:
          anyOf:
            - type: integer
            - type: 'null'
        stop_sequences:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
        tools:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: >-
            Chat: function tools. Responses: functions and supported web_search
            aliases. Messages: custom functions, web_search_2025_03_05 and
            web_fetch_2025_03_05. See the tools guide.
        tool_choice:
          anyOf:
            - $ref: '#/components/schemas/AnthropicToolChoice'
            - type: 'null'
        thinking:
          anyOf:
            - $ref: '#/components/schemas/AnthropicThinking'
            - type: 'null'
        output_config:
          anyOf:
            - $ref: '#/components/schemas/AnthropicOutputConfig'
            - type: 'null'
        context_management:
          anyOf:
            - $ref: '#/components/schemas/AnthropicContextManagement'
            - type: 'null'
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
        service_tier:
          anyOf:
            - type: string
              enum:
                - auto
                - standard_only
            - type: 'null'
        policy_ids:
          items:
            type: string
            maxLength: 120
            minLength: 1
          type: array
          maxItems: 1000
          description: >-
            Published Limitless policy IDs. These add to automatically attached
            policies; provider IDs are not accepted.
      additionalProperties: false
      type: object
      required:
        - model
        - max_tokens
        - messages
      description: >-
        Model-dependent request fields. Read the compatibility guide for
        supported combinations and limits.
    AnthropicMessagesResponse:
      properties:
        id:
          type: string
          pattern: ^msg_
        type:
          type: string
          const: message
          default: message
        role:
          type: string
          const: assistant
          default: assistant
        content:
          items:
            additionalProperties: true
            type: object
          type: array
        model:
          type: string
        stop_reason:
          anyOf:
            - type: string
              enum:
                - end_turn
                - max_tokens
                - stop_sequence
                - tool_use
            - type: 'null'
        stop_sequence:
          anyOf:
            - type: string
            - type: 'null'
        usage:
          $ref: '#/components/schemas/AnthropicUsage'
      additionalProperties: true
      type: object
      required:
        - id
        - content
        - model
        - stop_reason
        - usage
    AnthropicMessage:
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - system
        content:
          anyOf:
            - type: string
            - items:
                additionalProperties: true
                type: object
              type: array
      additionalProperties: false
      type: object
      required:
        - role
        - content
    AnthropicToolChoice:
      properties:
        type:
          type: string
          enum:
            - auto
            - any
            - tool
            - none
        name:
          anyOf:
            - type: string
            - type: 'null'
        disable_parallel_tool_use:
          anyOf:
            - type: boolean
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - type
    AnthropicThinking:
      properties:
        type:
          type: string
          enum:
            - enabled
            - disabled
            - adaptive
        budget_tokens:
          anyOf:
            - type: integer
              maximum: 999990
              minimum: 1
            - type: 'null'
        display:
          anyOf:
            - type: string
              enum:
                - summarized
                - omitted
                - updates
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - type
    AnthropicOutputConfig:
      properties:
        effort:
          anyOf:
            - type: string
              enum:
                - minimal
                - low
                - medium
                - high
                - xhigh
                - max
                - ultracode
            - type: 'null'
        format:
          anyOf:
            - $ref: '#/components/schemas/AnthropicJsonOutputFormat'
            - type: 'null'
      additionalProperties: false
      type: object
    AnthropicContextManagement:
      properties:
        edits:
          items:
            $ref: '#/components/schemas/AnthropicClearThinkingContextEdit'
          type: array
          maxItems: 1
          minItems: 1
      additionalProperties: false
      type: object
      required:
        - edits
    AnthropicUsage:
      properties:
        input_tokens:
          type: integer
          minimum: 0
        output_tokens:
          type: integer
          minimum: 0
        cache_creation_input_tokens:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
        cache_read_input_tokens:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
      additionalProperties: true
      type: object
      required:
        - input_tokens
        - output_tokens
    AnthropicErrorResponse:
      type: object
      properties:
        type:
          type: string
          const: error
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - type
        - error
    AnthropicJsonOutputFormat:
      properties:
        type:
          type: string
          const: json_schema
        schema:
          additionalProperties: true
          type: object
      additionalProperties: false
      type: object
      required:
        - type
        - schema
    AnthropicClearThinkingContextEdit:
      properties:
        type:
          type: string
          const: clear_thinking_20251015
        keep:
          type: string
          const: all
      additionalProperties: false
      type: object
      required:
        - type
        - keep
    ErrorDetail:
      properties:
        code:
          type: string
        message:
          type: string
        type:
          type: string
          description: Error category; policy failures use policy_error.
        param:
          anyOf:
            - type: string
            - type: 'null'
        request_id:
          type: string
        doc_url:
          anyOf:
            - type: string
            - type: 'null'
      type: object
      required:
        - code
        - message
        - type
  responses:
    Messages400:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Request validation failed.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages401:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Missing or invalid credential.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages402:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Available credit or spending cap cannot cover admission.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages403:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Credential scope or policy denied this operation.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages404:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Resource or model not found in the caller’s organization.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages409:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Revision, state or idempotency conflict.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages413:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: JSON body exceeds the gateway size limit.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages415:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Send application/json.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages422:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Provider request validation failed.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages429:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Request rate or concurrency exceeded.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages500:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Unexpected gateway failure.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages502:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: Backend request failed.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages503:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
      description: A required service or configuration is unavailable.
      headers:
        X-Request-ID:
          description: Gateway request ID for Activity and support.
          schema:
            type: string
            format: uuid
    Messages504:
      description: Inference deadline exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnthropicErrorResponse'
  securitySchemes:
    customerKey:
      type: http
      scheme: bearer
      bearerFormat: lk_...
      description: >-
        Project customer key. Requires the permission for the requested
        endpoint.
    customerHeaderKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Alternative project-key header. Authorization takes precedence when both
        are supplied.

````

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