Retrieve the status and result of a job.
Authorization
Required
Bearer <token>In: header
job_id
Required
stringThe ID of the job to retrieve.
includearray
Controls how many step results are returned. Use ["last"] for only the latest step (default) or ["all"] for the full step history.
from openai import OpenAI
client = OpenAI(
api_key="UPSTAGE_API_KEY",
base_url="https://api.upstage.ai/v2"
)
response = client.responses.retrieve(
job_id,
include=["all"]
)
print(response.model_dump())
{
"id": "job_7yMqwGy3rfh6Pwo7MdseMo",
"object": "response",
"created_at": 1767613535,
"status": "completed",
"background": true,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "agt_BxcRatEWzVYH2yRNtyWynn",
"output": [
{
"id": "e2e14327-740c-40d2-b353-fda754b8e0d8",
"type": "message",
"status": "completed",
"role": "assistant",
"model": "step_1_parse",
"content": [
{
"type": "output_text",
"text": "{\"api\": \"2.0\", \"content\": {\"html\": \"...\"}}",
"annotations": [],
"additional_values": "{\"document_ids\": [\"file-abc123\"]}"
}
]
},
{
"id": "fb543069-1a45-4fde-94de-2383995d7339",
"type": "message",
"status": "completed",
"role": "assistant",
"model": "step_2_extract",
"content": [
{
"type": "output_text",
"text": "{\"key\": \"value\", \"group_key\": [{\"properties\": \"properties_value\"}]}",
"annotations": [],
"additional_values": "{...}"
}
]
}
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"total_tokens": 0
}
}
Run a Studio agent on uploaded files by creating a job. Covers the request body (agent ID, input files, config version, include), the response object (status, output, usage), and an example request and response.
Create a vector store for file search. Covers the request body (name, file_ids, expires_after, metadata), the vector store object returned (id, name, usage_bytes, file_counts, status), and an example request and response.