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

# Create chat completion

> Follows the exact same API spec as `OpenAI's Chat API https://platform.openai.com/docs/api-reference/chat`

```bash
curl -X POST https://api.uncensoredgpt.ai/v1/chat/completions 
-H "Content-Type: application/json" 
-H "Authorization: Bearer $UNCENSOREDGPT_API_KEY" 
-d '{
    "model": "uncensoredgpt/qwen3.8-27b-uncensored",
    "messages": [
        {
            "role": "user",
            "content": "Hello!"
        }
    ]
}'
```



## OpenAPI

````yaml api-reference/openapi.json post /v1/chat/completions
openapi: 3.1.0
info:
  title: UncensoredGPT API
  description: >-
    Every UncensoredGPT model through a single, OpenAI-compatible endpoint.
    Create an API key in the [UncensoredGPT
    Console](https://console.uncensoredgpt.ai), point your code at this base
    URL, and pay per token.
  version: 1.0.0
servers:
  - url: https://api.uncensoredgpt.ai
security: []
tags:
  - name: Chat
    description: >-
      Create a chat response for a list of messages. Supports streaming, tool
      calling, and vision models.
  - name: Completions
    description: Generate a text continuation for a prompt (legacy completions format).
  - name: Embeddings
    description: >-
      Turn text into a vector representation for search, retrieval, and
      clustering.
  - name: Responses
    description: >-
      The Responses API: stateful generations with tool use, plus retrieval and
      deletion of past responses.
  - name: Models
    description: List and inspect the models available to your API key.
  - name: Moderations
    description: Classify text against usage policies.
  - name: Batches
    description: >-
      Submit batches of requests for asynchronous processing within 24 hours, at
      lower cost.
  - name: Files
    description: Upload and manage files, for example Batch input files.
  - name: Images
    description: Generate or edit images from a text prompt.
  - name: Messages
    description: >-
      Call models using the Anthropic Messages format, for code that already
      targets the Anthropic API.
paths:
  /v1/chat/completions:
    post:
      tags:
        - Chat
      summary: Chat Completion
      description: >-
        Follows the exact same API spec as `OpenAI's Chat API
        https://platform.openai.com/docs/api-reference/chat`


        ```bash

        curl -X POST https://api.uncensoredgpt.ai/v1/chat/completions 

        -H "Content-Type: application/json" 

        -H "Authorization: Bearer $UNCENSOREDGPT_API_KEY" 

        -d '{
            "model": "uncensoredgpt/qwen3.8-27b-uncensored",
            "messages": [
                {
                    "role": "user",
                    "content": "Hello!"
                }
            ]
        }'

        ```
      operationId: chat_completion_v1_chat_completions_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
              properties:
                model:
                  title: Model
                  type: string
                messages:
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/ChatCompletionUserMessage'
                      - $ref: '#/components/schemas/ChatCompletionAssistantMessage'
                      - $ref: '#/components/schemas/ChatCompletionToolMessage'
                      - $ref: '#/components/schemas/ChatCompletionSystemMessage'
                      - $ref: '#/components/schemas/ChatCompletionFunctionMessage'
                      - $ref: '#/components/schemas/ChatCompletionDeveloperMessage'
                  title: Messages
                  type: array
                  example:
                    - role: user
                      content: Hello, how are you?
                frequency_penalty:
                  anyOf:
                    - type: number
                    - type: 'null'
                  default: null
                  title: Frequency Penalty
                logit_bias:
                  anyOf:
                    - additionalProperties:
                        type: number
                      type: object
                    - type: 'null'
                  default: null
                  title: Logit Bias
                logprobs:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  default: null
                  title: Logprobs
                top_logprobs:
                  anyOf:
                    - type: integer
                    - type: 'null'
                  default: null
                  title: Top Logprobs
                max_tokens:
                  anyOf:
                    - type: integer
                    - type: 'null'
                  default: null
                  title: Max Tokens
                'n':
                  anyOf:
                    - type: integer
                    - type: 'null'
                  default: null
                  title: 'N'
                presence_penalty:
                  anyOf:
                    - type: number
                    - type: 'null'
                  default: null
                  title: Presence Penalty
                response_format:
                  anyOf:
                    - additionalProperties: true
                      type: object
                    - type: 'null'
                  default: null
                  title: Response Format
                seed:
                  anyOf:
                    - type: integer
                    - type: 'null'
                  default: null
                  title: Seed
                service_tier:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Service Tier
                stop:
                  anyOf:
                    - type: string
                    - items:
                        type: string
                      type: array
                    - type: 'null'
                  default: null
                  title: Stop
                stream_options:
                  anyOf:
                    - additionalProperties: true
                      type: object
                    - type: 'null'
                  default: null
                  title: Stream Options
                temperature:
                  anyOf:
                    - type: number
                    - type: 'null'
                  default: null
                  title: Temperature
                top_p:
                  anyOf:
                    - type: number
                    - type: 'null'
                  default: null
                  title: Top P
                tools:
                  anyOf:
                    - items:
                        additionalProperties: true
                        type: object
                      type: array
                    - type: 'null'
                  default: null
                  title: Tools
                tool_choice:
                  anyOf:
                    - type: string
                    - additionalProperties: true
                      type: object
                    - type: 'null'
                  default: null
                  title: Tool Choice
                parallel_tool_calls:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  default: null
                  title: Parallel Tool Calls
                function_call:
                  anyOf:
                    - type: string
                    - additionalProperties: true
                      type: object
                    - type: 'null'
                  default: null
                  title: Function Call
                functions:
                  anyOf:
                    - items:
                        additionalProperties: true
                        type: object
                      type: array
                    - type: 'null'
                  default: null
                  title: Functions
                user:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: User
                stream:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  default: null
                  title: Stream
                metadata:
                  anyOf:
                    - additionalProperties: true
                      type: object
                    - type: 'null'
                  default: null
                  title: Metadata
                guardrails:
                  anyOf:
                    - items:
                        type: string
                      type: array
                    - type: 'null'
                  default: null
                  title: Guardrails
                caching:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  default: null
                  title: Caching
                num_retries:
                  anyOf:
                    - type: integer
                    - type: 'null'
                  default: null
                  title: Num Retries
                context_window_fallback_dict:
                  anyOf:
                    - additionalProperties:
                        type: string
                      type: object
                    - type: 'null'
                  default: null
                  title: Context Window Fallback Dict
                fallbacks:
                  anyOf:
                    - items:
                        type: string
                      type: array
                    - type: 'null'
                  default: null
                  title: Fallbacks
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    ChatCompletionUserMessage:
      properties:
        role:
          const: user
          title: Role
          type: string
        content:
          anyOf:
            - type: string
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ChatCompletionTextObject'
                  - $ref: '#/components/schemas/ChatCompletionImageObject'
                  - $ref: '#/components/schemas/ChatCompletionAudioObject'
                  - $ref: '#/components/schemas/ChatCompletionDocumentObject'
                  - $ref: '#/components/schemas/ChatCompletionVideoObject'
                  - $ref: '#/components/schemas/ChatCompletionFileObject'
              type: array
          title: Content
        cache_control:
          $ref: '#/components/schemas/ChatCompletionCachedContent'
      required:
        - role
        - content
      title: ChatCompletionUserMessage
      type: object
    ChatCompletionAssistantMessage:
      properties:
        role:
          const: assistant
          title: Role
          type: string
        content:
          anyOf:
            - type: string
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ChatCompletionTextObject'
                  - $ref: '#/components/schemas/ChatCompletionThinkingBlock'
                  - $ref: '#/components/schemas/ChatCompletionRedactedThinkingBlock'
                  - $ref: '#/components/schemas/ChatCompletionImageObject'
              type: array
            - type: 'null'
          title: Content
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        tool_calls:
          anyOf:
            - items:
                $ref: '#/components/schemas/ChatCompletionAssistantToolCall'
              type: array
            - type: 'null'
          title: Tool Calls
        function_call:
          anyOf:
            - $ref: '#/components/schemas/ChatCompletionToolCallFunctionChunk'
            - type: 'null'
        reasoning_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning Content
        cache_control:
          $ref: '#/components/schemas/ChatCompletionCachedContent'
        thinking_blocks:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ChatCompletionThinkingBlock'
                  - $ref: '#/components/schemas/ChatCompletionRedactedThinkingBlock'
              type: array
            - type: 'null'
          title: Thinking Blocks
        reasoning_items:
          anyOf:
            - items:
                $ref: '#/components/schemas/ChatCompletionReasoningItem'
              type: array
            - type: 'null'
          title: Reasoning Items
      required:
        - role
      title: ChatCompletionAssistantMessage
      type: object
    ChatCompletionToolMessage:
      properties:
        role:
          const: tool
          title: Role
          type: string
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/ChatCompletionTextObject'
              type: array
          title: Content
        tool_call_id:
          title: Tool Call Id
          type: string
      required:
        - role
        - content
        - tool_call_id
      title: ChatCompletionToolMessage
      type: object
    ChatCompletionSystemMessage:
      properties:
        role:
          const: system
          title: Role
          type: string
        content:
          anyOf:
            - type: string
            - items: {}
              type: array
          title: Content
        name:
          title: Name
          type: string
        cache_control:
          $ref: '#/components/schemas/ChatCompletionCachedContent'
      required:
        - role
        - content
      title: ChatCompletionSystemMessage
      type: object
    ChatCompletionFunctionMessage:
      properties:
        role:
          const: function
          title: Role
          type: string
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/ChatCompletionTextObject'
              type: array
            - type: 'null'
          title: Content
        name:
          title: Name
          type: string
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
      required:
        - role
        - content
        - name
        - tool_call_id
      title: ChatCompletionFunctionMessage
      type: object
    ChatCompletionDeveloperMessage:
      properties:
        role:
          const: developer
          title: Role
          type: string
        content:
          anyOf:
            - type: string
            - items: {}
              type: array
          title: Content
        name:
          title: Name
          type: string
        cache_control:
          $ref: '#/components/schemas/ChatCompletionCachedContent'
      required:
        - role
        - content
      title: ChatCompletionDeveloperMessage
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChatCompletionTextObject:
      properties:
        type:
          const: text
          title: Type
          type: string
        text:
          title: Text
          type: string
        cache_control:
          $ref: '#/components/schemas/ChatCompletionCachedContent'
      required:
        - type
        - text
      title: ChatCompletionTextObject
      type: object
    ChatCompletionImageObject:
      properties:
        type:
          const: image_url
          title: Type
          type: string
        image_url:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ChatCompletionImageUrlObject'
          title: Image Url
      required:
        - type
        - image_url
      title: ChatCompletionImageObject
      type: object
    ChatCompletionAudioObject:
      properties:
        input_audio:
          $ref: '#/components/schemas/InputAudio'
        type:
          const: input_audio
          title: Type
          type: string
      required:
        - input_audio
        - type
      title: ChatCompletionAudioObject
      type: object
    ChatCompletionDocumentObject:
      properties:
        type:
          const: document
          title: Type
          type: string
        source:
          $ref: '#/components/schemas/DocumentObject'
        title:
          title: Title
          type: string
        context:
          title: Context
          type: string
        citations:
          anyOf:
            - $ref: '#/components/schemas/CitationsObject'
            - type: 'null'
      required:
        - type
        - source
        - title
        - context
        - citations
      title: ChatCompletionDocumentObject
      type: object
    ChatCompletionVideoObject:
      properties:
        type:
          const: video_url
          title: Type
          type: string
        video_url:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ChatCompletionVideoUrlObject'
          title: Video Url
      required:
        - type
        - video_url
      title: ChatCompletionVideoObject
      type: object
    ChatCompletionFileObject:
      properties:
        type:
          const: file
          title: Type
          type: string
        file:
          $ref: '#/components/schemas/ChatCompletionFileObjectFile'
      required:
        - type
        - file
      title: ChatCompletionFileObject
      type: object
    ChatCompletionCachedContent:
      properties:
        type:
          const: ephemeral
          title: Type
          type: string
        ttl:
          enum:
            - 5m
            - 1h
          title: Ttl
          type: string
      required:
        - type
      title: ChatCompletionCachedContent
      type: object
    ChatCompletionThinkingBlock:
      properties:
        type:
          const: thinking
          title: Type
          type: string
        thinking:
          title: Thinking
          type: string
        signature:
          anyOf:
            - type: string
            - type: 'null'
          title: Signature
        cache_control:
          anyOf:
            - additionalProperties: true
              type: object
            - $ref: '#/components/schemas/ChatCompletionCachedContent'
            - type: 'null'
          title: Cache Control
      required:
        - type
      title: ChatCompletionThinkingBlock
      type: object
    ChatCompletionRedactedThinkingBlock:
      properties:
        type:
          const: redacted_thinking
          title: Type
          type: string
        data:
          title: Data
          type: string
        cache_control:
          anyOf:
            - additionalProperties: true
              type: object
            - $ref: '#/components/schemas/ChatCompletionCachedContent'
            - type: 'null'
          title: Cache Control
      required:
        - type
      title: ChatCompletionRedactedThinkingBlock
      type: object
    ChatCompletionAssistantToolCall:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        type:
          const: function
          title: Type
          type: string
        function:
          $ref: '#/components/schemas/ChatCompletionToolCallFunctionChunk'
      required:
        - id
        - type
        - function
      title: ChatCompletionAssistantToolCall
      type: object
    ChatCompletionToolCallFunctionChunk:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        arguments:
          title: Arguments
          type: string
        provider_specific_fields:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Provider Specific Fields
      title: ChatCompletionToolCallFunctionChunk
      type: object
    ChatCompletionReasoningItem:
      description: >-
        Represents an OpenAI Responses API reasoning item for round-tripping in
        conversation history.
      properties:
        type:
          const: reasoning
          title: Type
          type: string
        id:
          title: Id
          type: string
        encrypted_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Encrypted Content
        summary:
          items:
            $ref: '#/components/schemas/ChatCompletionReasoningSummaryTextBlock'
          title: Summary
          type: array
      required:
        - type
      title: ChatCompletionReasoningItem
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ChatCompletionImageUrlObject:
      properties:
        url:
          title: Url
          type: string
        detail:
          title: Detail
          type: string
        format:
          title: Format
          type: string
      required:
        - url
      title: ChatCompletionImageUrlObject
      type: object
    InputAudio:
      properties:
        data:
          title: Data
          type: string
        format:
          enum:
            - wav
            - mp3
          title: Format
          type: string
      required:
        - data
        - format
      title: InputAudio
      type: object
    DocumentObject:
      properties:
        type:
          const: text
          title: Type
          type: string
        media_type:
          title: Media Type
          type: string
        data:
          title: Data
          type: string
      required:
        - type
        - media_type
        - data
      title: DocumentObject
      type: object
    CitationsObject:
      properties:
        enabled:
          title: Enabled
          type: boolean
      required:
        - enabled
      title: CitationsObject
      type: object
    ChatCompletionVideoUrlObject:
      properties:
        url:
          title: Url
          type: string
        detail:
          title: Detail
          type: string
      required:
        - url
      title: ChatCompletionVideoUrlObject
      type: object
    ChatCompletionFileObjectFile:
      properties:
        file_data:
          title: File Data
          type: string
        file_id:
          title: File Id
          type: string
        filename:
          title: Filename
          type: string
        format:
          title: Format
          type: string
        detail:
          title: Detail
          type: string
        video_metadata:
          additionalProperties: true
          title: Video Metadata
          type: object
      title: ChatCompletionFileObjectFile
      type: object
    ChatCompletionReasoningSummaryTextBlock:
      properties:
        type:
          const: summary_text
          title: Type
          type: string
        text:
          title: Text
          type: string
      required:
        - type
      title: ChatCompletionReasoningSummaryTextBlock
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An UncensoredGPT API key created in the [UncensoredGPT
        Console](https://console.uncensoredgpt.ai).

````

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