Skip to main content
API Reference for openai/gpt-5-mini, served by Comfy Router from OpenAI.

Quick start

Create a key at platform.comfy.org/profile/api-keys and export it as COMFY_API_KEY. The Python and TypeScript snippets use the Comfy SDKs (pip install comfy-sdk, npm install @comfyorg/sdk); the cURL snippet is the same call over raw HTTP. Model ID: openai/gpt-5-mini Endpoint: POST https://api.comfy.org/v2/models/openai/gpt-5-mini

Schema

Input

Router has not published an authored input schema for this model yet: GET /v2/models/openai/gpt-5-mini/openapi.json returns an open object with x-comfy-input-schema-authored: false. Router forwards the body to OpenAI unchanged, so OpenAI’s own API reference is authoritative for the request fields, and nothing is validated server side.

Output

string
Inserts a system (or developer) message as the first item in the model’s context.When using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
integer
An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
string
The model used to generate the response
number
default:"1"
Controls randomness in the responseRange: 0 to 2
number
default:"1"
Controls diversity of the response via nucleus samplingRange: 0 to 1
string
default:"\"disabled\""
The truncation strategy to use for the model response.
  • auto: If the context of this response and previous ones exceeds the model’s context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.
  • disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error. Possible values: auto, disabled
string
The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state.
object
o-series models onlyConfiguration options for reasoning models.
string
Controls which reasoning items are rendered back to the model on later turns, e.g. auto, current_turn, or all_turns.
string
default:"\"medium\""
o-series models onlyConstrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.Possible values: low, medium, high
string
Deprecated: use summary instead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model’s reasoning process. One of auto, concise, or detailed.Possible values: auto, concise, detailed
string
The reasoning mode used for the response.
string
A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model’s reasoning process. One of auto, concise, or detailed.Possible values: auto, concise, detailed
object
object | object | object
An object specifying the format that the model must output.Configuring { "type": "json_schema" } enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is { "type": "text" } with no additional options.Not recommended for gpt-4o and newer models:Setting to { "type": "json_object" } enables the older JSON mode, which ensures the message the model generates is valid JSON. Using json_schema is preferred for models that support it.
string
Constrains the verbosity of the model’s response. One of low, medium, or high.
`none`, `auto`, `required` | object | object
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.
object | object | object | object[]
boolean
Whether the model response runs in the background.
object
Billing information for the response.
string
The party responsible for paying for the response.
number
Unix timestamp (in seconds) of when this Response was completed. Only present when the status is completed.
number
Unix timestamp (in seconds) of when this Response was created.
object
An error object returned when the model fails to generate a Response.
string
required
The error code for the response.Possible values: server_error, rate_limit_exceeded, invalid_prompt, vector_store_timeout, invalid_image, invalid_image_format, invalid_base64_image, invalid_image_url, image_too_large, image_too_small, image_parse_error, image_content_policy_violation, invalid_image_mode, image_file_too_large, unsupported_image_media_type, empty_image_file, failed_to_download_image, image_file_not_found
string
required
A human-readable description of the error.
number
Penalizes new tokens based on their existing frequency in the text so far.
string
Unique identifier for this Response.
object
Details about why the response is incomplete.
string
The reason why the response is incomplete.Possible values: max_output_tokens, content_filter
integer
The maximum number of total calls to built-in tools that can be processed in a response.
object
Set of key-value pairs that can be attached to the response.
object
Moderation results for the response input and output, if moderated completions were requested.
string
The object type of this resource - always set to response.Possible values: response
object | object | object | object | object | object | object[]
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.
string
SDK-only convenience property that contains the aggregated text output from all output_text items in the output array, if any are present. Supported in the Python and JavaScript SDKs.
boolean
default:"true"
Whether to allow the model to run tool calls in parallel.
number
Penalizes new tokens based on whether they appear in the text so far.
string
Used by OpenAI to cache responses for similar requests to optimize cache hit rates. Replaces the user field.
string
The retention policy for the prompt cache, e.g. in_memory or 24h.
string
A stable identifier used to help detect users of your application that may be violating OpenAI’s usage policies.
string
The processing tier used to serve the request, e.g. auto, default, flex, scale, or priority.
string
The status of the response generation. One of completed, failed, in_progress, cancelled, queued, or incomplete.Possible values: completed, failed, in_progress, cancelled, queued, incomplete
boolean
Whether the response is stored for later retrieval via the API.
object
Token and request usage broken down by built-in tool.
object
Image generation tool token usage.
integer
object
integer
integer
integer
object
integer
integer
integer
Web search tool usage.
integer
integer
The maximum number of most likely tokens to return at each token position, each with an associated log probability.
object
Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
integer
required
The number of input tokens.
object
required
A detailed breakdown of the input tokens.
integer
The number of input tokens that were written to the cache.
integer
required
The number of tokens that were retrieved from the cache. More on prompt caching.
integer
required
The number of output tokens.
object
required
A detailed breakdown of the output tokens.
integer
required
The number of reasoning tokens.
integer
required
The total number of tokens used.
string
Deprecated identifier for the end-user. Replaced by safety_identifier and prompt_cache_key.

Examples

Output

Before you ship

The snippets above are the shortest working call. Three things are the same for every model and are documented once on the Comfy Router headers page: send an Idempotency-Key on every paid call and reuse it when you retry, expect the connection to be held up to Router’s 10 minute deadline, and keep X-Comfy-Request-Id from every response. The SDKs do all three for you; the cURL tab does none of them. On failure, X-Comfy-Error-Type names the bucket, and a 422 means the body failed the model’s schema and was never billed.

Headers

Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.

Quick Start

Typed error handling in Python and TypeScript, reading the 422, walking the catalog.

Limitations

What Router does not do today, and what to use instead.