Felo API PlatformFelo API Platform
v0.3.0
OpenAPI 3.1.0

Create a chat completion

Сервер:https://openapi.felo.ai
Клиентские библиотеки

Create a chat completion

​

OpenAI-compatible Chat Completions API. Set stream=true to receive Server-Sent Events. The response and error envelope follow the Chat Completions/OpenAI-compatible shape.

Тело·ChatCompletionRequest
обязательно
application/json
  • messages
    Тип: array object[] · ChatMessage[] 1…
    обязательно
    • content
      может быть null
      обязательно
      • Тип: string
    • role
      Тип: string enum
      обязательно
      значения
      • system
      • developer
      • user
      • assistant
      • tool
    • name
      Тип: string
    • tool_call_id
      Тип: string
    • tool_calls
      Тип: array object[]
      • propertyName
        Тип: anything
    • propertyName
      Тип: anything
  • model
    Тип: string
    обязательно
  • max_completion_tokens
    Тип: integer
    мин.:  
    1

    Integer numbers.

  • max_tokens
    Тип: integer
    мин.:  
    1

    Integer numbers.

  • n
    Тип: integer
    мин.:  
    1

    Integer numbers.

  • response_format
    Тип: object
    • propertyName
      Тип: anything
  • stop
    может быть null
    • Тип: string
  • stream
    Тип: boolean
  • temperature
    Тип: number
    мин.:  
    0
  • tool_choice
    • Тип: string
  • tools
    Тип: array object[]
    • propertyName
      Тип: anything
  • top_p
    Тип: number
    мин.:  
    0
    макс.:  
    1
  • propertyName
    Тип: anything
  • user
    Тип: string
  • propertyName
    Тип: anything
Ответы
  • 200
    Тип: object · ChatCompletionResponse

    Chat completion or streaming response

    • choices
      Тип: array object[] · ChatChoice[]
      обязательно
      • finish_reason
        Тип: string | null
      • index
        Тип: integer

        Integer numbers.

      • logprobs
        Тип: object | null
        • propertyName
          Тип: anything
      • message
        Тип: object · ChatMessage
        • content
          может быть null
          обязательно
          • Тип: string
        • role
          Тип: string enum
          обязательно
          значения
          • system
          • developer
          • user
          • assistant
          • tool
        • name
          Тип: string
        • tool_call_id
          Тип: string
        • tool_calls
          Тип: array object[]
          • propertyName
            Тип: anything
        • propertyName
          Тип: anything
      • propertyName
        Тип: anything
    • id
      Тип: string
      обязательно
    • object
      Тип: string
      обязательно

      Usually chat.completion for non-streaming responses.

    • created
      Тип: integer Формат: int64

      Signed 64-bit integers (long type).

    • model
      Тип: string
    • system_fingerprint
      Тип: string
    • usage
      Тип: object · Usage

      Provider usage object. Fields vary by endpoint and provider.

      • propertyName
        Тип: anything
    • propertyName
      Тип: anything
  • 400
    Тип: object · OpenAIErrorResponse

    Invalid request, model, or provider mapping

    OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.

    • error
      Тип: object
      обязательно
      • message
        Тип: string
        обязательно
      • code
        Тип: string | null
      • param
        Тип: string | null
      • type
        Тип: string

        OpenAI-compatible error type when supplied.

      • propertyName
        Тип: anything
    • propertyName
      Тип: anything
    application/json
  • 401
    Тип: object · OpenAIErrorResponse

    Invalid or missing Felo API key

    OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.

    • error
      Тип: object
      обязательно
      • message
        Тип: string
        обязательно
      • code
        Тип: string | null
      • param
        Тип: string | null
      • type
        Тип: string

        OpenAI-compatible error type when supplied.

      • propertyName
        Тип: anything
    • propertyName
      Тип: anything
    application/json
  • 402
    Тип: object · OpenAIErrorResponse

    Insufficient balance

    OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.

    • error
      Тип: object
      обязательно
      • message
        Тип: string
        обязательно
      • code
        Тип: string | null
      • param
        Тип: string | null
      • type
        Тип: string

        OpenAI-compatible error type when supplied.

      • propertyName
        Тип: anything
    • propertyName
      Тип: anything
    application/json
  • 403
    Тип: object · OpenAIErrorResponse

    Account is not permitted to use the model. Disabled models are also rejected before upstream calls. Existing accepted requests and tasks continue.

    OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.

    • error
      Тип: object
      обязательно
      • message
        Тип: string
        обязательно
      • code
        Тип: string | null
      • param
        Тип: string | null
      • type
        Тип: string

        OpenAI-compatible error type when supplied.

      • propertyName
        Тип: anything
    • propertyName
      Тип: anything
    application/json
  • 429
    Тип: object · OpenAIErrorResponse

    Spending or request limit reached

    OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.

    • error
      Тип: object
      обязательно
      • message
        Тип: string
        обязательно
      • code
        Тип: string | null
      • param
        Тип: string | null
      • type
        Тип: string

        OpenAI-compatible error type when supplied.

      • propertyName
        Тип: anything
    • propertyName
      Тип: anything
    application/json
  • 502
    Тип: object · OpenAIErrorResponse

    Upstream provider request failed

    OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.

    • error
      Тип: object
      обязательно
      • message
        Тип: string
        обязательно
      • code
        Тип: string | null
      • param
        Тип: string | null
      • type
        Тип: string

        OpenAI-compatible error type when supplied.

      • propertyName
        Тип: anything
    • propertyName
      Тип: anything
    application/json
  • 503
    Тип: object · OpenAIErrorResponse

    Provider or billing service unavailable

    OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.

    • error
      Тип: object
      обязательно
      • message
        Тип: string
        обязательно
      • code
        Тип: string | null
      • param
        Тип: string | null
      • type
        Тип: string

        OpenAI-compatible error type when supplied.

      • propertyName
        Тип: anything
    • propertyName
      Тип: anything
    application/json
Request Example for post/api/v1/chat/completions
curl https://openapi.felo.ai/api/v1/chat/completions \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "model": "gpt-5.5",
  "messages": [
    {
      "role": "user",
      "content": "Write a one-sentence greeting."
    }
  ],
  "stream": false
}'
{
  "id": "string",
  "object": "string",
  "created": 1,
  "model": "string",
  "choices": [
    {
      "index": 1,
      "message": {
        "role": "system",
        "content": "string",
        "name": "string",
        "tool_call_id": "string",
        "tool_calls": [
          {
            "additionalProperty": "anything"
          }
        ],
        "additionalProperty": "anything"
      },
      "finish_reason": null,
      "logprobs": null,
      "additionalProperty": "anything"
    }
  ],
  "usage": {
    "additionalProperty": "anything"
  },
  "system_fingerprint": "string",
  "additionalProperty": "anything"
}
Create a chat completion