curl --request GET \
--url 'https://api.example.com/ai/{experiment_id}/artifact/download_url?HAIQU_API_KEY='import requests
url = "https://api.example.com/ai/{experiment_id}/artifact/download_url?HAIQU_API_KEY="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/ai/{experiment_id}/artifact/download_url?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}/artifact/download_url?HAIQU_API_KEY=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/ai/{experiment_id}/artifact/download_url?HAIQU_API_KEY="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/ai/{experiment_id}/artifact/download_url?HAIQU_API_KEY=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/ai/{experiment_id}/artifact/download_url?HAIQU_API_KEY=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"name": "<string>",
"download_url": "<string>",
"context": "<string>",
"mime_type": "<string>",
"requires_auth_header": false,
"expires_in_seconds": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Artifact Download Url In Experiment
Get a fetchable URL for the bytes of a binary artifact.
Use this tool when the caller needs the actual content of an image or file artifact, for example to view a plot logged during an experiment. Tool results are text, so this returns a URL to fetch rather than the bytes themselves.
When to Use:
- Call this after
list_artifacts_in_experimentorget_artifact_in_experimentidentifies an artifact whosekindis a media family such asimage, rather thanvalueortimeseries. - Call this when the user asks to see, open, or download a logged file or image.
Constraints:
- Scalar and timeseries artifacts carry their data in
get_artifact_in_experimentalready and are rejected here with422. - Pre-signed URLs expire. Re-call this tool instead of reusing a stale URL.
Notes:
- For artifacts stored inline rather than in object storage, the returned
URL is a relative API path and
requires_auth_headeris true, which means it must be fetched with the caller’sauthorizationheader. - Surface the URL to the user; do not attempt to inline binary content into agent-facing output.
Args: experiment_id: Parent experiment identifier. artifact_name: Artifact key within experiment metrics. user: Authenticated user resolved from the API key. db: Active database session.
Returns: The artifact name, MIME type, and a URL from which the bytes can be fetched.
Raises:
HTTPException: Raised with 404 when the experiment is unavailable to
the caller or the artifact key is missing, or 422 when the
artifact holds no binary content.
curl --request GET \
--url 'https://api.example.com/ai/{experiment_id}/artifact/download_url?HAIQU_API_KEY='import requests
url = "https://api.example.com/ai/{experiment_id}/artifact/download_url?HAIQU_API_KEY="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/ai/{experiment_id}/artifact/download_url?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}/artifact/download_url?HAIQU_API_KEY=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/ai/{experiment_id}/artifact/download_url?HAIQU_API_KEY="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/ai/{experiment_id}/artifact/download_url?HAIQU_API_KEY=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/ai/{experiment_id}/artifact/download_url?HAIQU_API_KEY=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"name": "<string>",
"download_url": "<string>",
"context": "<string>",
"mime_type": "<string>",
"requires_auth_header": false,
"expires_in_seconds": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Query Parameters
Response
Successful Response
Represent a fetchable location for artifact bytes.
MCP tool results are text, so artifact bytes are never inlined. This model hands back a URL the caller can fetch directly instead.
Attributes:
name: Artifact key within experiment metrics.
mime_type: MIME type of the stored artifact.
download_url: Absolute pre-signed URL for S3-backed artifacts, or the
relative API path for artifacts still stored inline.
requires_auth_header: Whether download_url needs the caller's
authorization header. Pre-signed URLs do not.
expires_in_seconds: Lifetime of a pre-signed URL, when applicable.
context: Guidance on how to use the returned URL.