Skip to main content
GET
/
api
/
v1
/
promptruns
/
{id}
PromptJuggler PHP SDK
$run = $pj->getPromptRun('01J...');
const run = await pj.getPromptRun('01J...');
run = pj.get_prompt_run('01J...')
PromptRun run = pj.getPromptRun("01J...");
run, err := pj.GetPromptRun(ctx, "01J...")
curl --request GET \
--url https://promptjuggler.com/api/v1/promptruns/{id} \
--header 'Authorization: Bearer <token>'
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://promptjuggler.com/api/v1/promptruns/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
require 'uri'
require 'net/http'

url = URI("https://promptjuggler.com/api/v1/promptruns/{id}")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "finishedAt": "2023-11-07T05:31:56Z",
  "output": "<string>",
  "error": "<string>",
  "tokenUsage": {
    "input": 123,
    "inputCached": 123,
    "output": 123,
    "reasoning": 123,
    "total": 123
  },
  "cost": {
    "success": {
      "input": 123,
      "cachedInput": 123,
      "output": 123,
      "webSearch": 123,
      "total": 123
    },
    "retries": {
      "input": 123,
      "cachedInput": 123,
      "output": 123,
      "webSearch": 123,
      "total": 123
    },
    "total": 123
  }
}
{
"error": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string<uuid>
required

Prompt run ID

Response

Prompt Run

Prompt run status and result.

id
string<uuid>
required

Prompt run ID.

status
enum<string>
required

Current run status.

Available options:
pending,
completed,
failed
createdAt
string<date-time>
required

Timestamp when the run was created.

finishedAt
string<date-time> | null

Timestamp when the run finished. Null while the run is pending.

output
string | null

LLM output text. Null while pending or when the run failed.

error
string | null

Error message if the run failed. Null on success.

tokenUsage
object | null

Token usage for the successful run. Null while pending or when the run failed.

cost
object | null

Cost breakdown for the run. Null while pending.