Skip to main content
GET
/
studio
/
v1
/
maestro
/
runs
/
{run_id}
from ai21 import AI21Client

client = AI21Client(api_key="your-api-key")  # Replace with your API key

run_id = "your_run_id_here"

# Retrieve the Maestro run by ID
retrieved_run = client.beta.maestro.runs.retrieve(run_id)

print(retrieved_run)
const runId = "your_run_id_here";

fetch(`https://api.ai21.com/studio/v1/maestro/runs/${runId}`, {
  method: "GET",
  headers: {
    "Authorization": "Bearer your-api-key",
    "Content-Type": "application/json"
  }
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));
<?php

$run_id = "your_run_id_here";

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.ai21.com/studio/v1/maestro/runs/$run_id",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer your-api-key",
        "Content-Type: application/json"
    ],
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
    echo "cURL Error: " . $error;
} else {
    echo $response;
}
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    runID := "your_run_id_here"
    url := fmt.Sprintf("https://api.ai21.com/studio/v1/maestro/runs/%s", runID)

    req, err := http.NewRequest("GET", url, nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer your-api-key")
    req.Header.Add("Content-Type", "application/json")

    res, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println("Status:", res.Status)
    fmt.Println("Response:", string(body))
}
curl --request GET \
  --url https://api.ai21.com/studio/v1/maestro/runs/{run_id} \
  --header "Authorization: Bearer your-api-key" \
  --header "Content-Type: application/json"
String runId = "your_run_id_here";

HttpResponse<String> response = Unirest.get("https://api.ai21.com/studio/v1/maestro/runs/" + runId)
    .header("Authorization", "Bearer your-api-key")
    .header("Content-Type", "application/json")
    .asString();

System.out.println(response.getBody());

Path parameters

run_id
string
A unique identifier of the run you wish to retrieve.

Returns

The run object matches the specified ID.
from ai21 import AI21Client

client = AI21Client(api_key="your-api-key")  # Replace with your API key

run_id = "your_run_id_here"

# Retrieve the Maestro run by ID
retrieved_run = client.beta.maestro.runs.retrieve(run_id)

print(retrieved_run)
const runId = "your_run_id_here";

fetch(`https://api.ai21.com/studio/v1/maestro/runs/${runId}`, {
  method: "GET",
  headers: {
    "Authorization": "Bearer your-api-key",
    "Content-Type": "application/json"
  }
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));
<?php

$run_id = "your_run_id_here";

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.ai21.com/studio/v1/maestro/runs/$run_id",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer your-api-key",
        "Content-Type: application/json"
    ],
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
    echo "cURL Error: " . $error;
} else {
    echo $response;
}
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    runID := "your_run_id_here"
    url := fmt.Sprintf("https://api.ai21.com/studio/v1/maestro/runs/%s", runID)

    req, err := http.NewRequest("GET", url, nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer your-api-key")
    req.Header.Add("Content-Type", "application/json")

    res, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println("Status:", res.Status)
    fmt.Println("Response:", string(body))
}
curl --request GET \
  --url https://api.ai21.com/studio/v1/maestro/runs/{run_id} \
  --header "Authorization: Bearer your-api-key" \
  --header "Content-Type: application/json"
String runId = "your_run_id_here";

HttpResponse<String> response = Unirest.get("https://api.ai21.com/studio/v1/maestro/runs/" + runId)
    .header("Authorization", "Bearer your-api-key")
    .header("Content-Type", "application/json")
    .asString();

System.out.println(response.getBody());