POST /generations/{id}/cancel

取消一个生成中或排队中的题目生成任务。

Path parameters

  • id string Required

    Format should match the following pattern: ^gen-.

Responses

  • 200 application/json

    generation cancelled

    Hide response attributes Show response attributes object
    • object string

      Value is generation.

    • data object
      Hide data attributes Show data attributes object
      • id string

        Format should match the following pattern: ^gen-.

      • object string

        Value is generation.

      • created_at string(date-time)
      • finished_at string(date-time) | null
      • status string

        Values are queued, generating, succeeded, failed, or cancelled.

  • 400 application/json

    generation is already finished

  • 404 application/json

    generation not found

POST /generations/{id}/cancel
curl \
 --request POST 'https://v5.jinshuju.net/exam/api/generations/{id}/cancel' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "id": "gen-679210fce88e5ddf0d5b89de",
  "object": "generation",
  "status": "cancelled",
  "created_at": "2025-01-23T17:50:52.435+08:00",
  "finished_at": null
}
Response examples (400)
{
  "error": {
    "type": "invalid_request_error",
    "message": "Generation is already finished"
  }
}
Response examples (404)
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such Generation object: gen-123"
  }
}