import Client from 'agentlin_client';
const client = new Client({
apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
});
const task = await client.tasks.create({ stream: true, user_message_content: 'string' });
console.log(task.id);import os
from agentlin_client import Client
client = Client(
api_key=os.environ.get("AGENTLIN_API_KEY"), # This is the default and can be omitted
)
task = client.tasks.create(
stream=True,
user_message_content="string",
)
print(task.id)package main
import (
"context"
"fmt"
"github.com/LinXueyuanStdio/agentlin-client-go"
"github.com/LinXueyuanStdio/agentlin-client-go/option"
)
func main() {
client := agentlin.NewClient(
option.WithAPIKey("My API Key"),
)
task, err := client.Tasks.New(context.TODO(), agentlin.TaskNewParams{
Stream: true,
UserMessageContent: agentlin.MessageContentUnionParam{
OfString: agentlin.String("string"),
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", task.ID)
}
curl --request POST \
--url https://api.linxueyuan.online/v1/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_message_content": "<string>",
"stream": true,
"structured_output": {},
"client_id": "<string>",
"request_id": "<string>",
"session_id": "<string>",
"task_id": "<string>",
"user_id": "<string>",
"allowed_tools": [
"<string>"
],
"disallowed_tools": [
"<string>"
],
"allowed_subagents": [
"<string>"
],
"stop_tools": [
"<string>"
],
"client_tools": [
{
"type": "function",
"function": {
"name": "<string>",
"parameters": {},
"description": "<string>",
"strict": false
}
}
],
"history_messages": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
{
"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": [
{
"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
]
}
]
}
]
}
]
}
],
"thought_messages": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
{
"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": [
{
"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
]
}
]
}
]
}
]
}
],
"inference_args": {},
"workspace_dir": "<string>",
"env": {},
"log_dir": "<string>",
"rollout_save_dir": "<string>",
"return_rollout": true,
"include_compress_model_rollout": true,
"include_subagent_rollout": true
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linxueyuan.online/v1/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_message_content' => '<string>',
'stream' => true,
'structured_output' => [
],
'client_id' => '<string>',
'request_id' => '<string>',
'session_id' => '<string>',
'task_id' => '<string>',
'user_id' => '<string>',
'allowed_tools' => [
'<string>'
],
'disallowed_tools' => [
'<string>'
],
'allowed_subagents' => [
'<string>'
],
'stop_tools' => [
'<string>'
],
'client_tools' => [
[
'type' => 'function',
'function' => [
'name' => '<string>',
'parameters' => [
],
'description' => '<string>',
'strict' => false
]
]
],
'history_messages' => [
[
'type' => 'reasoning',
'id' => '<string>',
'summary' => [
[
'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' => [
[
'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
]
]
]
]
]
]
]
]
],
'thought_messages' => [
[
'type' => 'reasoning',
'id' => '<string>',
'summary' => [
[
'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' => [
[
'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
]
]
]
]
]
]
]
]
],
'inference_args' => [
],
'workspace_dir' => '<string>',
'env' => [
],
'log_dir' => '<string>',
'rollout_save_dir' => '<string>',
'return_rollout' => true,
'include_compress_model_rollout' => true,
'include_subagent_rollout' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.linxueyuan.online/v1/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_message_content\": \"<string>\",\n \"stream\": true,\n \"structured_output\": {},\n \"client_id\": \"<string>\",\n \"request_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"task_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"allowed_tools\": [\n \"<string>\"\n ],\n \"disallowed_tools\": [\n \"<string>\"\n ],\n \"allowed_subagents\": [\n \"<string>\"\n ],\n \"stop_tools\": [\n \"<string>\"\n ],\n \"client_tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\",\n \"strict\": false\n }\n }\n ],\n \"history_messages\": [\n {\n \"type\": \"reasoning\",\n \"id\": \"<string>\",\n \"summary\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ],\n \"content\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ],\n \"thought_messages\": [\n {\n \"type\": \"reasoning\",\n \"id\": \"<string>\",\n \"summary\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ],\n \"content\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ],\n \"inference_args\": {},\n \"workspace_dir\": \"<string>\",\n \"env\": {},\n \"log_dir\": \"<string>\",\n \"rollout_save_dir\": \"<string>\",\n \"return_rollout\": true,\n \"include_compress_model_rollout\": true,\n \"include_subagent_rollout\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linxueyuan.online/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_message_content\": \"<string>\",\n \"stream\": true,\n \"structured_output\": {},\n \"client_id\": \"<string>\",\n \"request_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"task_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"allowed_tools\": [\n \"<string>\"\n ],\n \"disallowed_tools\": [\n \"<string>\"\n ],\n \"allowed_subagents\": [\n \"<string>\"\n ],\n \"stop_tools\": [\n \"<string>\"\n ],\n \"client_tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\",\n \"strict\": false\n }\n }\n ],\n \"history_messages\": [\n {\n \"type\": \"reasoning\",\n \"id\": \"<string>\",\n \"summary\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ],\n \"content\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ],\n \"thought_messages\": [\n {\n \"type\": \"reasoning\",\n \"id\": \"<string>\",\n \"summary\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ],\n \"content\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ],\n \"inference_args\": {},\n \"workspace_dir\": \"<string>\",\n \"env\": {},\n \"log_dir\": \"<string>\",\n \"rollout_save_dir\": \"<string>\",\n \"return_rollout\": true,\n \"include_compress_model_rollout\": true,\n \"include_subagent_rollout\": true\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "<string>",
"id": "<string>",
"result": {
"object": "task",
"id": "<string>",
"session_id": "<string>",
"user_id": "<string>",
"created_at": 123,
"output": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
{
"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": [
{
"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
]
}
]
}
]
}
]
}
],
"usage": {},
"error": {
"code": 123,
"message": "<string>",
"data": {}
},
"input_required": {
"type": "tool_call",
"call_id": "<string>",
"name": "<string>",
"arguments": "<string>",
"id": "<string>"
},
"metadata": {},
"previous_task_id": "<string>",
"rollouts": [
{}
]
},
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}Create an agent task
Creates a model task. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s task.
import Client from 'agentlin_client';
const client = new Client({
apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
});
const task = await client.tasks.create({ stream: true, user_message_content: 'string' });
console.log(task.id);import os
from agentlin_client import Client
client = Client(
api_key=os.environ.get("AGENTLIN_API_KEY"), # This is the default and can be omitted
)
task = client.tasks.create(
stream=True,
user_message_content="string",
)
print(task.id)package main
import (
"context"
"fmt"
"github.com/LinXueyuanStdio/agentlin-client-go"
"github.com/LinXueyuanStdio/agentlin-client-go/option"
)
func main() {
client := agentlin.NewClient(
option.WithAPIKey("My API Key"),
)
task, err := client.Tasks.New(context.TODO(), agentlin.TaskNewParams{
Stream: true,
UserMessageContent: agentlin.MessageContentUnionParam{
OfString: agentlin.String("string"),
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", task.ID)
}
curl --request POST \
--url https://api.linxueyuan.online/v1/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_message_content": "<string>",
"stream": true,
"structured_output": {},
"client_id": "<string>",
"request_id": "<string>",
"session_id": "<string>",
"task_id": "<string>",
"user_id": "<string>",
"allowed_tools": [
"<string>"
],
"disallowed_tools": [
"<string>"
],
"allowed_subagents": [
"<string>"
],
"stop_tools": [
"<string>"
],
"client_tools": [
{
"type": "function",
"function": {
"name": "<string>",
"parameters": {},
"description": "<string>",
"strict": false
}
}
],
"history_messages": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
{
"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": [
{
"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
]
}
]
}
]
}
]
}
],
"thought_messages": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
{
"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": [
{
"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
]
}
]
}
]
}
]
}
],
"inference_args": {},
"workspace_dir": "<string>",
"env": {},
"log_dir": "<string>",
"rollout_save_dir": "<string>",
"return_rollout": true,
"include_compress_model_rollout": true,
"include_subagent_rollout": true
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linxueyuan.online/v1/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_message_content' => '<string>',
'stream' => true,
'structured_output' => [
],
'client_id' => '<string>',
'request_id' => '<string>',
'session_id' => '<string>',
'task_id' => '<string>',
'user_id' => '<string>',
'allowed_tools' => [
'<string>'
],
'disallowed_tools' => [
'<string>'
],
'allowed_subagents' => [
'<string>'
],
'stop_tools' => [
'<string>'
],
'client_tools' => [
[
'type' => 'function',
'function' => [
'name' => '<string>',
'parameters' => [
],
'description' => '<string>',
'strict' => false
]
]
],
'history_messages' => [
[
'type' => 'reasoning',
'id' => '<string>',
'summary' => [
[
'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' => [
[
'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
]
]
]
]
]
]
]
]
],
'thought_messages' => [
[
'type' => 'reasoning',
'id' => '<string>',
'summary' => [
[
'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' => [
[
'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
]
]
]
]
]
]
]
]
],
'inference_args' => [
],
'workspace_dir' => '<string>',
'env' => [
],
'log_dir' => '<string>',
'rollout_save_dir' => '<string>',
'return_rollout' => true,
'include_compress_model_rollout' => true,
'include_subagent_rollout' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.linxueyuan.online/v1/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_message_content\": \"<string>\",\n \"stream\": true,\n \"structured_output\": {},\n \"client_id\": \"<string>\",\n \"request_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"task_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"allowed_tools\": [\n \"<string>\"\n ],\n \"disallowed_tools\": [\n \"<string>\"\n ],\n \"allowed_subagents\": [\n \"<string>\"\n ],\n \"stop_tools\": [\n \"<string>\"\n ],\n \"client_tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\",\n \"strict\": false\n }\n }\n ],\n \"history_messages\": [\n {\n \"type\": \"reasoning\",\n \"id\": \"<string>\",\n \"summary\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ],\n \"content\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ],\n \"thought_messages\": [\n {\n \"type\": \"reasoning\",\n \"id\": \"<string>\",\n \"summary\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ],\n \"content\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ],\n \"inference_args\": {},\n \"workspace_dir\": \"<string>\",\n \"env\": {},\n \"log_dir\": \"<string>\",\n \"rollout_save_dir\": \"<string>\",\n \"return_rollout\": true,\n \"include_compress_model_rollout\": true,\n \"include_subagent_rollout\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linxueyuan.online/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_message_content\": \"<string>\",\n \"stream\": true,\n \"structured_output\": {},\n \"client_id\": \"<string>\",\n \"request_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"task_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"allowed_tools\": [\n \"<string>\"\n ],\n \"disallowed_tools\": [\n \"<string>\"\n ],\n \"allowed_subagents\": [\n \"<string>\"\n ],\n \"stop_tools\": [\n \"<string>\"\n ],\n \"client_tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\",\n \"strict\": false\n }\n }\n ],\n \"history_messages\": [\n {\n \"type\": \"reasoning\",\n \"id\": \"<string>\",\n \"summary\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ],\n \"content\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ],\n \"thought_messages\": [\n {\n \"type\": \"reasoning\",\n \"id\": \"<string>\",\n \"summary\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ],\n \"content\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"tags\": [\n \"<string>\"\n ],\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"file_id\": \"<string>\",\n \"index\": 123,\n \"filename\": \"<string>\"\n }\n ],\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ],\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ],\n \"inference_args\": {},\n \"workspace_dir\": \"<string>\",\n \"env\": {},\n \"log_dir\": \"<string>\",\n \"rollout_save_dir\": \"<string>\",\n \"return_rollout\": true,\n \"include_compress_model_rollout\": true,\n \"include_subagent_rollout\": true\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "<string>",
"id": "<string>",
"result": {
"object": "task",
"id": "<string>",
"session_id": "<string>",
"user_id": "<string>",
"created_at": 123,
"output": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
{
"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": [
{
"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
]
}
]
}
]
}
]
}
],
"usage": {},
"error": {
"code": 123,
"message": "<string>",
"data": {}
},
"input_required": {
"type": "tool_call",
"call_id": "<string>",
"name": "<string>",
"arguments": "<string>",
"id": "<string>"
},
"metadata": {},
"previous_task_id": "<string>",
"rollouts": [
{}
]
},
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request payload for POST /tasks. Maps to the CreateTask Pydantic model in server.
当前用户输入内容(多模态),按顺序提供给主 Agent。 消息内容,字符串或内容项数组,工具协议兼容的 message_content(保留字段)。
是否启用流式(SSE)返回;true 则以 text/event-stream 推送 Task 事件。
期望的结构化输出 JSON Schema;仅非流式模式有效,流式模式下将被忽略。
调用方客户端标识(如 AIME)。
请求链路唯一 ID;便于将复杂调用串联在一起。
会话 ID;用于跨多轮交互复用上下文。
任务 ID;用于区分主任务与子任务。
终端用户 ID。
指定主 Agent 的配置;为空则按 client_id 推断默认 Agent。
Show child attributes
Show child attributes
允许使用的工具白名单;为 null 允许全部,空数组表示禁止所有。
禁用的工具黑名单;为 null 或空数组不生效。
允许使用的子代理白名单;为 null 允许全部,空数组禁止所有。
命中则停止代理循环的工具名列表;为 null 或空数组不生效。
客户端自带工具定义;命中后会停止由服务端执行,等待客户端完成。
Show child attributes
Show child attributes
历史对话消息,用于提供上下文。
An output item produced by the agent/model.
- OutputItem
- OutputItem
- OutputItem
- OutputItem
Show child attributes
Show child attributes
隐藏的助手思考内容(不可见思考轨迹),如有将并入上下文。
An output item produced by the agent/model.
- OutputItem
- OutputItem
- OutputItem
- OutputItem
Show child attributes
Show child attributes
推理参数覆盖项(如温度、最大 tokens 等),具体字段由后端实现决定。
文件系统工作目录;供文件工具与代码解释器使用。
Agent 的运行时环境变量键值对。
Show child attributes
Show child attributes
日志输出目录。
回溯(rollout)结果保存目录。
是否在最终结果中返回 rollout 事件集合。
是否包含上下文压缩模型的 rollout 结果。
是否包含子 Agent 的 rollout 结果。
Was this page helpful?