using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
string agentJobId = "YOUR_AGENT_JOB_ID"; // Replace with your agent job ID
string token = "YOUR_API_TOKEN"; // Replace with your API token
string url = $"https://api.roe-ai.com/v1/agents/jobs/{agentJobId}/result/";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
HttpResponseMessage response = await client.GetAsync(url);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
{
"agent_id": "123e4567-e89b-12d3-a456-426614174000",
"agent_version_id": "456e7890-e89b-12d3-a456-426614174001",
"inputs": [
{
"key": "input_text",
"value": "Hello world",
"data_type": "text/plain"
}
],
"input_tokens": 100,
"output_tokens": 50,
"outputs": [
{
"key": "output",
"description": "Output JSON data",
"data_type": "application/json",
"value": "{\"summary\": \"hello world!\"}",
"cost": 0.05
}
]
}
Get agent job result data.
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
string agentJobId = "YOUR_AGENT_JOB_ID"; // Replace with your agent job ID
string token = "YOUR_API_TOKEN"; // Replace with your API token
string url = $"https://api.roe-ai.com/v1/agents/jobs/{agentJobId}/result/";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
HttpResponseMessage response = await client.GetAsync(url);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
{
"agent_id": "123e4567-e89b-12d3-a456-426614174000",
"agent_version_id": "456e7890-e89b-12d3-a456-426614174001",
"inputs": [
{
"key": "input_text",
"value": "Hello world",
"data_type": "text/plain"
}
],
"input_tokens": 100,
"output_tokens": 50,
"outputs": [
{
"key": "output",
"description": "Output JSON data",
"data_type": "application/json",
"value": "{\"summary\": \"hello world!\"}",
"cost": 0.05
}
]
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Agent job result with outputs, inputs, tokens and metadata
The response is of type object
.