> ## 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 text completion (legacy)

> Legacy prompt endpoint. Adapts prompt to chat messages and delegates. No tool-calling or reasoning channel — tool_calls finish reasons map to stop. Prefer chat completions for new integrations.



## OpenAPI

````yaml /openapi.json post /v1/completions
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/completions:
    post:
      tags:
        - Completions
      summary: Create a text completion (legacy)
      description: >-
        Legacy prompt endpoint. Adapts prompt to chat messages and delegates. No
        tool-calling or reasoning channel — tool_calls finish reasons map to
        stop. Prefer chat completions for new integrations.
      operationId: createTextCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextCompletionRequest'
            example:
              model: glm-5.3-abliterated
              prompt: Write a tight system prompt.
      responses:
        '200':
          description: Text completion
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextCompletionResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    TextCompletionRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          examples:
            - glm-5.3-abliterated
        prompt:
          type:
            - string
            - array
          description: String or string array (joined with newline).
        max_tokens:
          type: integer
          description: >-
            When omitted: the model's max output, else its context window minus
            the prompt.
        stream:
          type: boolean
          default: false
      additionalProperties: true
    TextCompletionResponse:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
        - usage
      properties:
        id:
          type: string
        object:
          type: string
          examples:
            - text_completion
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              text:
                type: string
              finish_reason:
                type: string
        usage:
          type: object
          additionalProperties: true
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - type
          properties:
            code:
              type: string
              examples:
                - invalid_key
                - insufficient_credits
                - model_not_found
                - model_busy
                - model_warming
                - upstream_error
                - model_unavailable
            message:
              type: string
            type:
              type: string
              examples:
                - api_error
  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.