Skip to main content
GET
/
v1
/
prediction
/
{id}
Get Model Prediction
curl --request GET \
  --url https://api.eachlabs.ai/v1/prediction/{id} \
  --header 'X-API-Key: <api-key>'
import requests

url = "https://api.eachlabs.ai/v1/prediction/{id}"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://api.eachlabs.ai/v1/prediction/{id}', 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.eachlabs.ai/v1/prediction/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-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://api.eachlabs.ai/v1/prediction/{id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-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://api.eachlabs.ai/v1/prediction/{id}")
.header("X-API-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.eachlabs.ai/v1/prediction/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "id": "abc123-def456-ghi789",
  "input": {
    "prompt": "A beautiful sunset over the ocean with vibrant colors",
    "aspect_ratio": "16:9"
  },
  "status": "success",
  "output": "https://storage.example.com/predictions/abc123/image.jpg",
  "logs": null,
  "metrics": {
    "predict_time": 12.5,
    "cost": 0.05
  },
  "urls": {
    "cancel": "https://api.eachlabs.ai/v1/prediction/abc123-def456-ghi789/cancel",
    "get": "https://api.eachlabs.ai/v1/prediction/abc123-def456-ghi789"
  }
}
{
"error": "Prediction not found"
}
{
"error": "Failed to fetch models: internal error"
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Path Parameters

id
string
required

Prediction ID

Response

Prediction retrieved successfully

id
string

Unique prediction identifier

Example:

"abc123-def456-ghi789"

input
object

Input parameters used for the prediction

Example:
{
"prompt": "A beautiful sunset over the ocean with vibrant colors",
"aspect_ratio": "16:9"
}
status
enum<string>

Current status of the prediction. starting and processing are non-terminal. success, failed, and cancelled are terminal.

Available options:
starting,
processing,
success,
failed,
cancelled
Example:

"success"

output

Prediction output (type varies based on model)

Example:

"https://storage.example.com/predictions/abc123/image.jpg"

logs
string | null

Execution logs from the prediction

Example:

null

metrics
object

Performance and cost metrics

urls
object

Related API endpoints

Last modified on June 17, 2026