Modellss Docs
  1. Chat API
  • Send Request
  • Model List and Price
  • Model APIs
    • Chat API
      • Chat
        POST
      • GPTs
        POST
      • gemini-pro
        POST
      • gpt-4-all(Image)
        POST
      • gpt-4-vision-preview
        POST
    • Chat Completions API
      • Chat Completions API
    • Image API
      • Midjourney
        • InsightFace task submission
          • Submit swap_face task
        • Task Submission
          • Perform Action
          • Submit Blend Task
          • Submit a Describe task
          • Submit a Imagine task
          • Submit Modal
          • Submit Shorten Task
        • Task Inquiry
          • Inquire about all tasks
          • Inquire about tasks based on a list of IDs
          • Paged query for tasks
          • Inquire about the task queue
          • Cancel task
          • Retrieve task with specified ID
          • Get the seed for the task image
      • DALL·E 3
      • Stable Diffusion
      • MJ Chat
      • gpt-4-all(generate images)
    • Embedding Vector Generation Interface (Embeddings)
      • Create Embeddings
    • Audio
      • Create transcription
      • Create translation
      • Text to speech
  • Help Center
    • FAQ
  • Schemas
    • Schemas
      • Blend提交参数
      • CheckActivationDTO
      • Describe提交参数
      • Discord账号
      • Filter
      • Imagine提交参数
      • Map«string,object»
      • Message«Discord账号»
      • Message«Map«string,object»»
      • Message«Void»
      • Message«string»
      • Modal提交参数
      • Option
      • Pageable
      • Page«Map«string,object»»
      • Page«任务»
      • Shorten提交参数
      • Sort
      • SwapFace提交参数
      • TaskQueryDTO
      • 任务
      • 任务查询参数
      • 变化任务提交参数
      • 变化任务提交参数-simple
      • 可执行按钮
      • 可执行按钮_1
      • 执行动作参数
      • 提交结果
      • 激活服务参数
      • 账号修改参数
      • 账号创建参数
      • 账号查询参数
      • 账号筛选条件
  1. Chat API

Chat

POST
/v1/chat/completions
Given a prompt, the model will return one or more predicted completions and can also provide the probabilities of alternative tokens at each position. This enables the creation of completions for the provided prompt and parameters, offering a tailored approach to generating responses based on specific inputs.

Request

Header Params

Body Params application/json

Example
{
  "model": "gpt-3.5-turbo",
  "messages": [{"role": "user", "content": "Hello!"}]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.modelless.co/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "gpt-3.5-turbo",
  "messages": [{"role": "user", "content": "Hello!"}]
}'

Responses

🟢200OK
application/json
Body

Example
{
    "id": "chatcmpl-123",
    "object": "chat.completion",
    "created": 1677652288,
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "\n\nHello there, how may I assist you today?"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 9,
        "completion_tokens": 12,
        "total_tokens": 21
    }
}
Modified at 2024-02-29 12:46:28
Previous
Model List and Price
Next
GPTs
Built with