varg.ai Lineage API
Resolve which job produced a file
Resolve which job produced a file
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/varg-ai:varg-ai-lineage-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: varg Lineage API
version: 2.0.0
description: 'Unified REST API for AI media generation at `api.varg.ai/v2`.
One API key, ~80 models across 8 providers, async jobs, stable output URLs
on `s3.varg.ai`, files with lineage, and transparent billing: 1 credit =
1 cent = $0.01, and models are priced pass-through — you pay what the
provider charges, no markup. Every amount comes as integer credits
(`*_cents` / `credits` fields) and as dollars (`*_usd` fields).
**The async job pattern:** every generation request returns `202 Accepted`
with a job object (`status: queued`). Poll `GET /jobs/{id}` until the job
reaches a terminal status (`completed`, `failed`, or `cancelled`), then read
`output.outputs[0].url`. Alternatively, set `options.webhook_url` in the
request to receive an HMAC-signed callback when the job finishes.
**Rate limits** (sliding one-minute windows; a `429` carries `Retry-After`
and `X-RateLimit-*`):
- every request with an API key or session: 1,200 a minute per credential;
- every request without one: 120 a minute per IP;
- job submits: 60 a minute per key (300 across a team);
- keyless search (`GET /skills/search`): 3 a minute per IP, then
`429 sign_in_required` — sign in (`vargai login`) or send a key to keep
searching.'
servers:
- url: https://api.varg.ai/v2
security:
- bearerAuth: []
tags:
- name: Lineage
description: Resolve which job produced a file
paths:
/lineage:
post:
tags:
- Lineage
operationId: getLineage
summary: Resolve a file to the job that created it
description: 'Given a `file_id` or a varg URL, returns the job that produced the file
together with its recipe (prompt, model, tool, cost) — so an agent can
"create something similar". Send `file_id` or `url`; `file_id` wins when
both are present.'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
file_id:
type: string
url:
type: string
format: uri
anyOf:
- required:
- file_id
- required:
- url
examples:
by-id:
value:
file_id: file_abc123
by-url:
value:
url: https://s3.varg.ai/files/acc_x/file_abc.png
responses:
'200':
description: Lineage
content:
application/json:
schema:
type: object
properties:
file_id:
type: string
job_id:
type: string
tool:
type: string
description: Readable tool key (`image`, `video`, ...)
model:
type:
- string
- 'null'
prompt:
type:
- string
- 'null'
description: The main human-readable prompt (prompt, text or render code)
provider:
type:
- string
- 'null'
cost_cents:
type:
- integer
- 'null'
parent_job_id:
type:
- string
- 'null'
root_job_id:
type:
- string
- 'null'
children_count:
type: integer
total_cost_cents:
type:
- integer
- 'null'
description: This job plus every descendant
breakdown:
type: array
description: Present only when the job has children
items:
type: object
properties:
job_id:
type: string
tool:
type: string
model:
type:
- string
- 'null'
status:
type:
- string
- 'null'
cost_cents:
type: integer
is_root:
type: boolean
output_count:
type: integer
output_index:
type:
- integer
- 'null'
description: 1-based position among the job's outputs
primary_file_id:
type:
- string
- 'null'
created_at:
type: string
format: date-time
file:
type: object
properties:
url:
type: string
media_type:
type: string
size_bytes:
type: integer
width:
type: integer
height:
type: integer
duration_ms:
type: number
input:
type: object
description: The job's input with internal keys (`options`, `webhook_url`, `_*`) removed
required:
- file_id
- job_id
- tool
- model
- prompt
- provider
- cost_cents
- parent_job_id
- root_job_id
- children_count
- total_cost_cents
- output_count
- output_index
- primary_file_id
- created_at
- file
- input
'400':
description: Invalid JSON (`invalid_json`), or neither `file_id` nor `url` given (`missing_input`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
description: File not found (`file_not_found`), or no job linked to it (`no_lineage`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
ErrorResponse:
type: object
properties:
error:
type: object
properties:
code:
type: string
example: model_not_found
message:
type: string
example: 'Unknown model: flux-shnell'
details: {}
responses:
Unauthorized:
description: Missing or invalid API key / JWT
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
unauthorized:
value:
error:
code: unauthorized
message: Invalid or missing API key or JWT
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'varg API key (`varg_...`). Get one at [app.varg.ai](https://app.varg.ai)
or run `bunx vargai login`. App sessions may alternatively send a
Supabase JWT.
'