Cancel stored response
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.
ApiKeyAuthAuthorization<token>response_id*stringResponse ID returned by POST /v1/responses.
Cancelled stored response
application/json- response
metadata*|nullprompt_cache_key?stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field. Learn more.
prompt_cache_retention?|nullsafety_identifier?stringA 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 <= 64service_tier?|nulltemperature*|nulltop_logprobs?|nulltop_p*|nulluser?stringDeprecatedThis 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?|nullmax_output_tokens?|nullmax_tool_calls?|nullmodel*||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?|nullprompt?|nullreasoning?|nulltext?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?|nullcompleted_at?|nullconversation?|nullcreated_at*numberUnix timestamp (in seconds) of when this Response was created.
error*|nullid*stringUnique identifier for this Response.
incomplete_details*|nullinstructions*|array<|||||||||||||||||||||||||>|nullobject*"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
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
output_text?|nullparallel_tool_calls*booleanWhether to allow the model to run tool calls in parallel.
truestatus?stringThe 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?stringThe 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 }}Get effective prices for a model string GET
Returns what the authenticated caller pays when requesting this model string, route by route, including contract pricing. Prices come from the same implementation that charges requests. A request is charged at the price of the route that serves it.
Count input tokens POST
Counts the input tokens of a Messages request without running it. Takes the same body as `POST /v1/messages`. The count is model-specific (4.7+ use a new tokenizer, roughly 30% more tokens for the same text) and free to use.