import Client from 'agentlin';
const client = new Client({
apiKey: 'My API Key',
});
const task = await client.tasks.retrieve('task_677efb5139a88190b512bc3fef8e535d');
console.log(task.id);{
"jsonrpc": "<string>",
"id": "<string>",
"result": {
"object": "task",
"id": "<string>",
"session_id": "<string>",
"user_id": "<string>",
"status": "created",
"created_at": 123,
"output": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
{
"type": "text",
"text": "<string>",
"id": 123,
"tags": [
"<string>"
],
"annotations": [
{
"type": "file_citation",
"file_id": "<string>",
"index": 123,
"filename": "<string>"
}
],
"logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
]
}
],
"content": [
{
"type": "text",
"text": "<string>",
"id": 123,
"tags": [
"<string>"
],
"annotations": [
{
"type": "file_citation",
"file_id": "<string>",
"index": 123,
"filename": "<string>"
}
],
"logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
]
}
],
"status": "in_progress"
}
],
"usage": {},
"error": {
"code": 123,
"message": "<string>",
"data": {}
},
"input_required": {
"type": "tool_call",
"call_id": "<string>",
"name": "<string>",
"arguments": "<string>",
"id": "<string>",
"status": "in_progress",
"language": "json"
},
"metadata": {},
"previous_task_id": "<string>",
"rollouts": [
{}
]
},
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}Retrieves a model task with the given ID.
import Client from 'agentlin';
const client = new Client({
apiKey: 'My API Key',
});
const task = await client.tasks.retrieve('task_677efb5139a88190b512bc3fef8e535d');
console.log(task.id);{
"jsonrpc": "<string>",
"id": "<string>",
"result": {
"object": "task",
"id": "<string>",
"session_id": "<string>",
"user_id": "<string>",
"status": "created",
"created_at": 123,
"output": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
{
"type": "text",
"text": "<string>",
"id": 123,
"tags": [
"<string>"
],
"annotations": [
{
"type": "file_citation",
"file_id": "<string>",
"index": 123,
"filename": "<string>"
}
],
"logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
]
}
],
"content": [
{
"type": "text",
"text": "<string>",
"id": 123,
"tags": [
"<string>"
],
"annotations": [
{
"type": "file_citation",
"file_id": "<string>",
"index": 123,
"filename": "<string>"
}
],
"logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
]
}
],
"status": "in_progress"
}
],
"usage": {},
"error": {
"code": 123,
"message": "<string>",
"data": {}
},
"input_required": {
"type": "tool_call",
"call_id": "<string>",
"name": "<string>",
"arguments": "<string>",
"id": "<string>",
"status": "in_progress",
"language": "json"
},
"metadata": {},
"previous_task_id": "<string>",
"rollouts": [
{}
]
},
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the task to retrieve.
"task_677efb5139a88190b512bc3fef8e535d"
Was this page helpful?