Get prompt run status
curl --request GET \
--url https://platform-api.trychainshift.ai/api/v1/platform/runs/{runID} \
--header 'API-Key: <api-key>'import requests
url = "https://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}"
headers = {"API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'API-Key': '<api-key>'}};
fetch('https://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}', 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://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>"
],
]);
$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://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}")
.header("API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"answers": [
{
"location": "US-NEW_YORK",
"model": "GEMINI",
"promptID": "fTZ200JfbMwpQDXPnS8isw",
"query": "How can we get our service to appear in AI search?",
"region": "KR",
"status": "SUCCESS"
}
],
"failedCount": 12,
"finishedCount": 5000,
"id": "S8cqDSjSot67bCK6YtmvHw",
"runningCount": 0,
"status": "FINISHED",
"successCount": 4988,
"totalCount": 5000
}{
"code": "COMMON_BINDING",
"details": [
"PLATFORM_INVALID_ID: Invalid ID format."
],
"message": "Unable to process the request data"
}{
"code": "COMMON_UNAUTHORIZED",
"message": "Unauthenticated user"
}{
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits."
}{
"code": "TASK_GENERATION_RUN_NOT_FOUND",
"message": "Task creation run record not found"
}{
"code": "PLATFORM_RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later."
}{
"message": "Internal Server Error",
"requestID": "bkZqnHQepkgTOocTvyHWSlHcGzRqQbZk"
}Runs
Get run status
Retrieves the progress status of the requested prompt run (runID), the total, finished, succeeded, failed, and running counts, and the detailed status of each item.
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | COMMON_BINDING | Invalid runID format (PLATFORM_INVALID_ID in details) |
| 401 | COMMON_UNAUTHORIZED | API key or access token is missing or invalid |
| 402 | INSUFFICIENT_CREDITS | The organization’s credit balance is lower than the unit price of this request |
| 404 | TASK_GENERATION_RUN_NOT_FOUND | The prompt run does not exist or belongs to another organization |
| 429 | PLATFORM_RATE_LIMIT_EXCEEDED | Rate limit exceeded. Wait the number of seconds in the Retry-After header, then retry |
| 500 | — | Internal server error. Returns message and requestID without code |
GET
/
v1
/
platform
/
runs
/
{runID}
Get prompt run status
curl --request GET \
--url https://platform-api.trychainshift.ai/api/v1/platform/runs/{runID} \
--header 'API-Key: <api-key>'import requests
url = "https://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}"
headers = {"API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'API-Key': '<api-key>'}};
fetch('https://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}', 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://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>"
],
]);
$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://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}")
.header("API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.trychainshift.ai/api/v1/platform/runs/{runID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"answers": [
{
"location": "US-NEW_YORK",
"model": "GEMINI",
"promptID": "fTZ200JfbMwpQDXPnS8isw",
"query": "How can we get our service to appear in AI search?",
"region": "KR",
"status": "SUCCESS"
}
],
"failedCount": 12,
"finishedCount": 5000,
"id": "S8cqDSjSot67bCK6YtmvHw",
"runningCount": 0,
"status": "FINISHED",
"successCount": 4988,
"totalCount": 5000
}{
"code": "COMMON_BINDING",
"details": [
"PLATFORM_INVALID_ID: Invalid ID format."
],
"message": "Unable to process the request data"
}{
"code": "COMMON_UNAUTHORIZED",
"message": "Unauthenticated user"
}{
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits."
}{
"code": "TASK_GENERATION_RUN_NOT_FOUND",
"message": "Task creation run record not found"
}{
"code": "PLATFORM_RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later."
}{
"message": "Internal Server Error",
"requestID": "bkZqnHQepkgTOocTvyHWSlHcGzRqQbZk"
}Poll about every 30 seconds until
status becomes FINISHED.
FAQ
Why is there no answer body? Theanswers field in this response only contains the progress of each run. For the body and sources, query List answers with the runID filter.
The status is FINISHED but failedCount is non-zero.
Even if individual runs fail, the run request ends as FINISHED. Failed runs produce no answer and are not charged.Path Parameters
Response
OK
Overall progress status of the prompt run. RUNNING: some items have not finished yet (runningCount > 0), FINISHED: all items have finished (finishedCount == totalCount). It transitions from RUNNING to FINISHED only once and never goes back. Right after submission, while run items are not yet prepared and totalCount is 0, the status is still RUNNING. The status becomes FINISHED once every item has finished even if some failed, so use successCount and failedCount to determine success
Available options:
RUNNING, FINISHED Example:
"FINISHED"