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

# 生成を停止

> テキスト生成メッセージ生成タスクを停止します。`streaming` モードでのみサポートされています。



## OpenAPI

````yaml /ja/api-reference/openapi_completion.json post /completion-messages/{task_id}/stop
openapi: 3.0.1
info:
  title: Completion アプリ API
  description: テキスト生成アプリケーションはセッションなしで動作し、翻訳、記事作成、要約 AI などに最適です。
  version: 1.0.0
servers:
  - url: https://{api_base_url}
    description: テキスト生成アプリ API のベース URL です。セルフホスト環境では、独自の API ベース URL に置き換えてください。
    variables:
      api_base_url:
        default: api.dify.ai/v1
        description: API ベース URL のホストとパス（`https://` を除く）。
security:
  - ApiKeyAuth: []
tags:
  - name: 完了メッセージ
    description: テキスト生成に関連する操作です。
  - name: ファイル操作
    description: ファイル管理に関連する操作です。
  - name: エンドユーザー
    description: エンドユーザー情報に関連する操作です。
  - name: メッセージフィードバック
    description: ユーザーフィードバックに関連する操作です。
  - name: 音声・テキスト変換
    description: テキスト読み上げと音声認識に関連する操作です。
  - name: アプリケーション設定
    description: アプリケーション設定と情報を取得する操作です。
paths:
  /completion-messages/{task_id}/stop:
    post:
      tags:
        - 完了メッセージ
      summary: 生成を停止
      description: テキスト生成メッセージ生成タスクを停止します。`streaming` モードでのみサポートされています。
      operationId: stopCompletionGenerationJp
      parameters:
        - name: task_id
          in: path
          required: true
          description: >-
            タスク ID です。[完了メッセージを送信](/api-reference/完了メッセージ/完了メッセージを送信) API
            のストリーミングチャンクレスポンスから取得できます。
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user
              properties:
                user:
                  type: string
                  description: ユーザー識別子。メッセージ送信インターフェースで渡された user と一致する必要があります。
            examples:
              example:
                summary: リクエスト例
                value:
                  user: abc-123
      responses:
        '200':
          $ref: '#/components/responses/SuccessResult'
        '400':
          description: '`app_unavailable` : アプリケーションが利用できないか、設定が正しくありません。'
          content:
            application/json:
              examples:
                app_unavailable:
                  summary: app_unavailable
                  value:
                    status: 400
                    code: app_unavailable
                    message: App unavailable, please check your app configurations.
components:
  responses:
    SuccessResult:
      description: 操作が成功しました。
      content:
        application/json:
          schema:
            type: object
            properties:
              result:
                type: string
                description: 結果ステータス。
          examples:
            success:
              summary: レスポンス例
              value:
                result: success
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        API Key 認証です。すべての API リクエストにおいて、`Authorization` HTTP ヘッダーに `Bearer `
        プレフィックスを付けた API Key を含めてください。例：`Authorization: Bearer {API_KEY}`。**API
        Key はサーバーサイドに保存し、クライアントサイドで共有・保存しないことを強く推奨します。API Key
        の漏洩は深刻な結果につながる可能性があります。**

````