curl --request POST \
--url 'https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY=' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "value",
"name": "energy",
"value": 42
}
'import requests
url = "https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY="
payload = {
"kind": "value",
"name": "energy",
"value": 42
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({kind: 'value', name: 'energy', value: 42})
};
fetch('https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY=",
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([
'kind' => 'value',
'name' => 'energy',
'value' => 42
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY="
payload := strings.NewReader("{\n \"kind\": \"value\",\n \"name\": \"energy\",\n \"value\": 42\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY=")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"value\",\n \"name\": \"energy\",\n \"value\": 42\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"value\",\n \"name\": \"energy\",\n \"value\": 42\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Log Artifact In Experiment
Log or append an artifact value under an experiment metrics key.
Use this tool when the caller needs to persist run metadata, scalar values,
time-series points, JSON payloads, or base64 image artifacts under an
experiment. Repeated writes to the same data.name are stored as
timestamp-keyed entries and may later read back as normalized timeseries or
value shapes.
When to Use:
- Call this after a run, optimization, or analysis step when metadata or derived outputs should be attached to an experiment.
- Call this when the workflow needs to persist human-readable notes, numeric values, JSON payloads, or image-like previews.
Constraints:
kindmust be exactly one oftext,value,timeseries,list,dict, orimage.- Repeated writes are stored under timestamp keys in the experiment
metrics map, so read-side responses may normalize to
valueortimeseriesinstead of preserving the write-timekindverbatim.
Notes:
- The route returns an empty
200response on success. - After logging, callers can use
list_artifacts_in_experimentorget_artifact_in_experimentto inspect the normalized MCP read-side artifact shape.
Args:
experiment_id: Parent experiment identifier.
user: Authenticated user resolved from the API key.
data: Artifact payload. kind must be exactly one of text,
value, timeseries, list, dict, or image.
db: Active database session.
Returns:
An empty 200 response when artifact data is persisted.
Raises:
HTTPException: Raised with 404 if the experiment is missing, or
400 for invalid artifact shape such as missing timeseries
points.
curl --request POST \
--url 'https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY=' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "value",
"name": "energy",
"value": 42
}
'import requests
url = "https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY="
payload = {
"kind": "value",
"name": "energy",
"value": 42
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({kind: 'value', name: 'energy', value: 42})
};
fetch('https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY=",
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([
'kind' => 'value',
'name' => 'energy',
'value' => 42
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY="
payload := strings.NewReader("{\n \"kind\": \"value\",\n \"name\": \"energy\",\n \"value\": 42\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY=")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"value\",\n \"name\": \"energy\",\n \"value\": 42\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/ai/{experiment_id}/log_artifact?HAIQU_API_KEY=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"value\",\n \"name\": \"energy\",\n \"value\": 42\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Body
Define payload for logging experiment artifacts from MCP tools.
Logged artifact kinds are accepted on write, but MCP read endpoints expose a
normalized artifact view and do not preserve every submitted kind as a
distinct response shape.
Attributes:
name: Artifact key under which values are stored.
kind: Artifact serialization mode accepted by the logging endpoint.
value: Value payload for non-timeseries kinds.
points: Time series points used when kind='timeseries'.
Artifact type. Use text for strings, value for a single numeric value, timeseries for numeric points in points, list for JSON arrays, dict for JSON objects, and image for a base64 data URL such as data:image/png;base64,....
text, value, timeseries, list, dict, image, file Artifact payload for all kinds except timeseries. Send properly typed JSON values: string for text, number for value, array for list, object for dict, and a base64 data URL string for image. Leave this empty when kind is timeseries.
Time series points to log when kind is timeseries. Each item must have numeric x and y fields. Leave this empty for all other kinds.
Show child attributes
Show child attributes
Response
Successful Response