OhMyGPT
Chat

Cancel stored response

POST
/v1/responses/{response_id}/cancel

Cancels a locally stored response while it is still in_progress. Completed, failed, incomplete, cancelled, deleted, nonexistent, and cross-tenant responses are not mutable through this endpoint.

授权

ApiKeyAuth
headerAuthorization<token>

路径参数

response_id*string

Response ID returned by POST /v1/responses.

响应主体

Cancelled stored response

application/json
  1. response
metadata*|null
prompt_cache_key?string

Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field. Learn more.

prompt_cache_retention?|null
safety_identifier?string

A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.

长度length <= 64
service_tier?|null
temperature*|null
top_logprobs?|null
top_p*|null
user?string已弃用

This field is being replaced by safety_identifier and prompt_cache_key. Use prompt_cache_key instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.

background?|null
max_output_tokens?|null
max_tool_calls?|null
model*||

Model ID used to generate the response, like gpt-4o or o3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and latency profiles. Refer to the model guide to browse and compare available models.

previous_response_id?|null
prompt?|null
reasoning?|null
text?

Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:

tool_choice*|||||||

How the model should select which tool (or tools) to use when generating a response. See the tools parameter to see how to specify which tools the model can call.

tools*array<|||||||||||>

An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter.

We support the following categories of tools:

  • Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
  • MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
  • Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
truncation?|null
completed_at?|null
conversation?|null
created_at*number

Unix timestamp (in seconds) of when this Response was created.

error*|null
id*string

Unique identifier for this Response.

incomplete_details*|null
instructions*|array<|||||||||||||||||||||||||>|null
object*"response"

The object type of this resource - always set to response.

值于"response"
output*array<|||||||||||||||||>

An array of content items generated by the model.

  • The length and order of items in the output array is dependent on the model's response.
  • Rather than accessing the first item in the output array and assuming it's an assistant message with the content generated by the model, you might consider using the output_text property where supported in SDKs.
output_text?|null
parallel_tool_calls*boolean

Whether to allow the model to run tool calls in parallel.

默认true
status?string

The status of the response generation. One of completed, failed, in_progress, cancelled, queued, or incomplete.

值于"completed""failed""in_progress""cancelled""queued""incomplete"
usage?

What this request cost. All amounts are in Credits, not USD.

provider?string

The provider that served the request.

示例请求
curl -X POST 'https://api.ohmygpt.com/v1/responses/string/cancel'
示例响应
{  "metadata": {    "property1": "string",    "property2": "string"  },  "prompt_cache_key": "string",  "prompt_cache_retention": "in-memory",  "safety_identifier": "string",  "service_tier": "auto",  "temperature": 1,  "top_logprobs": 0,  "top_p": 1,  "user": "string",  "background": false,  "max_output_tokens": 0,  "max_tool_calls": 0,  "model": "string",  "previous_response_id": "string",  "prompt": {    "id": "string",    "variables": {      "property1": "string",      "property2": "string"    },    "version": "string"  },  "reasoning": {    "effort": "none",    "generate_summary": "auto",    "summary": "auto"  },  "text": {    "format": {      "type": "text"    },    "verbosity": "low"  },  "tool_choice": "none",  "tools": [    {      "description": "string",      "name": "string",      "parameters": {        "property1": null,        "property2": null      },      "strict": true,      "type": "function"    }  ],  "truncation": "auto",  "completed_at": 0,  "conversation": null,  "created_at": 0,  "error": {    "code": "server_error",    "message": "string"  },  "id": "string",  "incomplete_details": {    "reason": "max_output_tokens"  },  "instructions": "string",  "object": "response",  "output": [    {      "content": [        {          "annotations": [            {              "file_id": "string",              "filename": "string",              "index": 0,              "type": "file_citation"            }          ],          "logprobs": [            {              "bytes": [                0              ],              "logprob": 0,              "token": "string",              "top_logprobs": [                {                  "bytes": [                    0                  ],                  "logprob": 0,                  "token": "string"                }              ]            }          ],          "text": "string",          "type": "output_text"        }      ],      "id": "string",      "phase": "commentary",      "role": "assistant",      "status": "in_progress",      "type": "message"    }  ],  "output_text": "string",  "parallel_tool_calls": true,  "status": "completed",  "provider": "string",  "usage": {    "input_tokens": 0,    "input_tokens_details": {      "cached_tokens": 0    },    "output_tokens": 0,    "output_tokens_details": {      "reasoning_tokens": 0    },    "total_tokens": 0,    "billing_mode": "platform",    "cost": 0,    "is_byok": true  }}