Retrieve a completed model response by its Response ID.
Replace
Returned when the specified Response ID does not exist:
{WorkspaceId} with your actual workspace ID.
- China (Beijing)
The
base_url for SDK calls is: https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1HTTP request URL: GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/responses/{response_id}Path parametersresponse_idstring(required)The Response ID to retrieve. The format is resp_xxx. You can get it from the response of the Create response API. Only Response IDs returned when store=true was set in the original creation request can be retrieved. | Python |
ResponseReturns the same Response object as the Create response API. The fields are described below:idstringUnique identifier for this response, in the format resp_xxx.object stringObject type. Always response.status stringResponse status. Possible values: completed, failed, in_progress, cancelled, queued, incomplete.created_at integerUnix timestamp (in seconds) when the response was created.completed_at integerUnix timestamp (in seconds) when the response finished generating. null if the response is not complete.error objectError object returned when the model fails to generate a response. null on success.model stringModel ID used to generate the response.output arrayOutput items generated by the model. The type and order of elements depend on the model's response.
Array element properties type stringOutput item type. Possible values:
stringUnique identifier for the output item. Present for all output types.role stringMessage role. Always assistant. Present only when type is message.status stringOutput item status. Possible values: completed, in_progress. Present when type is not reasoning.name stringTool or function name. Present when type is function_call, web_search_image_call, image_search_call, or mcp_call.For web_search_image_call and image_search_call, the value is fixed as "web_search_image" and "image_search", respectively.For mcp_call, the value is the specific function name called in the MCP service (for example, amap-maps-maps_geo).arguments stringTool call arguments, formatted as a JSON string. Present when type is function_call, web_search_image_call, image_search_call, or mcp_call. Parse it using JSON.parse() before use. Contents vary by tool type:
stringUnique identifier for the function call. Present only when type is function_call. Use this ID to associate the request with the response when returning function call results.content arrayMessage content array. Present only when type is message.
Array element properties type stringContent type. Always output_text.text stringText content generated by the model.annotations arrayText annotations. Usually an empty array.arrayReasoning summaries. Present only when type is reasoning. Each element contains a type field (value summary_text) and a text field (the summary text).action objectSearch action information. Present only when type is web_search_call.
Properties query stringSearch query keyword.type stringSearch type. Always search.sources arraySearch sources. Each element contains a type field and a url field.stringCode generated and executed by the model. Present only when type is code_interpreter_call.outputs arrayCode execution outputs. Present only when type is code_interpreter_call. Each element contains a type field (value logs) and a logs field (code execution logs).container_id stringCode interpreter container identifier. Present only when type is code_interpreter_call. Use it to associate multiple code executions within the same session.goal stringDescription of the extraction goal, specifying what information to extract from the webpage. Present only when type is web_extractor_call.output stringOutput result of the tool call, formatted as a string.
arrayURLs of the webpages extracted. Present only when type is web_extractor_call.server_label stringMCP service label. Present only when type is mcp_call. Identifies the MCP service used for this call.queries arrayQueries used for knowledge base retrieval. Present only when type is file_search_call. Each element is a search query generated by the model.results arrayKnowledge base retrieval results. Present only when type is file_search_call.
Array element properties file_id stringFile ID of the matched document.filename stringFilename of the matched document.score floatRelevance score, ranging from 0 to 1. Higher values indicate greater relevance.text stringSnippet of the matched document content.objectToken usage information for this request.
Properties input_tokens integerNumber of input tokens.output_tokens integerNumber of output tokens generated by the model.total_tokens integerTotal tokens used (input_tokens + output_tokens).input_tokens_details objectBreakdown of input tokens.
Properties cached_tokens integerNumber of cached tokens.objectBreakdown of output tokens.
Properties reasoning_tokens integerNumber of reasoning tokens.arrayBilling details.
Properties input_tokens integerInput tokens for this billing type.output_tokens integerOutput tokens for this billing type.total_tokens integerTotal tokens for this billing type.x_billing_type stringAlways response_api.prompt_tokens_details objectReturned when session caching is enabled. Contains a cached_tokens field (number of cached tokens).objectTool usage statistics. When built-in tools are used, this field contains the call count for each tool. Example: {"web_search": {"count": 1}}arrayEchoes the tools parameter from the creation request. Structure matches the tools parameter in the request body. Empty array [] if no tools were used.tool_choice stringEchoes the tool_choice parameter from the creation request. Possible values: auto, none, required.parallel_tool_calls booleanEchoes the parallel_tool_calls parameter from the creation request. Indicates whether the model can call multiple tools in parallel.temperature floatEchoes the temperature parameter from the creation request. Controls the diversity of model output. Valid range: [0, 2). Returns the model default if not set.top_p floatEchoes the top_p parameter from the creation request. Nucleus sampling probability threshold. Valid range: (0, 1.0]. Returns the model default if not set.frequency_penalty floatEchoes the frequency_penalty parameter from the creation request. Positive values reduce the likelihood of repeated words.presence_penalty floatEchoes the presence_penalty parameter from the creation request. Positive values increase the likelihood of introducing new topics.top_logprobs integerEchoes the top_logprobs parameter from the creation request. Number of most likely tokens returned at each position. 0 if not enabled.store booleanEchoes the store parameter from the creation request. true means the response is stored and can be referenced by previous_response_id. false means it is not stored.service_tier stringService tier. Always default.background booleanWhether the response was executed asynchronously. Model Studio currently supports synchronous calls only, so this is always false.metadata objectEchoes the metadata parameter from the creation request. Custom key-value pairs attached to the response. Empty object {} if not set. |