Report scenarios to an offline run
1 to 100 reports, each one run of a scenario as the harness scored it, stored in one transaction. Answers one result per report, in the order sent: stored, with its trace and its repeat, the run of its scenario it is, from 0; or refused, with a code, a sentence, and the bound it broke, if one did, the others stored as if it weren’t sent: a report past a bound on one (its task’s bytes as JSON, a reason’s length, its judge calls) is refused with that bound as limit. A task sent as its id alone takes the content an earlier report in the request sent for its scenario, or else the revision of it the run last stored, so a scenario’s content need be sent once a run; a run that stored none stores the id alone as the scenario’s content. A session already reported answers what was stored for it, so a request sent again stores nothing twice. A run that isn’t open takes none (OfflineRunNotOpen), a body past its bound in bytes is OfflineRequestTooLarge, and past the org’s budget, TooManyAttempts: either way nothing is stored, and the same request can be sent again, after retryAfter seconds for the latter.
curl --request POST \
--url https://app.ambral.ai/api/report/v1/runs/{run}/reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reports": [
{
"session": "<string>",
"task": {
"id": "<string>",
"idx": 0,
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"image": "<string>",
"workdir": "<string>",
"agent_user": "<string>",
"skills": [
"<string>"
],
"network_allow": [
"<string>"
],
"network_block": [
"<string>"
],
"artifacts": [
{
"source": "<string>",
"exclude": [
"<string>"
],
"required": true
}
],
"artifact_max_bytes": 123,
"timeout": {
"setup": 123,
"agent": 123,
"finalize": 123,
"scoring": 123
},
"resources": {
"cpu": 123,
"memory": 123,
"gpu": "<string>",
"disk": 123
}
},
"rewards": {},
"passed": true,
"metrics": {},
"reasons": {},
"judgeCalls": [
{
"name": "<string>",
"request": {},
"response": {
"message": {
"role": "assistant",
"content": "<string>",
"reasoning_content": "<string>",
"tool_calls": [
{
"id": "<string>",
"name": "<string>",
"arguments": "<string>",
"namespace": "<string>"
}
],
"provider_state": [
{}
]
},
"parsed": null,
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"cached_input_tokens": 0,
"reasoning_tokens": 0,
"cost": 123
}
}
}
],
"errors": [
{
"type": "<string>",
"message": "<string>",
"status_code": 0,
"traceback": "<string>"
}
]
}
]
}
'import requests
url = "https://app.ambral.ai/api/report/v1/runs/{run}/reports"
payload = { "reports": [
{
"session": "<string>",
"task": {
"id": "<string>",
"idx": 0,
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"image": "<string>",
"workdir": "<string>",
"agent_user": "<string>",
"skills": ["<string>"],
"network_allow": ["<string>"],
"network_block": ["<string>"],
"artifacts": [
{
"source": "<string>",
"exclude": ["<string>"],
"required": True
}
],
"artifact_max_bytes": 123,
"timeout": {
"setup": 123,
"agent": 123,
"finalize": 123,
"scoring": 123
},
"resources": {
"cpu": 123,
"memory": 123,
"gpu": "<string>",
"disk": 123
}
},
"rewards": {},
"passed": True,
"metrics": {},
"reasons": {},
"judgeCalls": [
{
"name": "<string>",
"request": {},
"response": {
"message": {
"role": "assistant",
"content": "<string>",
"reasoning_content": "<string>",
"tool_calls": [
{
"id": "<string>",
"name": "<string>",
"arguments": "<string>",
"namespace": "<string>"
}
],
"provider_state": [{}]
},
"parsed": None,
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"cached_input_tokens": 0,
"reasoning_tokens": 0,
"cost": 123
}
}
}
],
"errors": [
{
"type": "<string>",
"message": "<string>",
"status_code": 0,
"traceback": "<string>"
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reports: [
{
session: '<string>',
task: {
id: '<string>',
idx: 0,
name: '<string>',
description: '<string>',
prompt: '<string>',
system_prompt: '<string>',
image: '<string>',
workdir: '<string>',
agent_user: '<string>',
skills: ['<string>'],
network_allow: ['<string>'],
network_block: ['<string>'],
artifacts: [{source: '<string>', exclude: ['<string>'], required: true}],
artifact_max_bytes: 123,
timeout: {setup: 123, agent: 123, finalize: 123, scoring: 123},
resources: {cpu: 123, memory: 123, gpu: '<string>', disk: 123}
},
rewards: {},
passed: true,
metrics: {},
reasons: {},
judgeCalls: [
{
name: '<string>',
request: {},
response: {
message: {
role: 'assistant',
content: '<string>',
reasoning_content: '<string>',
tool_calls: [
{id: '<string>', name: '<string>', arguments: '<string>', namespace: '<string>'}
],
provider_state: [{}]
},
parsed: null,
usage: {
prompt_tokens: 0,
completion_tokens: 0,
cached_input_tokens: 0,
reasoning_tokens: 0,
cost: 123
}
}
}
],
errors: [{type: '<string>', message: '<string>', status_code: 0, traceback: '<string>'}]
}
]
})
};
fetch('https://app.ambral.ai/api/report/v1/runs/{run}/reports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"results": [
{
"session": "<string>",
"trace": "<string>",
"repeat": 4503599627370495
}
]
}{
"_tag": "Unauthorized"
}{
"_tag": "RunNotFound",
"run": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"_tag": "OfflineRunNotOpen",
"run": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"_tag": "OfflineRequestTooLarge",
"limit": 0
}{
"_tag": "TooManyAttempts",
"message": "<string>",
"retryAfter": 4503599627370495
}{
"_tag": "ServiceUnavailable"
}Path Parameters
Body
curl --request POST \
--url https://app.ambral.ai/api/report/v1/runs/{run}/reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reports": [
{
"session": "<string>",
"task": {
"id": "<string>",
"idx": 0,
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"image": "<string>",
"workdir": "<string>",
"agent_user": "<string>",
"skills": [
"<string>"
],
"network_allow": [
"<string>"
],
"network_block": [
"<string>"
],
"artifacts": [
{
"source": "<string>",
"exclude": [
"<string>"
],
"required": true
}
],
"artifact_max_bytes": 123,
"timeout": {
"setup": 123,
"agent": 123,
"finalize": 123,
"scoring": 123
},
"resources": {
"cpu": 123,
"memory": 123,
"gpu": "<string>",
"disk": 123
}
},
"rewards": {},
"passed": true,
"metrics": {},
"reasons": {},
"judgeCalls": [
{
"name": "<string>",
"request": {},
"response": {
"message": {
"role": "assistant",
"content": "<string>",
"reasoning_content": "<string>",
"tool_calls": [
{
"id": "<string>",
"name": "<string>",
"arguments": "<string>",
"namespace": "<string>"
}
],
"provider_state": [
{}
]
},
"parsed": null,
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"cached_input_tokens": 0,
"reasoning_tokens": 0,
"cost": 123
}
}
}
],
"errors": [
{
"type": "<string>",
"message": "<string>",
"status_code": 0,
"traceback": "<string>"
}
]
}
]
}
'import requests
url = "https://app.ambral.ai/api/report/v1/runs/{run}/reports"
payload = { "reports": [
{
"session": "<string>",
"task": {
"id": "<string>",
"idx": 0,
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"image": "<string>",
"workdir": "<string>",
"agent_user": "<string>",
"skills": ["<string>"],
"network_allow": ["<string>"],
"network_block": ["<string>"],
"artifacts": [
{
"source": "<string>",
"exclude": ["<string>"],
"required": True
}
],
"artifact_max_bytes": 123,
"timeout": {
"setup": 123,
"agent": 123,
"finalize": 123,
"scoring": 123
},
"resources": {
"cpu": 123,
"memory": 123,
"gpu": "<string>",
"disk": 123
}
},
"rewards": {},
"passed": True,
"metrics": {},
"reasons": {},
"judgeCalls": [
{
"name": "<string>",
"request": {},
"response": {
"message": {
"role": "assistant",
"content": "<string>",
"reasoning_content": "<string>",
"tool_calls": [
{
"id": "<string>",
"name": "<string>",
"arguments": "<string>",
"namespace": "<string>"
}
],
"provider_state": [{}]
},
"parsed": None,
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"cached_input_tokens": 0,
"reasoning_tokens": 0,
"cost": 123
}
}
}
],
"errors": [
{
"type": "<string>",
"message": "<string>",
"status_code": 0,
"traceback": "<string>"
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reports: [
{
session: '<string>',
task: {
id: '<string>',
idx: 0,
name: '<string>',
description: '<string>',
prompt: '<string>',
system_prompt: '<string>',
image: '<string>',
workdir: '<string>',
agent_user: '<string>',
skills: ['<string>'],
network_allow: ['<string>'],
network_block: ['<string>'],
artifacts: [{source: '<string>', exclude: ['<string>'], required: true}],
artifact_max_bytes: 123,
timeout: {setup: 123, agent: 123, finalize: 123, scoring: 123},
resources: {cpu: 123, memory: 123, gpu: '<string>', disk: 123}
},
rewards: {},
passed: true,
metrics: {},
reasons: {},
judgeCalls: [
{
name: '<string>',
request: {},
response: {
message: {
role: 'assistant',
content: '<string>',
reasoning_content: '<string>',
tool_calls: [
{id: '<string>', name: '<string>', arguments: '<string>', namespace: '<string>'}
],
provider_state: [{}]
},
parsed: null,
usage: {
prompt_tokens: 0,
completion_tokens: 0,
cached_input_tokens: 0,
reasoning_tokens: 0,
cost: 123
}
}
}
],
errors: [{type: '<string>', message: '<string>', status_code: 0, traceback: '<string>'}]
}
]
})
};
fetch('https://app.ambral.ai/api/report/v1/runs/{run}/reports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"results": [
{
"session": "<string>",
"trace": "<string>",
"repeat": 4503599627370495
}
]
}{
"_tag": "Unauthorized"
}{
"_tag": "RunNotFound",
"run": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"_tag": "OfflineRunNotOpen",
"run": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"_tag": "OfflineRequestTooLarge",
"limit": 0
}{
"_tag": "TooManyAttempts",
"message": "<string>",
"retryAfter": 4503599627370495
}{
"_tag": "ServiceUnavailable"
}