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

# Create a response

> Creates a response using the OpenAI Responses API format. Set stream: true for server-sent events.



## OpenAPI

````yaml https://api.abliteration.ai/openapi.json post /v1/responses
openapi: 3.0.3
info:
  title: abliteration.ai API
  version: '2026-04-14'
  description: >-
    OpenAI-compatible chat completions and responses APIs for abliteration.ai,
    plus Anthropic-compatible messages and Policy Gateway endpoints for
    enforcement, config, simulations, and audits.
  termsOfService: https://abliteration.ai/terms-of-service
  contact:
    email: help@abliteration.ai
servers:
  - url: https://api.abliteration.ai
    description: Production
  - url: http://localhost:8080
    description: Local development
security: []
tags:
  - name: Chat Completions
    description: OpenAI-compatible chat completions.
  - name: Responses
    description: OpenAI-compatible Responses API.
  - name: Policy Gateway
    description: Policy-enforced chat completions.
  - name: Anthropic Messages
    description: Anthropic-compatible Messages API.
  - name: Models
    description: OpenAI-compatible model listing.
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: Create a response
      description: >-
        Creates a response using the OpenAI Responses API format. Set stream:
        true for server-sent events.
      operationId: createResponse
      parameters:
        - name: X-Free-Tier
          in: header
          description: Set to true to use the single anonymous free request.
          required: false
          schema:
            type: string
            enum:
              - 'true'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
            examples:
              basic:
                summary: Basic text request
                value:
                  model: abliterated-model
                  input: Write one sentence about Stonehenge.
              structured:
                summary: Structured multimodal request
                value:
                  model: abliterated-model
                  instructions: Answer in two sentences.
                  input:
                    - role: user
                      content:
                        - type: input_text
                          text: What is shown in this image?
                        - type: input_image
                          image_url: https://example.com/stonehenge.jpg
                  max_output_tokens: 256
              streaming:
                summary: Streaming request
                value:
                  model: abliterated-model
                  input: Stream a short greeting.
                  stream: true
      responses:
        '200':
          description: Responses API response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
              examples:
                success:
                  summary: 200 OK
                  value:
                    id: resp_abc123
                    object: response
                    created_at: 1735958400
                    status: completed
                    model: abliterated-model
                    output:
                      - id: msg_abc123
                        type: message
                        status: completed
                        role: assistant
                        content:
                          - type: output_text
                            text: >-
                              Stonehenge is a prehistoric monument in Wiltshire,
                              England.
                            annotations: []
                    usage:
                      input_tokens: 14
                      output_tokens: 10
                      total_tokens: 24
                    remaining_credits: 487
                    estimated_credits_used: 1
                    estimated_cost_usd: 0.00012
            text/event-stream:
              schema:
                type: string
                description: >-
                  Streaming response as server-sent events following the
                  Responses API event format.
              examples:
                stream:
                  summary: SSE stream
                  value: >
                    event: response.created

                    data:
                    {"type":"response.created","response":{"id":"resp_abc123","object":"response","status":"in_progress","model":"abliterated-model","output":[]}}


                    event: response.output_text.delta

                    data: {"type":"response.output_text.delta","delta":"Hello!"}


                    event: response.completed

                    data:
                    {"type":"response.completed","response":{"id":"resp_abc123","object":"response","status":"completed","model":"abliterated-model"}}
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Upstream unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    ResponsesRequest:
      type: object
      required:
        - model
      additionalProperties: true
      properties:
        model:
          type: string
          description: Model id.
        input:
          description: Plain text input or a structured Responses API input array.
          oneOf:
            - type: string
            - type: array
              items:
                oneOf:
                  - type: string
                  - $ref: '#/components/schemas/ResponsesInputItem'
        instructions:
          type: string
          description: Optional system-style instruction.
        stream:
          type: boolean
          default: false
        temperature:
          type: number
          minimum: 0
          maximum: 2
        max_output_tokens:
          type: integer
          minimum: 1
        tools:
          type: array
          description: >-
            Tool definitions passed through to the upstream Responses
            implementation.
          items:
            type: object
            additionalProperties: true
        tool_choice:
          description: Controls whether the model may call tools.
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
        flagged_categories:
          type: array
          description: >-
            Optional moderation categories to block for this request. Supported:
            harassment, hate, illicit, sexual. Self-harm and sexual/minors are
            always blocked.
          items:
            type: string
    ResponsesResponse:
      type: object
      required:
        - id
        - object
        - status
        - model
      additionalProperties: true
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - response
        created_at:
          type: integer
        status:
          type: string
        model:
          type: string
        output:
          type: array
          items:
            $ref: '#/components/schemas/ResponsesOutputItem'
        usage:
          $ref: '#/components/schemas/ResponsesUsage'
        remaining_credits:
          type: integer
          nullable: true
        estimated_credits_used:
          type: integer
        estimated_cost_usd:
          type: number
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        code:
          type: string
    ResponsesInputItem:
      type: object
      additionalProperties: true
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
            - tool
        content:
          description: Structured Responses input content.
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ResponsesInputContentPart'
    ResponsesOutputItem:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - message
        status:
          type: string
        role:
          type: string
          enum:
            - assistant
        content:
          type: array
          items:
            $ref: '#/components/schemas/ResponsesOutputContentPart'
    ResponsesUsage:
      type: object
      properties:
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        total_tokens:
          type: integer
    ResponsesInputContentPart:
      oneOf:
        - $ref: '#/components/schemas/ResponsesInputTextPart'
        - $ref: '#/components/schemas/ResponsesInputImagePart'
    ResponsesOutputContentPart:
      type: object
      additionalProperties: true
      properties:
        type:
          type: string
          enum:
            - output_text
        text:
          type: string
        annotations:
          type: array
          items:
            type: object
            additionalProperties: true
    ResponsesInputTextPart:
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - input_text
            - text
        text:
          type: string
    ResponsesInputImagePart:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - input_image
            - image_url
        image_url:
          description: Image URL as a string or object.
          oneOf:
            - type: string
              format: uri
            - $ref: '#/components/schemas/ImageUrl'
    ImageUrl:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
        detail:
          type: string
          enum:
            - low
            - high
            - auto
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use a JWT or abliteration.ai API key as a Bearer token.

````