!pip install vlmrun
from vlmrun.client import VLMRun
from vlmrun.client.types import PredictionResponse
client = VLMRun(api_key="<VLMRUN_API_KEY>")
response: PredictionResponse = client.predictions.get("<prediction_id>")
import { VlmRun } from "vlmrun";
const client = new VlmRun({ apiKey: "<VLMRUN_API_KEY>" });
const response = await client.predictions.get("<prediction_id>");
console.log(response);
{
"usage": {
"elements_processed": 123,
"element_type": "image",
"credits_used": 123,
"steps": 123,
"message": "<string>",
"duration_seconds": 0,
"service_tier": "<string>",
"mode_multiplier": 123,
"standard_cost_dollars": 123,
"cost_dollars": 123,
"savings_dollars": 123
},
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"response": "<unknown>",
"status": "pending",
"domain": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Get Prediction by ID
Get prediction JSON by request ID.
!pip install vlmrun
from vlmrun.client import VLMRun
from vlmrun.client.types import PredictionResponse
client = VLMRun(api_key="<VLMRUN_API_KEY>")
response: PredictionResponse = client.predictions.get("<prediction_id>")
import { VlmRun } from "vlmrun";
const client = new VlmRun({ apiKey: "<VLMRUN_API_KEY>" });
const response = await client.predictions.get("<prediction_id>");
console.log(response);
{
"usage": {
"elements_processed": 123,
"element_type": "image",
"credits_used": 123,
"steps": 123,
"message": "<string>",
"duration_seconds": 0,
"service_tier": "<string>",
"mode_multiplier": 123,
"standard_cost_dollars": 123,
"cost_dollars": 123,
"savings_dollars": 123
},
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"response": "<unknown>",
"status": "pending",
"domain": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}!pip install vlmrun
from vlmrun.client import VLMRun
from vlmrun.client.types import PredictionResponse
client = VLMRun(api_key="<VLMRUN_API_KEY>")
response: PredictionResponse = client.predictions.get("<prediction_id>")
import { VlmRun } from "vlmrun";
const client = new VlmRun({ apiKey: "<VLMRUN_API_KEY>" });
const response = await client.predictions.get("<prediction_id>");
console.log(response);
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Successful Response
Base prediction response for all API responses.
The usage metrics for the request.
Hide child attributes
Hide child attributes
Number of elements processed.
The type of element processed (e.g. image, page, video, audio).
image, page, video, audio Amount of total credits used.
Number of steps processed, in case of agentic execution.
The message from the credit usage job.
Duration of the request in seconds.
Delivery tier (standard, priority, flex).
Pricing multiplier applied to standard cost.
Pre-multiplier customer cost in USD, derived from tokens and unit rates.
Effective customer cost in USD after the service-tier multiplier.
Discount in USD when using flex (standard_cost_dollars - cost_dollars).
Unique identifier of the response.
Date and time when the request was created (in UTC timezone)
Date and time when the response was completed (in UTC timezone)
The response from the model. May be an empty dict/list when the model found no extractable content (valid for status=completed).
The status of the job.
pending, enqueued, running, completed, failed, paused The domain of the prediction (e.g. document.invoice, image.caption).