> ## Documentation Index
> Fetch the complete documentation index at: https://gomodel-docs-benchmark-writeup-and-tooling.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel a response



## OpenAPI

````yaml /openapi.json post /v1/responses/{id}/cancel
openapi: 3.0.0
info:
  description: >-
    AI gateway routing requests to multiple LLM providers (OpenAI, Anthropic,
    Gemini, Groq, OpenRouter, DeepSeek, Z.ai, xAI, MiniMax, Xiaomi MiMo,
    OpenCode Go, Oracle, Ollama, Bailian). Drop-in OpenAI-compatible API.
  title: GoModel API
  contact: {}
  version: '1.0'
servers:
  - url: '{base_url}'
    description: Edit the base URL to point at your GoModel deployment.
    variables:
      base_url:
        default: http://localhost:8080
        description: Your GoModel deployment URL
security: []
paths:
  /v1/responses/{id}/cancel:
    post:
      tags:
        - responses
      summary: Cancel a response
      parameters:
        - description: Response ID
          name: id
          in: path
          required: true
          schema:
            type: string
        - description: Provider override for native cancellation
          name: provider
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.ResponsesResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
      security:
        - BearerAuth: []
components:
  schemas:
    core.ResponsesResponse:
      type: object
      properties:
        created_at:
          type: integer
        error:
          $ref: '#/components/schemas/core.ResponsesError'
        id:
          type: string
        model:
          type: string
        object:
          description: '"response"'
          type: string
        output:
          type: array
          items:
            $ref: '#/components/schemas/core.ResponsesOutputItem'
        provider:
          type: string
        status:
          description: '"completed", "failed", "in_progress"'
          type: string
        usage:
          $ref: '#/components/schemas/core.ResponsesUsage'
    core.OpenAIErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/core.OpenAIErrorObject'
    core.ResponsesError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    core.ResponsesOutputItem:
      type: object
      properties:
        arguments:
          type: string
        call_id:
          type: string
        content:
          type: array
          items:
            $ref: '#/components/schemas/core.ResponsesContentItem'
        id:
          type: string
        name:
          type: string
        role:
          type: string
        status:
          type: string
        type:
          description: '"message", "function_call", etc.'
          type: string
    core.ResponsesUsage:
      type: object
      properties:
        completion_tokens_details:
          $ref: '#/components/schemas/core.CompletionTokensDetails'
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        prompt_tokens_details:
          $ref: '#/components/schemas/core.PromptTokensDetails'
        raw_usage:
          type: object
          additionalProperties: {}
        total_tokens:
          type: integer
    core.OpenAIErrorObject:
      type: object
      required:
        - code
        - message
        - param
        - type
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
        param:
          type: string
          nullable: true
        type:
          $ref: '#/components/schemas/core.ErrorType'
    core.ResponsesContentItem:
      type: object
      properties:
        annotations:
          description: |-
            Providers can return structured annotation objects here (for example
            citations from native tools), so keep the payload shape liberal.
          type: array
          items:
            type: object
        image_url:
          $ref: '#/components/schemas/core.ImageURLContent'
        input_audio:
          $ref: '#/components/schemas/core.InputAudioContent'
        text:
          type: string
        type:
          description: '"output_text", "input_image", "input_audio", etc.'
          type: string
    core.CompletionTokensDetails:
      type: object
      properties:
        accepted_prediction_tokens:
          type: integer
        audio_tokens:
          type: integer
        reasoning_tokens:
          type: integer
        rejected_prediction_tokens:
          type: integer
    core.PromptTokensDetails:
      type: object
      properties:
        audio_tokens:
          type: integer
        cached_tokens:
          type: integer
        image_tokens:
          type: integer
        text_tokens:
          type: integer
    core.ErrorType:
      type: string
      enum:
        - provider_error
        - rate_limit_error
        - invalid_request_error
        - authentication_error
        - not_found_error
      x-enum-varnames:
        - ErrorTypeProvider
        - ErrorTypeRateLimit
        - ErrorTypeInvalidRequest
        - ErrorTypeAuthentication
        - ErrorTypeNotFound
    core.ImageURLContent:
      type: object
      properties:
        detail:
          type: string
        media_type:
          type: string
        url:
          type: string
    core.InputAudioContent:
      type: object
      properties:
        data:
          type: string
        format:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````