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

# Create chat completion

> Creates a model response for the given chat conversation



## OpenAPI

````yaml /openapi.json post /chat/completions
openapi: 3.0.3
info:
  title: AnyAPI API
  description: >-
    Universal API Integration Platform - Connect any API to any API with
    intelligent data transformation and workflow orchestration.
  version: 1.0.0
  contact:
    name: AnyAPI Support
    email: support@anyapi.ai
    url: https://anyapi.ai/support
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.anyapi.ai/v1
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Text
    description: Generate text completions
  - name: Images
    description: Generate and manipulate images
  - name: Audio
    description: Generate speech and transcribe audio
  - name: Music
    description: List and retrieve model information
  - name: Video
    description: Create vector embeddings for text
  - name: Vision
    description: Create vector embeddings for text
  - name: 3D Models
    description: Create vector embeddings for text
  - name: Embeddings
    description: Create vector embeddings for text
  - name: Batches
    description: Batches
  - name: Moderation
    description: Moderation
  - name: Other
    description: Other models
paths:
  /chat/completions:
    post:
      tags:
        - Text
      summary: Create chat completion
      description: Creates a model response for the given chat conversation
      operationId: createChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChatCompletionRequest'
            examples:
              Base request:
                summary: Base request
                description: >-
                  Minimal request with mandatory parameters. Used for simple
                  questions without additional settings.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Sample text goes here
              With a system prompt:
                summary: With a system prompt
                description: >-
                  Adds a system message that sets the behavior and context for
                  the assistant throughout the dialogue.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: system
                      content: You are a helpful assistant.
                    - role: user
                      content: What is the capital of France?
              Multi-message conversation:
                summary: A multi-message conversation
                description: >-
                  Presents a history of dialogue with multiple messages from the
                  user and assistant for contextual communication.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: system
                      content: You are a helpful assistant.
                    - role: user
                      content: What is the capital of France?
                    - role: assistant
                      content: The capital of France is Paris.
                    - role: user
                      content: What is its population?
              With temperature and token settings:
                summary: With temperature and token settings
                description: >-
                  Adjusting the creativity of the response (temperature),
                  maximum length (max_tokens), and other sampling parameters to
                  control the quality of the generation.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Write a creative story about a robot.
                  temperature: 0.7
                  max_tokens: 500
                  top_p: 1
                  frequency_penalty: 0
                  presence_penalty: 0
              Streaming response:
                summary: Streaming response
                description: >-
                  Includes streaming response transmission (as in ChatGPT),
                  where tokens arrive gradually rather than all at once.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Tell me a story.
                  stream: true
              Vision - URL:
                summary: Vision - URL
                description: >-
                  Sending an image via URL for analysis using the multimodal
                  GPT-4 Vision model.
                value:
                  model: google/gemini-2.5-pro
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: What's in this image?
                        - type: image_url
                          image_url:
                            url: https://example.com/image.jpg
                  max_tokens: 300
              Vision base64:
                summary: Vision base64
                description: >-
                  Sending an image in base64 format for analysis. Used when the
                  image is not available via URL or is stored locally.
                value:
                  model: mistralai/pixtral-12b
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: Describe this image
                        - type: image_url
                          image_url:
                            url: data:image/jpeg;base64,/9j/4AAQSkZJRg...
                            detail: high
              Function calling:
                summary: Function Calling - function definition
                description: >-
                  Defining the tools (functions) that the model can call to
                  obtain external data (e.g., weather, database).
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: What's the weather in Boston?
                  tools:
                    - type: function
                      function:
                        name: get_current_weather
                        description: Get the current weather in a given location
                        parameters:
                          type: object
                          properties:
                            location:
                              type: string
                              description: The city and state, e.g. San Francisco, CA
                            unit:
                              type: string
                              enum:
                                - celsius
                                - fahrenheit
                          required:
                            - location
                  tool_choice: auto
              Function call response:
                summary: With a response to Function Call
                description: >-
                  Continuation of the dialogue after the model has called the
                  function - transfer of the function execution result back to
                  the model.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: What's the weather in Boston?
                    - role: assistant
                      content: null
                      tool_calls:
                        - id: call_abc123
                          type: function
                          function:
                            name: get_current_weather
                            arguments: '{"location": "Boston, MA"}'
                    - role: tool
                      tool_call_id: call_abc123
                      content: >-
                        {"temperature": 22, "unit": "celsius", "description":
                        "Sunny"}
                  tools:
                    - type: function
                      function:
                        name: get_current_weather
                        description: Get the current weather
                        parameters:
                          type: object
                          properties:
                            location:
                              type: string
              JSON mode:
                summary: JSON Mode
                description: >-
                  Forces the model to return only valid JSON. Useful for parsing
                  structured data.
                value:
                  model: openai/gpt-4-turbo
                  messages:
                    - role: system
                      content: You are a helpful assistant designed to output JSON.
                    - role: user
                      content: >-
                        Extract the name and age from this text: 'John is 25
                        years old.'
                  response_format:
                    type: json_object
              Structured outputs:
                summary: Structured Outputs (JSON Schema)
                description: >-
                  Ensures that the response conforms to the exact JSON schema. A
                  stricter version of JSON Mode with structure validation.
                value:
                  model: openai/gpt-4o-2024-08-06
                  messages:
                    - role: user
                      content: >-
                        Extract user information from: 'John Doe, 30 years old,
                        john@example.com'
                  response_format:
                    type: json_schema
                    json_schema:
                      name: user_info
                      strict: true
                      schema:
                        type: object
                        properties:
                          name:
                            type: string
                          age:
                            type: number
                          email:
                            type: string
                        required:
                          - name
                          - age
                          - email
                        additionalProperties: false
              Logprobs:
                summary: With Probability Logging (logprobs)
                description: >-
                  Returns probabilities for each generated token. Useful for
                  analyzing model confidence.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Say hello
                  logprobs: true
                  top_logprobs: 2
              Multiple options:
                summary: With multiple options (n > 1)
                description: >-
                  Generates several alternative answers to a single query.
                  Useful for selecting the best option.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Write a tagline for an ice cream shop.
                  'n': 3
                  temperature: 0.9
              Stop sequences:
                summary: Stop sequences
                description: >-
                  Specifies character sequences at which generation should stop.
                  Useful for formatting.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: 'List three colors:'
                  stop:
                    - |+

                    - '4.'
                  max_tokens: 100
              Seed reproducibility:
                summary: With seed for reproducibility
                description: >-
                  Sets the seed for deterministic generation. With identical
                  parameters, it will produce the same result.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Generate a random story.
                  seed: 12345
                  temperature: 1
              UserId:
                summary: With user ID
                description: >-
                  Transmits the user ID for monitoring and preventing abuse.
                  Helps OpenAI track violations.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Sample text goes here
                  user: user-123456
              Parallel function calling:
                summary: Parallel Function Calling
                description: >-
                  Allows the model to call multiple functions simultaneously in
                  a single response for efficiency.
                value:
                  model: openai/gpt-4-turbo
                  messages:
                    - role: user
                      content: What's the weather in Boston and New York?
                  tools:
                    - type: function
                      function:
                        name: get_current_weather
                        description: Get weather
                        parameters:
                          type: object
                          properties:
                            location:
                              type: string
                          required:
                            - location
                  parallel_tool_calls: true
              o1 models:
                summary: O1 models (reasoning)
                description: >-
                  Using O1 models with advanced reasoning capabilities for
                  complex tasks (mathematics, logic).
                value:
                  model: openai/o1
                  messages:
                    - role: user
                      content: >-
                        Solve this complex math problem: Find the integral of
                        x^2 * e^x dx
                  max_completion_tokens: 5000
              Audio input (base):
                summary: Audio input (base)
                description: >-
                  Sending audio to a model for transcription or voice analysis.
                  Audio is encoded in base64.
                value:
                  model: google/gemini-2.5-pro
                  modalities:
                    - text
                    - audio
                  audio:
                    voice: alloy
                    format: wav
                  messages:
                    - role: user
                      content:
                        - type: input_audio
                          input_audio:
                            data: base64_encoded_audio_data_here...
                            format: wav
              Audio input + text:
                summary: Audio input + text
                description: >-
                  A combination of text and audio in a single message for
                  multimodal interaction.
                value:
                  model: google/gemini-2.5-pro
                  modalities:
                    - text
                    - audio
                  audio:
                    voice: echo
                    format: mp3
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: 'Please transcribe and summarize this audio:'
                        - type: input_audio
                          input_audio:
                            data: base64_encoded_audio...
                            format: mp3
              Stream option:
                summary: Stream Options
                description: >-
                  Additional options for streaming mode, such as enabling token
                  usage information.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Hello
                  stream: true
                  stream_options:
                    include_usage: true
              Logit bias:
                summary: Logit Bias
                description: >-
                  Changes the probability of certain tokens appearing. Positive
                  values increase it, negative values decrease it.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Write a sentence
                  logit_bias:
                    '13': 10
                    '50256': -100
              Multiple images:
                summary: Multiple images in one post
                description: >-
                  Sending multiple images simultaneously for comparison or
                  comprehensive analysis.
                value:
                  model: google/gemini-2.5-pro
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: 'Compare these images:'
                        - type: image_url
                          image_url:
                            url: https://example.com/image1.jpg
                        - type: image_url
                          image_url:
                            url: https://example.com/image2.jpg
                        - type: image_url
                          image_url:
                            url: https://example.com/image3.jpg
                  max_tokens: 500
              Image detail level:
                summary: Image detail level
                description: >-
                  Control the level of detail in image analysis. 'high' -
                  detailed analysis, 'low' - quick overview.
                value:
                  model: google/gemini-2.5-pro
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: Analyze in detail
                        - type: image_url
                          image_url:
                            url: https://example.com/image.jpg
                            detail: high
              Tool choice (specific):
                summary: Tool Choice - Specific Function
                description: >-
                  Forced invocation of a specific function instead of automatic
                  selection by the model.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: What's the weather?
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: Get weather
                        parameters:
                          type: object
                          properties:
                            location:
                              type: string
                  tool_choice:
                    type: function
                    function:
                      name: get_weather
              Tool choice:
                summary: Tool Choice - none
                description: >-
                  Prohibition of using tools. The model must respond only with
                  text, even if functions are defined.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: What's the weather in Paris?
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: Get weather
                        parameters:
                          type: object
                          properties:
                            location:
                              type: string
                  tool_choice: none
              Tool choice (required):
                summary: Tool Choice - required
                description: >-
                  Requires the mandatory use of at least one tool. The model
                  cannot respond with text alone.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: What's the weather in Paris?
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: Get weather
                        parameters:
                          type: object
                          properties:
                            location:
                              type: string
                  tool_choice: required
              Multi-user chats:
                summary: Name in messages (multi-user chats)
                description: >-
                  Specifying the sender's name for group chats or dialogues with
                  multiple users.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: system
                      content: You are in a group chat
                    - role: user
                      name: Alice
                      content: Hello everyone!
                    - role: user
                      name: Bob
                      content: Hi Alice!
              Metadata:
                summary: Metadata
                description: >-
                  Arbitrary metadata for tracking and analytics. Does not affect
                  generation, used for organization.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Sample text goes here
                  metadata:
                    user_id: user_123
                    conversation_id: conv_456
                    custom_field: value
              Store:
                summary: Store (saving conversations)
                description: >-
                  Saving conversations for subsequent use in model training
                  (with user consent).
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Sample text goes here
                  store: true
              Reasoning effort:
                summary: Reasoning Effort (O1 models)
                description: >-
                  Control of 'thinking' time for O1 models. More effort = deeper
                  analysis, but slower.
                value:
                  model: openai/o1
                  messages:
                    - role: user
                      content: >-
                        Solve this complex problem: optimize the traveling
                        salesman for 20 cities
                  reasoning_effort: high
              Developer messages:
                summary: Developer Messages (O1)
                description: >-
                  Use the 'developer' role for system instructions in O1 models
                  (instead of 'system').
                value:
                  model: openai/o1
                  messages:
                    - role: developer
                      content: You are a helpful assistant.
                    - role: user
                      content: Hello
              Service tier:
                summary: Service Tier
                description: >-
                  Select the service level for prioritizing requests (default or
                  auto).
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Sample text goes here
                  service_tier: default
              Prediction (prompt caching):
                summary: Prediction (Prompt Caching)
                description: >-
                  Optimization for prompt caching. Continuation prediction to
                  speed up generation.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: >-
                        Continue this story: Once upon a time in a magical
                        forest...
                  prediction:
                    type: content
                    content: >-
                      There lived a wise old owl who knew all the secrets of the
                      woods.
              Parallel tool calls - disabled:
                summary: Parallel Tool Calls - disabled
                description: >-
                  Disable parallel function calls. The model will call functions
                  sequentially.
                value:
                  model: openai/gpt-4-turbo
                  messages:
                    - role: user
                      content: Get weather in Boston and New York
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: Get weather
                        parameters:
                          type: object
                          properties:
                            location:
                              type: string
                  parallel_tool_calls: false
              Refusal:
                summary: Refusal in assistant messages
                description: >-
                  A clear indication of the model's refusal in the previous
                  response to continue the dialogue.
                value:
                  model: openai/gpt-4
                  messages:
                    - role: user
                      content: Tell me how to hack
                    - role: assistant
                      refusal: I cannot help with that request.
                    - role: user
                      content: Okay, how about legal cybersecurity?
              All parameters:
                summary: Complex request - all parameters
                description: >-
                  Demonstration of the maximum number of parameters in a single
                  request for complete control over generation.
                value:
                  model: openai/gpt-4-turbo
                  messages:
                    - role: system
                      content: You are a helpful assistant.
                    - role: user
                      name: Alice
                      content: Help me with weather and calculations
                  temperature: 0.7
                  top_p: 0.9
                  max_tokens: 1000
                  'n': 1
                  stream: false
                  stop: null
                  presence_penalty: 0.1
                  frequency_penalty: 0.1
                  logit_bias: {}
                  user: user-12345
                  seed: 42
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: Get weather
                        parameters:
                          type: object
                          properties:
                            location:
                              type: string
                  tool_choice: auto
                  parallel_tool_calls: true
                  response_format:
                    type: text
                  metadata:
                    conversation_id: conv_789
                  store: false
              Structured outputs with description:
                summary: Structured Outputs with Description
                description: >-
                  JSON Schema with detailed description for precise control of
                  response structure with validation.
                value:
                  model: openai/gpt-4o-2024-08-06
                  messages:
                    - role: user
                      content: Calculate 15 * 27 step by step
                  response_format:
                    type: json_schema
                    json_schema:
                      name: math_response
                      description: A mathematical calculation response
                      strict: true
                      schema:
                        type: object
                        properties:
                          result:
                            type: number
                            description: The final answer
                          steps:
                            type: array
                            description: Step by step calculations
                            items:
                              type: string
                        required:
                          - result
                          - steps
                        additionalProperties: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateChatCompletionResponse'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/CreateChatCompletionStreamResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: ID of the model to use
          example:
            - openai/gpt-4.1
            - openai/gpt-5
        messages:
          type: array
          description: A list of messages comprising the conversation so far
          items:
            $ref: '#/components/schemas/ChatCompletionMessage'
          minItems: 1
        max_tokens:
          type: integer
          description: The maximum number of tokens to generate in the chat completion
          minimum: 1
          example: 300
        stream:
          type: boolean
          description: >-
            If set, partial message deltas will be sent as data-only server-sent
            events
          default: false
        tools:
          type: array
          description: A list of tools the model may call
          items:
            $ref: '#/components/schemas/ChatCompletionTool'
        tool_choice:
          oneOf:
            - type: string
              enum:
                - none
                - auto
              description: Controls which (if any) tool is called by the model
            - $ref: '#/components/schemas/ChatCompletionToolChoice'
          default: auto
        logprobs:
          type: boolean
          description: Whether to return log probabilities of the output tokens
          default: false
        top_logprobs:
          type: integer
          description: >-
            An integer between 0 and 20 specifying the number of most likely
            tokens to return at each token position
          minimum: 0
          maximum: 20
        modalities:
          type: array
          description: Output types the model should generate for this request
          items:
            type: string
            enum:
              - text
              - audio
        audio:
          type: object
          description: Parameters for audio output. Required when modalities includes audio
          properties:
            voice:
              type: string
              description: The voice to use for audio output
            format:
              type: string
              enum:
                - wav
                - mp3
              description: The output audio format
    CreateChatCompletionResponse:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
          description: A unique identifier for the chat completion
        object:
          type: string
          enum:
            - chat.completion
        created:
          type: integer
          description: >-
            The Unix timestamp (in seconds) of when the chat completion was
            created
        model:
          type: string
          description: The model used for the chat completion
        choices:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionChoice'
        usage:
          $ref: '#/components/schemas/CompletionUsage'
        system_fingerprint:
          type: string
          description: >-
            This fingerprint represents the backend configuration that the model
            runs with
    CreateChatCompletionStreamResponse:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
          description: A unique identifier for the chat completion
        object:
          type: string
          enum:
            - chat.completion.chunk
        created:
          type: integer
          description: >-
            The Unix timestamp (in seconds) of when the chat completion was
            created
        model:
          type: string
          description: The model used for the chat completion
        choices:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionStreamChoice'
        system_fingerprint:
          type: string
          description: >-
            This fingerprint represents the backend configuration that the model
            runs with
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              description: A human-readable error message
            type:
              type: string
              description: The type of error
            code:
              type: string
              description: An error code identifying the error type
    ChatCompletionMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - developer
            - tool
          description: The role of the messages author
        content:
          oneOf:
            - type: string
              description: The contents of the message
            - type: array
              description: An array of content parts with a defined type
              items:
                $ref: '#/components/schemas/ChatCompletionMessageContentPart'
        name:
          type: string
          description: An optional name for the participant
        tool_calls:
          type: array
          description: The tool calls generated by the model
          items:
            $ref: '#/components/schemas/ChatCompletionMessageToolCall'
        tool_call_id:
          type: string
          description: Tool call that this message is responding to
    ChatCompletionTool:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          enum:
            - function
        function:
          $ref: '#/components/schemas/FunctionDefinition'
    ChatCompletionToolChoice:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          enum:
            - function
        function:
          type: object
          required:
            - name
          properties:
            name:
              type: string
              description: The name of the function to call
    ChatCompletionChoice:
      type: object
      properties:
        index:
          type: integer
        message:
          $ref: '#/components/schemas/ChatCompletionResponseMessage'
        finish_reason:
          type: string
          enum:
            - stop
            - length
            - function_call
            - content_filter
      required:
        - index
        - message
        - finish_reason
    CompletionUsage:
      type: object
      properties:
        completion_tokens:
          type: integer
          description: Number of tokens in the generated completion
        prompt_tokens:
          type: integer
          description: Number of tokens in the prompt
        total_tokens:
          type: integer
          description: Total number of tokens used in the request
      required:
        - completion_tokens
        - prompt_tokens
        - total_tokens
    ChatCompletionStreamChoice:
      type: object
      required:
        - index
        - delta
      properties:
        index:
          type: integer
          description: The index of the choice in the list of choices
        delta:
          $ref: '#/components/schemas/ChatCompletionStreamChoiceDelta'
        finish_reason:
          type: string
          enum:
            - stop
            - length
            - tool_calls
            - content_filter
            - function_call
          description: The reason the model stopped generating tokens
        logprobs:
          $ref: '#/components/schemas/ChatCompletionLogprobs'
    ChatCompletionMessageContentPart:
      oneOf:
        - $ref: '#/components/schemas/ChatCompletionMessageContentPartText'
        - $ref: '#/components/schemas/ChatCompletionMessageContentPartImage'
        - $ref: '#/components/schemas/ChatCompletionMessageContentPartFile'
        - $ref: '#/components/schemas/ChatCompletionMessageContentPartInputAudio'
      discriminator:
        propertyName: type
        mapping:
          text:
            $ref: '#/components/schemas/ChatCompletionMessageContentPartText'
          image_url:
            $ref: '#/components/schemas/ChatCompletionMessageContentPartImage'
          file:
            $ref: '#/components/schemas/ChatCompletionMessageContentPartFile'
          input_audio:
            $ref: '#/components/schemas/ChatCompletionMessageContentPartInputAudio'
    ChatCompletionMessageToolCall:
      type: object
      required:
        - id
        - type
        - function
      properties:
        id:
          type: string
          description: The ID of the tool call
        type:
          type: string
          enum:
            - function
        function:
          type: object
          required:
            - name
            - arguments
          properties:
            name:
              type: string
              description: The name of the function to call
            arguments:
              type: string
              description: >-
                The arguments to call the function with, as generated by the
                model in JSON format
    FunctionDefinition:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: The name of the function to be called
        description:
          type: string
          description: A description of what the function does
        parameters:
          type: object
          description: >-
            The parameters the functions accepts, described as a JSON Schema
            object
    ChatCompletionResponseMessage:
      type: object
      properties:
        role:
          type: string
          enum:
            - assistant
        content:
          type: string
        function_call:
          $ref: '#/components/schemas/ChatCompletionMessageFunctionCall'
      required:
        - role
    ChatCompletionStreamChoiceDelta:
      type: object
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
            - tool
          description: The role of the author of this message
        content:
          type: string
          description: The contents of the chunk message
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionMessageToolCallChunk'
    ChatCompletionLogprobs:
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionTokenLogprob'
    ChatCompletionMessageContentPartText:
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
        text:
          type: string
          description: The text content
    ChatCompletionMessageContentPartImage:
      type: object
      required:
        - type
        - image_url
      properties:
        type:
          type: string
          enum:
            - image_url
        image_url:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
              description: Either a URL of the image or the base64 encoded image data
            detail:
              type: string
              enum:
                - auto
                - low
                - high
              description: Specifies the detail level of the image
              default: auto
    ChatCompletionMessageContentPartFile:
      type: object
      required:
        - type
        - file
      properties:
        type:
          type: string
          enum:
            - file
        file:
          type: object
          properties:
            file_data:
              type: string
              description: >-
                A base64-encoded data URL of the file (e.g.
                data:application/pdf;base64,...)
            file_id:
              type: string
              description: A public URL to the file
          description: >-
            Provide either file_data (base64 data URL) or file_id (public URL).
            Supported formats vary by model, e.g. PDF is broadly supported,
            while TXT/CSV/DOCX/XLSX support depends on the model.
    ChatCompletionMessageContentPartInputAudio:
      type: object
      required:
        - type
        - input_audio
      properties:
        type:
          type: string
          enum:
            - input_audio
        input_audio:
          type: object
          required:
            - data
            - format
          properties:
            data:
              type: string
              description: Base64-encoded audio data
            format:
              type: string
              enum:
                - wav
                - mp3
              description: The format of the encoded audio data
    ChatCompletionMessageFunctionCall:
      type: object
      properties:
        name:
          type: string
        arguments:
          type: string
      required:
        - name
        - arguments
    ChatCompletionMessageToolCallChunk:
      type: object
      required:
        - index
      properties:
        index:
          type: integer
          description: The index of the tool call in the tool calls array
        id:
          type: string
          description: The ID of the tool call
        type:
          type: string
          enum:
            - function
        function:
          type: object
          properties:
            name:
              type: string
              description: The name of the function to call
            arguments:
              type: string
              description: >-
                The arguments to call the function with, as generated by the
                model in JSON format
    ChatCompletionTokenLogprob:
      type: object
      required:
        - token
        - logprob
        - bytes
        - top_logprobs
      properties:
        token:
          type: string
          description: The token
        logprob:
          type: number
          description: The log probability of this token
        bytes:
          type: array
          items:
            type: integer
          description: >-
            A list of integers representing the UTF-8 bytes representation of
            the token
        top_logprobs:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionTopLogprob'
          description: List of the most likely tokens and their log probabilities
    ChatCompletionTopLogprob:
      type: object
      required:
        - token
        - logprob
        - bytes
      properties:
        token:
          type: string
          description: The token
        logprob:
          type: number
          description: The log probability of this token
        bytes:
          type: array
          items:
            type: integer
          description: >-
            A list of integers representing the UTF-8 bytes representation of
            the token
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Get your API key from the dashboard.

````