Skip to content
FLORA DocsGo to app

Get a technique run

client.techniques.runs.retrieve(stringrunID, RunRetrieveParams { techniqueId } params, RequestOptionsoptions?): RunRetrieveResponse { created_at, progress, run_id, 8 more }
GET/techniques/{techniqueId}/runs/{runId}

Returns status, progress, outputs, and error details for a technique run when it is accessible to the authenticated public API key.

ParametersExpand Collapse
runID: string

Run identifier

params: RunRetrieveParams { techniqueId }
techniqueId: string

Technique identifier or slug

minLength1
ReturnsExpand Collapse
RunRetrieveResponse { created_at, progress, run_id, 8 more }
created_at: number
progress: number
run_id: string

Run identifier

status: "pending" | "running" | "completed" | "failed"
One of the following:
"pending"
"running"
"completed"
"failed"
charged_cost?: number
completed_at?: number
error_code?: string

Machine-readable run error code

error_message?: string

Human-readable run error message

outputs?: Array<Output>
output_id: string

Run output identifier

type: "imageUrl" | "videoUrl" | "audioUrl" | 2 more

Run output media type

One of the following:
"imageUrl"
"videoUrl"
"audioUrl"
"text"
"documentUrl"
url: string

Run output URL

formaturi
poll_url?: string
formaturi
started_at?: number

Get a technique run

import Flora from '@flora-ai/flora';

const client = new Flora({
  apiKey: process.env['FLORA_API_KEY'], // This is the default and can be omitted
});

const run = await client.techniques.runs.retrieve('run_abc123', {
  techniqueId: 'art-directors-critique',
});

console.log(run.run_id);
{
  "created_at": 0,
  "progress": 0,
  "run_id": "run_abc123",
  "status": "pending",
  "charged_cost": 0,
  "completed_at": 0,
  "error_code": "provider_error",
  "error_message": "The provider failed to complete the generation.",
  "outputs": [
    {
      "output_id": "output_1",
      "type": "imageUrl",
      "url": "https://media.flora.ai/output.png"
    }
  ],
  "poll_url": "https://example.com",
  "started_at": 0
}
{
  "error": {
    "code": "input_validation_error",
    "message": "prompt: Required",
    "fields": [
      {
        "field": "prompt",
        "message": "Required"
      }
    ]
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid API key."
  }
}
{
  "error": {
    "code": "insufficient_credits",
    "message": "Insufficient credits."
  }
}
{
  "error": {
    "code": "forbidden",
    "message": "Forbidden."
  }
}
{
  "error": {
    "code": "not_found",
    "message": "Not found."
  }
}
{
  "error": {
    "code": "idempotency_duplicate",
    "message": "Duplicate idempotency key."
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded."
  }
}
{
  "error": {
    "code": "unknown_error",
    "message": "An unknown error occurred."
  }
}
Returns Examples
{
  "created_at": 0,
  "progress": 0,
  "run_id": "run_abc123",
  "status": "pending",
  "charged_cost": 0,
  "completed_at": 0,
  "error_code": "provider_error",
  "error_message": "The provider failed to complete the generation.",
  "outputs": [
    {
      "output_id": "output_1",
      "type": "imageUrl",
      "url": "https://media.flora.ai/output.png"
    }
  ],
  "poll_url": "https://example.com",
  "started_at": 0
}
{
  "error": {
    "code": "input_validation_error",
    "message": "prompt: Required",
    "fields": [
      {
        "field": "prompt",
        "message": "Required"
      }
    ]
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid API key."
  }
}
{
  "error": {
    "code": "insufficient_credits",
    "message": "Insufficient credits."
  }
}
{
  "error": {
    "code": "forbidden",
    "message": "Forbidden."
  }
}
{
  "error": {
    "code": "not_found",
    "message": "Not found."
  }
}
{
  "error": {
    "code": "idempotency_duplicate",
    "message": "Duplicate idempotency key."
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded."
  }
}
{
  "error": {
    "code": "unknown_error",
    "message": "An unknown error occurred."
  }
}