Skip to main content
Call the Responses API to get the model-generated response data. This endpoint is compatible with the OpenAI Responses API request and response format.

Endpoint

POST https://api.stepfun.ai/v1/responses

Request Parameters

  • model string required
    Name of the model to use. Currently only step-3.7-flash is supported.
  • input string or object array required
    Input content. Either a plain text string, or an ordered array of messages / events.
Image and video URLs must be publicly reachable from the server; if the server cannot fetch the URL, a parameter error will be returned. For image input, base64 data URLs are recommended to avoid authentication, hotlink protection, or network access failures on external URLs.
  • instructions string optional
    Top-level system instructions.
  • stream bool optional
    Whether to enable SSE streaming. Default is false.
  • temperature float optional
    Sampling temperature, between 0.0 and 2.0.
  • top_p float optional
    Nucleus sampling parameter.
  • max_output_tokens int optional
    Maximum number of output tokens for this response.
max_output_tokens limits both the reasoning process and the final output. When using medium / high reasoning effort, JSON Schema, video, or other complex inputs, reserve a larger output budget; if the budget is insufficient, the response may return status="incomplete", and output may contain only a reasoning item without a final message.
  • reasoning object optional
    Reasoning configuration.
  • tools object array optional
    List of tool definitions. Currently only function-type tools are supported.
  • tool_choice string or object optional
    Tool-call strategy. Currently only the string "auto" is supported (the model decides whether to call a tool).
  • text object optional
    Text output format configuration.

Response Format

Non-streaming response

When stream=false (default), a single Response object is returned.

Properties

  • id string
    Unique response ID, in the form resp_xxx.
  • object string
    Always response.
  • created_at int
    Creation time as a Unix timestamp (seconds).
  • completed_at int or null
    Completion time as a Unix timestamp (seconds).
  • status string
    Response status. One of completed, incomplete, or failed.
  • error object or null
    Error information. Non-null only when status=failed.
  • incomplete_details object or null
    Incomplete details. Non-null only when status=incomplete; commonly { "reason": "max_output_tokens" }.
  • model string
    The model ID actually used.
  • output object array
    Array of output items. Each element may be of one of the following types:
  • usage object
    Token usage statistics.
  • instructions string or null
    Echoes the top-level instructions from the request.
  • max_output_tokens int or null
    Echoes the request parameter.
  • reasoning object or null
    Echoes the reasoning configuration.
  • temperature float or null
    Echoes the sampling temperature.
  • top_p float or null
    Echoes the nucleus sampling parameter.
  • text object
    Echoes the text output format configuration.
  • tool_choice string or object
    Echoes the tool-call strategy.
  • tools object array
    Echoes the tool definitions.

Example

Streaming response

When stream=true, Server-Sent Events (SSE) data is returned. Each event consists of an event: line and a data: line. Each event’s data object contains type and sequence_number. type matches the event name; sequence_number starts from 0 and increments, allowing clients to process events in order.

Event types

Example

Text streaming:
Function-call streaming (excerpt):

Examples