Felo API PlatformFelo API Platform
v0.4.0
OpenAPI 3.1.0

チャット補完を作成

サーバー:https://openapi.felo.ai
クライアントライブラリ

チャット補完を作成

​

OpenAI 互換の Chat Completions API です。stream=true を設定すると Server-Sent Events を受信します。レスポンスとエラーのエンベロープは Chat Completions / OpenAI 互換の形式に従います。

ヘッダー
  • X-Felo-Channel
    型: string

    カンマ区切りの公開チャンネルコード(順序どおり)。このヘッダーを省略すると default が使われ、default は単独でのみ使用できます。ウォレットモードでは、default はモデルの有効な公開チャンネル順を逆から走査し、未公開または利用不可のチャンネルをスキップして、最初に利用可能なチャンネルのプロバイダーを選択します。そのプロバイダーから、同じ上流モデル ID とサービスティアを持つ利用可能なエンドポイントを含めます。明示的なチャンネルはクライアントが指定した順序で検証され、最初のチャンネルのプロバイダーグループのみが送信されます。他のプロバイダーへの自動フォールバックはありません。従来のプロバイダーヘッダーでチャンネルルーティングを上書きすることはできません。

リクエストボディ·ChatCompletionRequest
必須
application/json
  • messages
    型: array object[] · ChatMessage[] 1…
    必須
    • content
      null 許容
      必須
      • 型: string
    • role
      型: string 列挙値
      必須
      値
      • 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
  • service_tier
    型: string | null

    現在は default(standard)のみをサポートしています。省略、null、エイリアス、未対応の文字列は default にフォールバックし、それ以外のタイプは HTTP 400 を返します。設定済みのチャンネルと料金は変わりません。テキスト API はプロバイダーの標準値を使用し、Decisions と生成 API は上流のフィールドを省略します。

  • stop
    null 許容
    • 型: string
  • stream
    型: boolean
  • temperature
    型: number
    最小値:  
    0
  • tool_choice
    • 型: string
  • tools
    型: array object[]
    • propertyName
      型: anything
  • propertyName
    型: anything
  • top_p
    型: number
    最小値:  
    0
    最大値:  
    1
  • user
    型: string
  • propertyName
    型: anything
レスポンス
  • 200
    型: object · ChatCompletionResponse

    チャット補完、またはストリーミングレスポンス

    • 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 列挙値
          必須
          値
          • 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
      必須

      非ストリーミングのレスポンスでは、通常 chat.completion です。

    • created
      型: integer 形式: int64

      Signed 64-bit integers (long type).

    • model
      型: string
    • system_fingerprint
      型: string
    • usage
      型: object · Usage

      プロバイダーの usage オブジェクト。フィールドはエンドポイントとプロバイダーによって異なります。

      • propertyName
        型: anything
    • propertyName
      型: anything
  • 400
    型: object · OpenAIErrorResponse

    無効なリクエスト、モデル、またはプロバイダーマッピング

    OpenAI 互換のエラーエンベロープ。Router は、上流の任意フィールドをすべて含めずに code と message を返す場合があります。

    • error
      型: object
      必須
      • message
        型: string
        必須
      • code
        型: string | null
      • param
        型: string | null
      • type
        型: string

        指定された場合の OpenAI 互換のエラータイプ。

      • propertyName
        型: anything
    • propertyName
      型: anything
    application/json
  • 401
    型: object · OpenAIErrorResponse

    Felo APIキーが無効または未指定です

    OpenAI 互換のエラーエンベロープ。Router は、上流の任意フィールドをすべて含めずに code と message を返す場合があります。

    • error
      型: object
      必須
      • message
        型: string
        必須
      • code
        型: string | null
      • param
        型: string | null
      • type
        型: string

        指定された場合の OpenAI 互換のエラータイプ。

      • propertyName
        型: anything
    • propertyName
      型: anything
    application/json
  • 402
    型: object · OpenAIErrorResponse

    残高不足

    OpenAI 互換のエラーエンベロープ。Router は、上流の任意フィールドをすべて含めずに code と message を返す場合があります。

    • error
      型: object
      必須
      • message
        型: string
        必須
      • code
        型: string | null
      • param
        型: string | null
      • type
        型: string

        指定された場合の OpenAI 互換のエラータイプ。

      • propertyName
        型: anything
    • propertyName
      型: anything
    application/json
  • 403
    型: object · OpenAIErrorResponse

    アカウントにこのモデルの使用権限がありません。無効化されたモデルも上流呼び出しの前に拒否されます。既に受け付けたリクエストとタスクは継続します。

    OpenAI 互換のエラーエンベロープ。Router は、上流の任意フィールドをすべて含めずに code と message を返す場合があります。

    • error
      型: object
      必須
      • message
        型: string
        必須
      • code
        型: string | null
      • param
        型: string | null
      • type
        型: string

        指定された場合の OpenAI 互換のエラータイプ。

      • propertyName
        型: anything
    • propertyName
      型: anything
    application/json
  • 429
    型: object · OpenAIErrorResponse

    支出上限またはリクエスト上限に達しました

    OpenAI 互換のエラーエンベロープ。Router は、上流の任意フィールドをすべて含めずに code と message を返す場合があります。

    • error
      型: object
      必須
      • message
        型: string
        必須
      • code
        型: string | null
      • param
        型: string | null
      • type
        型: string

        指定された場合の OpenAI 互換のエラータイプ。

      • propertyName
        型: anything
    • propertyName
      型: anything
    application/json
  • 502
    型: object · OpenAIErrorResponse

    上流プロバイダーへのリクエストに失敗しました

    OpenAI 互換のエラーエンベロープ。Router は、上流の任意フィールドをすべて含めずに code と message を返す場合があります。

    • error
      型: object
      必須
      • message
        型: string
        必須
      • code
        型: string | null
      • param
        型: string | null
      • type
        型: string

        指定された場合の OpenAI 互換のエラータイプ。

      • propertyName
        型: anything
    • propertyName
      型: anything
    application/json
  • 503
    型: object · OpenAIErrorResponse

    プロバイダーまたは請求サービスが利用できません

    OpenAI 互換のエラーエンベロープ。Router は、上流の任意フィールドをすべて含めずに code と message を返す場合があります。

    • error
      型: object
      必須
      • message
        型: string
        必須
      • code
        型: string | null
      • param
        型: string | null
      • type
        型: string

        指定された場合の OpenAI 互換のエラータイプ。

      • 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

ヘルプが必要ですか?

  • API・請求・アカウントのご質問はサポートへ。
  • Discord で Felo の開発者と交流できます。
  • 更新履歴 をご覧ください。
  • ボリューム価格や購買についてのご相談は営業窓口へ。
  • LLM での構築をお考えですか?llms.txt をご覧ください。