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

# Text generation

> Creates a completion for the provided prompt and parameters.



## OpenAPI

````yaml POST /v1/chat/completions
openapi: 3.0.0
info:
  title: ZeroBot API
  version: 1.0.0
  description: API reference for ZeroBot
servers:
  - url: https://api.zerobot.ai
security: []
paths:
  /v1/chat/completions:
    post:
      summary: Create a completion
      description: Creates a completion for the provided prompt and parameters.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                assistant_id:
                  type: string
                  description: The ID of the assistant to use to execute this run.
                thread_id:
                  type: string
                  description: The ID of the thread to use to execute this run.
                messages:
                  type: array
                  description: A list of messages to include in the completion request.
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        description: >-
                          The role of the message sender. Can be 'user' or
                          'assistant'.
                      content:
                        type: array
                        description: The content of the message.
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              description: >-
                                The type of content. Can be 'text' or
                                'image_url'.
                            text:
                              type: string
                              description: >-
                                The text content of the message, if type is
                                'text'.
                            image_url:
                              type: object
                              description: The image URL, if type is 'image_url'.
                              properties:
                                url:
                                  type: string
                                  description: The URL of the image.
                max_tokens:
                  type: integer
                  description: The maximum number of tokens to generate in the completion.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  completion:
                    type: object
                    description: A completion object.

````