批量操作
批量操作
POST /media/v1/libraries/{library_id}/batches
| 参数 | 位置 | 类型 | 说明 |
|---|---|---|---|
| library_id | path | string | 库 ID |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "tag" / "untag" | 是 | 批量操作 |
| tags | string[] | 是 | 素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "set_context" | 是 | 批量操作 |
| context | object | 是 | 自定义文字键值;PATCH 整体替换,传 {} 清空 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "move" | 是 | 批量操作 |
| asset_folder | string | 是 | 组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "delete" | 是 | 批量操作 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "reprocess" | 是 | 批量操作 |
| kinds | ProcessingKind[] | 否 | 各项处理状态 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| selector | BatchSelector | 是 | 按 ID 或表达式选择 |
| reason | string | 否 | — |
返回: Job.
响应
HTTP 200
Successful response.
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Job identifier: job_ followed by 32 lowercase hexadecimal characters. Poll it with jobs.retrieve. |
| library_id | string | Identifier of the library the job runs in; the produced assets land here. |
| action | string | Batch operation: tag adds labels, untag removes labels, set_context replaces custom metadata, move changes asset_folder, and delete removes selected assets. reprocess starts fenced understanding Workflows for retryable failed steps and legacy source-size unsupported steps; kinds narrows the selection. Other unsupported and permanent steps remain unchanged. |
| status | string | Where the job is. A generation job moves queued, then in_progress, then ends as completed (every output succeeded), failed (no output succeeded) or canceled (stopped by a caller). Keep polling until it is completed, failed or canceled; do not stop at queued. Batch jobs and generation jobs written earlier use running, completed_with_errors and cancelled for the same states, and a job some of whose outputs succeeded answers completed with those outputs marked failed in failures. |
| type | string | Category of media this job produces. Image jobs answer image and video jobs answer video; omitted for batch jobs, which change existing assets rather than producing new media. |
| operation | string | The operation this job performs: generate for a plain text-to-image or text-to-video job, or the edit operation an image edit applied to its source asset. Omitted for batch jobs. |
| source_asset_id | string | Asset this job edits, present on an image edit job and omitted on generation jobs. The produced asset records the same asset in its derived_from field; use assets.lineage for the whole edit tree. |
| progress | number | Fraction of this job already processed, from 0 to 1. Poll the job or read its done and total counts to observe progress; do not treat this value as a percentage. |
| queue_reason | string | Why a queued generation job has not started yet. queue_reason is omitted once the job starts. |
| queue_position | number | Present while the job waits for a slot (queue_reason concurrency): its place in line among the waiting jobs of its type in this library, 1 for the next to start. Waiting jobs start oldest first; keep polling the job, there is nothing to resubmit. |
| total | number | Generation job: number of outputs requested (images or videos; text segments for speech). Batch job: number of distinct assets selected when the job was created. |
| done | number | Number of outputs or items successfully processed; failed ones are counted separately. For reprocess, this counts accepted launches; inspect asset progress for model completion. |
| failed | number | Number of outputs or items that could not be produced or processed. |
| failures | array<object> | Always present, including an empty array before any item failure or when all items succeed. At most 20 item failures are returned. |
| failures[].asset_id | string | Identifier supplied for the failed item; it may identify a missing asset. |
| failures[].index | integer | Zero-based output index for a failed video-generation item. |
| failures[].code | string | Domain error code explaining the individual item failure. |
| failures[].detail_code | string | The upstream model service’s finer reason for this failure, such as MODEL_PROTOCOL_LINE_UNAVAILABLE or VOICE_SAMPLE_REJECTED. Present when the failure came from a model call, and SHORT_DELIVERY when the model returned fewer outputs than asked (Media’s own, since no upstream code exists); code stays the media error code to branch on: CONTENT_REJECTED, INVALID_PARAMS, UPSTREAM_FAILED and RATE_LIMITED classify the refusal, GENERATION_FAILED is the rest. |
| failures[].model_request_id | string | Request id of the model call that failed, the same id shown in the model request log, so the failure can be traced there. Present only when the failure came from a model call. |
| failures[].message | string | The model service’s own words for this failure, for a person to read, for example why moderation refused an input. Present only when the failure came from a model call; branch on code, not on this text. |
| intent | string | Generation intent recorded on the earliest video jobs; newer generation jobs describe themselves with type and operation instead. |
| model | string | Model that produced the outputs of a generation job; omitted for batch jobs. |
| tier | string | The performance tier that actually served this job’s model, present only when the request named a tier instead of a model. It is the tier that ran: a balanced request that a capability answers with its economy model reports economy, so a caller can see what it got. model keeps its own meaning and value alongside it. |
| outputs | array<object> | Per-output results of a generation job, in index order: one entry per requested image or video, and one per text segment for speech. Every successful output is already a library asset, and its viewer_url opens it in the Console. |
| outputs[].index | integer | Zero-based position of this output in the requested count. |
| outputs[].status | string | State of this requested output. |
| outputs[].preview_url | string | Short-lived signed URL for previewing this output; read the Job again to obtain a fresh URL. |
| outputs[].seed | number | null | Seed for this output, when the model returned one; it may be absent. |
| outputs[].expires_at | string | Present only on a job written before ADR-094 §2, when outputs were candidates with a retention window. New outputs land in the library as assets and never expire. |
| outputs[].asset_id | string | Library asset identifier for this output once the library has stored it. |
| outputs[].viewer_url | string | Console page that shows this output in the media library, present once asset_id is. Give this link to the person; the asset_id alone does not open anywhere. Example: https://console.deepraxis.com/media/lib_example?asset_id=9dfa312ef9bc4b00816339b598b1152c. |
| usage | object | What this job has been charged, as US dollars in a decimal string with six decimals, for example 0.042300. It is the sum of what the model calls cost, so it can be partial while the job is in_progress and is final once the status is completed or failed. Tell the person this amount. Absent when nothing was charged: every output failed, was refused, or was canceled before a paid call finished. Failed and refused outputs are never charged, so in a job where some outputs failed it counts the succeeded ones only. |
| usage.amount | string | US dollars as a decimal string with six decimals, for example 0.042300; never a floating-point number. |
| usage.currency | string | Currency code for amount; USD. |
| created_at | string | Time the job was created, in UTC. |
| finished_at | string | null | Time the job reached a terminal status, or null while queued or running. |
| pipeline_run_id | string | Automation run (its root run) that started this job. Omitted when the job was not started by a pipeline. Filter jobs by it with the pipeline_run_id query parameter. |
| elements | array<object> | Generation jobs only: the elements the job’s request expanded, each with the version read when the job was created; absent when none were. Same records as the outputs’ provenance.elements. A request that named no element answers no elements key. |
| elements[].asset_id | string | Element asset the generation expanded, in the same library as the output. |
| elements[].version | number | Element version read when the job was created. Replaying the same Idempotency-Key after the element changed is refused as a different request. |
| elements[].material_type | string | Kind of element. character, product and scene contribute their pictures and guidance; brand contributes guidance and palette only, never a picture. |
| result | object | Present on a completed align job: how the two recordings line up, with offset_seconds and confidence. Absent on every job that produced assets instead of a fact. |
| result.offset_seconds | number | How many seconds later the reference asset starts, relative to the source asset the route named; positive means the reference comes later, so a caller holding both recordings knows which one to slide. It is the negation of the model’s own lag, decided once in the domain. |
| result.confidence | number | How sure the alignment is, from 0 to 1; a low value means the two recordings share little to correlate. |
curl -X POST "https://api.deepraxis.com/media/v1/libraries/${LIBRARY_ID}/batches" \ -H "Authorization: Bearer $PRAXIS_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"action":"tag","tags":["sample"],"selector":{"ids":["2c25673fd03c41929a22fe860b33d920"]}}'HTTP 200
{ "id": "job_1c30b97a33cb40dc8f3467a31de1160c", "library_id": "lib_200f2b495e5f456194e746d66a3a8999", "action": "tag", "status": "queued", "total": 1, "done": 0, "failed": 0, "created_at": "2026-11-13T06:16:58.273Z", "failures": [], "finished_at": null}读取任务
GET /media/v1/libraries/{library_id}/batches/{job_id}
| 参数 | 位置 | 类型 | 说明 |
|---|---|---|---|
| library_id | path | string | 库 ID |
| job_id | path | string | 任务 ID |
返回: Job.
响应
HTTP 200
Successful response.
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Job identifier: job_ followed by 32 lowercase hexadecimal characters. Poll it with jobs.retrieve. |
| library_id | string | Identifier of the library the job runs in; the produced assets land here. |
| action | string | Batch operation: tag adds labels, untag removes labels, set_context replaces custom metadata, move changes asset_folder, and delete removes selected assets. reprocess starts fenced understanding Workflows for retryable failed steps and legacy source-size unsupported steps; kinds narrows the selection. Other unsupported and permanent steps remain unchanged. |
| status | string | Where the job is. A generation job moves queued, then in_progress, then ends as completed (every output succeeded), failed (no output succeeded) or canceled (stopped by a caller). Keep polling until it is completed, failed or canceled; do not stop at queued. Batch jobs and generation jobs written earlier use running, completed_with_errors and cancelled for the same states, and a job some of whose outputs succeeded answers completed with those outputs marked failed in failures. |
| type | string | Category of media this job produces. Image jobs answer image and video jobs answer video; omitted for batch jobs, which change existing assets rather than producing new media. |
| operation | string | The operation this job performs: generate for a plain text-to-image or text-to-video job, or the edit operation an image edit applied to its source asset. Omitted for batch jobs. |
| source_asset_id | string | Asset this job edits, present on an image edit job and omitted on generation jobs. The produced asset records the same asset in its derived_from field; use assets.lineage for the whole edit tree. |
| progress | number | Fraction of this job already processed, from 0 to 1. Poll the job or read its done and total counts to observe progress; do not treat this value as a percentage. |
| queue_reason | string | Why a queued generation job has not started yet. queue_reason is omitted once the job starts. |
| queue_position | number | Present while the job waits for a slot (queue_reason concurrency): its place in line among the waiting jobs of its type in this library, 1 for the next to start. Waiting jobs start oldest first; keep polling the job, there is nothing to resubmit. |
| total | number | Generation job: number of outputs requested (images or videos; text segments for speech). Batch job: number of distinct assets selected when the job was created. |
| done | number | Number of outputs or items successfully processed; failed ones are counted separately. For reprocess, this counts accepted launches; inspect asset progress for model completion. |
| failed | number | Number of outputs or items that could not be produced or processed. |
| failures | array<object> | Always present, including an empty array before any item failure or when all items succeed. At most 20 item failures are returned. |
| failures[].asset_id | string | Identifier supplied for the failed item; it may identify a missing asset. |
| failures[].index | integer | Zero-based output index for a failed video-generation item. |
| failures[].code | string | Domain error code explaining the individual item failure. |
| failures[].detail_code | string | The upstream model service’s finer reason for this failure, such as MODEL_PROTOCOL_LINE_UNAVAILABLE or VOICE_SAMPLE_REJECTED. Present when the failure came from a model call, and SHORT_DELIVERY when the model returned fewer outputs than asked (Media’s own, since no upstream code exists); code stays the media error code to branch on: CONTENT_REJECTED, INVALID_PARAMS, UPSTREAM_FAILED and RATE_LIMITED classify the refusal, GENERATION_FAILED is the rest. |
| failures[].model_request_id | string | Request id of the model call that failed, the same id shown in the model request log, so the failure can be traced there. Present only when the failure came from a model call. |
| failures[].message | string | The model service’s own words for this failure, for a person to read, for example why moderation refused an input. Present only when the failure came from a model call; branch on code, not on this text. |
| intent | string | Generation intent recorded on the earliest video jobs; newer generation jobs describe themselves with type and operation instead. |
| model | string | Model that produced the outputs of a generation job; omitted for batch jobs. |
| tier | string | The performance tier that actually served this job’s model, present only when the request named a tier instead of a model. It is the tier that ran: a balanced request that a capability answers with its economy model reports economy, so a caller can see what it got. model keeps its own meaning and value alongside it. |
| outputs | array<object> | Per-output results of a generation job, in index order: one entry per requested image or video, and one per text segment for speech. Every successful output is already a library asset, and its viewer_url opens it in the Console. |
| outputs[].index | integer | Zero-based position of this output in the requested count. |
| outputs[].status | string | State of this requested output. |
| outputs[].preview_url | string | Short-lived signed URL for previewing this output; read the Job again to obtain a fresh URL. |
| outputs[].seed | number | null | Seed for this output, when the model returned one; it may be absent. |
| outputs[].expires_at | string | Present only on a job written before ADR-094 §2, when outputs were candidates with a retention window. New outputs land in the library as assets and never expire. |
| outputs[].asset_id | string | Library asset identifier for this output once the library has stored it. |
| outputs[].viewer_url | string | Console page that shows this output in the media library, present once asset_id is. Give this link to the person; the asset_id alone does not open anywhere. Example: https://console.deepraxis.com/media/lib_example?asset_id=9dfa312ef9bc4b00816339b598b1152c. |
| usage | object | What this job has been charged, as US dollars in a decimal string with six decimals, for example 0.042300. It is the sum of what the model calls cost, so it can be partial while the job is in_progress and is final once the status is completed or failed. Tell the person this amount. Absent when nothing was charged: every output failed, was refused, or was canceled before a paid call finished. Failed and refused outputs are never charged, so in a job where some outputs failed it counts the succeeded ones only. |
| usage.amount | string | US dollars as a decimal string with six decimals, for example 0.042300; never a floating-point number. |
| usage.currency | string | Currency code for amount; USD. |
| created_at | string | Time the job was created, in UTC. |
| finished_at | string | null | Time the job reached a terminal status, or null while queued or running. |
| pipeline_run_id | string | Automation run (its root run) that started this job. Omitted when the job was not started by a pipeline. Filter jobs by it with the pipeline_run_id query parameter. |
| elements | array<object> | Generation jobs only: the elements the job’s request expanded, each with the version read when the job was created; absent when none were. Same records as the outputs’ provenance.elements. A request that named no element answers no elements key. |
| elements[].asset_id | string | Element asset the generation expanded, in the same library as the output. |
| elements[].version | number | Element version read when the job was created. Replaying the same Idempotency-Key after the element changed is refused as a different request. |
| elements[].material_type | string | Kind of element. character, product and scene contribute their pictures and guidance; brand contributes guidance and palette only, never a picture. |
| result | object | Present on a completed align job: how the two recordings line up, with offset_seconds and confidence. Absent on every job that produced assets instead of a fact. |
| result.offset_seconds | number | How many seconds later the reference asset starts, relative to the source asset the route named; positive means the reference comes later, so a caller holding both recordings knows which one to slide. It is the negation of the model’s own lag, decided once in the domain. |
| result.confidence | number | How sure the alignment is, from 0 to 1; a low value means the two recordings share little to correlate. |
curl -X GET "https://api.deepraxis.com/media/v1/libraries/${LIBRARY_ID}/batches/job_1c30b97a33cb40dc8f3467a31de1160c" \ -H "Authorization: Bearer $PRAXIS_API_KEY"HTTP 200
{ "id": "job_1c30b97a33cb40dc8f3467a31de1160c", "library_id": "lib_200f2b495e5f456194e746d66a3a8999", "action": "tag", "status": "completed", "total": 1, "done": 1, "failed": 0, "created_at": "2026-11-13T06:16:58.273Z", "failures": [], "finished_at": "2026-11-13T06:16:58.320Z"}批量操作别名
POST /media/v1/libraries/{library_id}/assets:batch
| 参数 | 位置 | 类型 | 说明 |
|---|---|---|---|
| library_id | path | string | 库 ID |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "tag" / "untag" | 是 | 批量操作 |
| tags | string[] | 是 | 素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "set_context" | 是 | 批量操作 |
| context | object | 是 | 自定义文字键值;PATCH 整体替换,传 {} 清空 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "move" | 是 | 批量操作 |
| asset_folder | string | 是 | 组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "delete" | 是 | 批量操作 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "reprocess" | 是 | 批量操作 |
| kinds | ProcessingKind[] | 否 | 各项处理状态 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| selector | BatchSelector | 是 | 按 ID 或表达式选择 |
| reason | string | 否 | — |
返回: Job.
响应
HTTP 200
Successful response.
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Job identifier: job_ followed by 32 lowercase hexadecimal characters. Poll it with jobs.retrieve. |
| library_id | string | Identifier of the library the job runs in; the produced assets land here. |
| action | string | Batch operation: tag adds labels, untag removes labels, set_context replaces custom metadata, move changes asset_folder, and delete removes selected assets. reprocess starts fenced understanding Workflows for retryable failed steps and legacy source-size unsupported steps; kinds narrows the selection. Other unsupported and permanent steps remain unchanged. |
| status | string | Where the job is. A generation job moves queued, then in_progress, then ends as completed (every output succeeded), failed (no output succeeded) or canceled (stopped by a caller). Keep polling until it is completed, failed or canceled; do not stop at queued. Batch jobs and generation jobs written earlier use running, completed_with_errors and cancelled for the same states, and a job some of whose outputs succeeded answers completed with those outputs marked failed in failures. |
| type | string | Category of media this job produces. Image jobs answer image and video jobs answer video; omitted for batch jobs, which change existing assets rather than producing new media. |
| operation | string | The operation this job performs: generate for a plain text-to-image or text-to-video job, or the edit operation an image edit applied to its source asset. Omitted for batch jobs. |
| source_asset_id | string | Asset this job edits, present on an image edit job and omitted on generation jobs. The produced asset records the same asset in its derived_from field; use assets.lineage for the whole edit tree. |
| progress | number | Fraction of this job already processed, from 0 to 1. Poll the job or read its done and total counts to observe progress; do not treat this value as a percentage. |
| queue_reason | string | Why a queued generation job has not started yet. queue_reason is omitted once the job starts. |
| queue_position | number | Present while the job waits for a slot (queue_reason concurrency): its place in line among the waiting jobs of its type in this library, 1 for the next to start. Waiting jobs start oldest first; keep polling the job, there is nothing to resubmit. |
| total | number | Generation job: number of outputs requested (images or videos; text segments for speech). Batch job: number of distinct assets selected when the job was created. |
| done | number | Number of outputs or items successfully processed; failed ones are counted separately. For reprocess, this counts accepted launches; inspect asset progress for model completion. |
| failed | number | Number of outputs or items that could not be produced or processed. |
| failures | array<object> | Always present, including an empty array before any item failure or when all items succeed. At most 20 item failures are returned. |
| failures[].asset_id | string | Identifier supplied for the failed item; it may identify a missing asset. |
| failures[].index | integer | Zero-based output index for a failed video-generation item. |
| failures[].code | string | Domain error code explaining the individual item failure. |
| failures[].detail_code | string | The upstream model service’s finer reason for this failure, such as MODEL_PROTOCOL_LINE_UNAVAILABLE or VOICE_SAMPLE_REJECTED. Present when the failure came from a model call, and SHORT_DELIVERY when the model returned fewer outputs than asked (Media’s own, since no upstream code exists); code stays the media error code to branch on: CONTENT_REJECTED, INVALID_PARAMS, UPSTREAM_FAILED and RATE_LIMITED classify the refusal, GENERATION_FAILED is the rest. |
| failures[].model_request_id | string | Request id of the model call that failed, the same id shown in the model request log, so the failure can be traced there. Present only when the failure came from a model call. |
| failures[].message | string | The model service’s own words for this failure, for a person to read, for example why moderation refused an input. Present only when the failure came from a model call; branch on code, not on this text. |
| intent | string | Generation intent recorded on the earliest video jobs; newer generation jobs describe themselves with type and operation instead. |
| model | string | Model that produced the outputs of a generation job; omitted for batch jobs. |
| tier | string | The performance tier that actually served this job’s model, present only when the request named a tier instead of a model. It is the tier that ran: a balanced request that a capability answers with its economy model reports economy, so a caller can see what it got. model keeps its own meaning and value alongside it. |
| outputs | array<object> | Per-output results of a generation job, in index order: one entry per requested image or video, and one per text segment for speech. Every successful output is already a library asset, and its viewer_url opens it in the Console. |
| outputs[].index | integer | Zero-based position of this output in the requested count. |
| outputs[].status | string | State of this requested output. |
| outputs[].preview_url | string | Short-lived signed URL for previewing this output; read the Job again to obtain a fresh URL. |
| outputs[].seed | number | null | Seed for this output, when the model returned one; it may be absent. |
| outputs[].expires_at | string | Present only on a job written before ADR-094 §2, when outputs were candidates with a retention window. New outputs land in the library as assets and never expire. |
| outputs[].asset_id | string | Library asset identifier for this output once the library has stored it. |
| outputs[].viewer_url | string | Console page that shows this output in the media library, present once asset_id is. Give this link to the person; the asset_id alone does not open anywhere. Example: https://console.deepraxis.com/media/lib_example?asset_id=9dfa312ef9bc4b00816339b598b1152c. |
| usage | object | What this job has been charged, as US dollars in a decimal string with six decimals, for example 0.042300. It is the sum of what the model calls cost, so it can be partial while the job is in_progress and is final once the status is completed or failed. Tell the person this amount. Absent when nothing was charged: every output failed, was refused, or was canceled before a paid call finished. Failed and refused outputs are never charged, so in a job where some outputs failed it counts the succeeded ones only. |
| usage.amount | string | US dollars as a decimal string with six decimals, for example 0.042300; never a floating-point number. |
| usage.currency | string | Currency code for amount; USD. |
| created_at | string | Time the job was created, in UTC. |
| finished_at | string | null | Time the job reached a terminal status, or null while queued or running. |
| pipeline_run_id | string | Automation run (its root run) that started this job. Omitted when the job was not started by a pipeline. Filter jobs by it with the pipeline_run_id query parameter. |
| elements | array<object> | Generation jobs only: the elements the job’s request expanded, each with the version read when the job was created; absent when none were. Same records as the outputs’ provenance.elements. A request that named no element answers no elements key. |
| elements[].asset_id | string | Element asset the generation expanded, in the same library as the output. |
| elements[].version | number | Element version read when the job was created. Replaying the same Idempotency-Key after the element changed is refused as a different request. |
| elements[].material_type | string | Kind of element. character, product and scene contribute their pictures and guidance; brand contributes guidance and palette only, never a picture. |
| result | object | Present on a completed align job: how the two recordings line up, with offset_seconds and confidence. Absent on every job that produced assets instead of a fact. |
| result.offset_seconds | number | How many seconds later the reference asset starts, relative to the source asset the route named; positive means the reference comes later, so a caller holding both recordings knows which one to slide. It is the negation of the model’s own lag, decided once in the domain. |
| result.confidence | number | How sure the alignment is, from 0 to 1; a low value means the two recordings share little to correlate. |
curl -X POST "https://api.deepraxis.com/media/v1/libraries/${LIBRARY_ID}/assets:batch" \ -H "Authorization: Bearer $PRAXIS_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"action":"tag","tags":["docs"],"selector":{"ids":["0b189e47017149e5aea17955ada66d31"]}}'HTTP 200
{ "id": "job_d3d8539613874085ae39b3d14f446d32", "library_id": "lib_ab7c545e85994e108974c89aa2078cf8", "action": "tag", "status": "queued", "total": 1, "done": 0, "failed": 0, "created_at": "2026-11-13T06:17:14.445Z", "failures": [], "finished_at": null}读取任务别名
GET /media/v1/libraries/{library_id}/jobs/{job_id}
| 参数 | 位置 | 类型 | 说明 |
|---|---|---|---|
| library_id | path | string | 库 ID |
| job_id | path | string | 任务 ID |
返回: Job.
响应
HTTP 200
Successful response.
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Job identifier: job_ followed by 32 lowercase hexadecimal characters. Poll it with jobs.retrieve. |
| library_id | string | Identifier of the library the job runs in; the produced assets land here. |
| action | string | Batch operation: tag adds labels, untag removes labels, set_context replaces custom metadata, move changes asset_folder, and delete removes selected assets. reprocess starts fenced understanding Workflows for retryable failed steps and legacy source-size unsupported steps; kinds narrows the selection. Other unsupported and permanent steps remain unchanged. |
| status | string | Where the job is. A generation job moves queued, then in_progress, then ends as completed (every output succeeded), failed (no output succeeded) or canceled (stopped by a caller). Keep polling until it is completed, failed or canceled; do not stop at queued. Batch jobs and generation jobs written earlier use running, completed_with_errors and cancelled for the same states, and a job some of whose outputs succeeded answers completed with those outputs marked failed in failures. |
| type | string | Category of media this job produces. Image jobs answer image and video jobs answer video; omitted for batch jobs, which change existing assets rather than producing new media. |
| operation | string | The operation this job performs: generate for a plain text-to-image or text-to-video job, or the edit operation an image edit applied to its source asset. Omitted for batch jobs. |
| source_asset_id | string | Asset this job edits, present on an image edit job and omitted on generation jobs. The produced asset records the same asset in its derived_from field; use assets.lineage for the whole edit tree. |
| progress | number | Fraction of this job already processed, from 0 to 1. Poll the job or read its done and total counts to observe progress; do not treat this value as a percentage. |
| queue_reason | string | Why a queued generation job has not started yet. queue_reason is omitted once the job starts. |
| queue_position | number | Present while the job waits for a slot (queue_reason concurrency): its place in line among the waiting jobs of its type in this library, 1 for the next to start. Waiting jobs start oldest first; keep polling the job, there is nothing to resubmit. |
| total | number | Generation job: number of outputs requested (images or videos; text segments for speech). Batch job: number of distinct assets selected when the job was created. |
| done | number | Number of outputs or items successfully processed; failed ones are counted separately. For reprocess, this counts accepted launches; inspect asset progress for model completion. |
| failed | number | Number of outputs or items that could not be produced or processed. |
| failures | array<object> | Always present, including an empty array before any item failure or when all items succeed. At most 20 item failures are returned. |
| failures[].asset_id | string | Identifier supplied for the failed item; it may identify a missing asset. |
| failures[].index | integer | Zero-based output index for a failed video-generation item. |
| failures[].code | string | Domain error code explaining the individual item failure. |
| failures[].detail_code | string | The upstream model service’s finer reason for this failure, such as MODEL_PROTOCOL_LINE_UNAVAILABLE or VOICE_SAMPLE_REJECTED. Present when the failure came from a model call, and SHORT_DELIVERY when the model returned fewer outputs than asked (Media’s own, since no upstream code exists); code stays the media error code to branch on: CONTENT_REJECTED, INVALID_PARAMS, UPSTREAM_FAILED and RATE_LIMITED classify the refusal, GENERATION_FAILED is the rest. |
| failures[].model_request_id | string | Request id of the model call that failed, the same id shown in the model request log, so the failure can be traced there. Present only when the failure came from a model call. |
| failures[].message | string | The model service’s own words for this failure, for a person to read, for example why moderation refused an input. Present only when the failure came from a model call; branch on code, not on this text. |
| intent | string | Generation intent recorded on the earliest video jobs; newer generation jobs describe themselves with type and operation instead. |
| model | string | Model that produced the outputs of a generation job; omitted for batch jobs. |
| tier | string | The performance tier that actually served this job’s model, present only when the request named a tier instead of a model. It is the tier that ran: a balanced request that a capability answers with its economy model reports economy, so a caller can see what it got. model keeps its own meaning and value alongside it. |
| outputs | array<object> | Per-output results of a generation job, in index order: one entry per requested image or video, and one per text segment for speech. Every successful output is already a library asset, and its viewer_url opens it in the Console. |
| outputs[].index | integer | Zero-based position of this output in the requested count. |
| outputs[].status | string | State of this requested output. |
| outputs[].preview_url | string | Short-lived signed URL for previewing this output; read the Job again to obtain a fresh URL. |
| outputs[].seed | number | null | Seed for this output, when the model returned one; it may be absent. |
| outputs[].expires_at | string | Present only on a job written before ADR-094 §2, when outputs were candidates with a retention window. New outputs land in the library as assets and never expire. |
| outputs[].asset_id | string | Library asset identifier for this output once the library has stored it. |
| outputs[].viewer_url | string | Console page that shows this output in the media library, present once asset_id is. Give this link to the person; the asset_id alone does not open anywhere. Example: https://console.deepraxis.com/media/lib_example?asset_id=9dfa312ef9bc4b00816339b598b1152c. |
| usage | object | What this job has been charged, as US dollars in a decimal string with six decimals, for example 0.042300. It is the sum of what the model calls cost, so it can be partial while the job is in_progress and is final once the status is completed or failed. Tell the person this amount. Absent when nothing was charged: every output failed, was refused, or was canceled before a paid call finished. Failed and refused outputs are never charged, so in a job where some outputs failed it counts the succeeded ones only. |
| usage.amount | string | US dollars as a decimal string with six decimals, for example 0.042300; never a floating-point number. |
| usage.currency | string | Currency code for amount; USD. |
| created_at | string | Time the job was created, in UTC. |
| finished_at | string | null | Time the job reached a terminal status, or null while queued or running. |
| pipeline_run_id | string | Automation run (its root run) that started this job. Omitted when the job was not started by a pipeline. Filter jobs by it with the pipeline_run_id query parameter. |
| elements | array<object> | Generation jobs only: the elements the job’s request expanded, each with the version read when the job was created; absent when none were. Same records as the outputs’ provenance.elements. A request that named no element answers no elements key. |
| elements[].asset_id | string | Element asset the generation expanded, in the same library as the output. |
| elements[].version | number | Element version read when the job was created. Replaying the same Idempotency-Key after the element changed is refused as a different request. |
| elements[].material_type | string | Kind of element. character, product and scene contribute their pictures and guidance; brand contributes guidance and palette only, never a picture. |
| result | object | Present on a completed align job: how the two recordings line up, with offset_seconds and confidence. Absent on every job that produced assets instead of a fact. |
| result.offset_seconds | number | How many seconds later the reference asset starts, relative to the source asset the route named; positive means the reference comes later, so a caller holding both recordings knows which one to slide. It is the negation of the model’s own lag, decided once in the domain. |
| result.confidence | number | How sure the alignment is, from 0 to 1; a low value means the two recordings share little to correlate. |
curl -X GET "https://api.deepraxis.com/media/v1/libraries/${LIBRARY_ID}/jobs/job_d3d8539613874085ae39b3d14f446d32" \ -H "Authorization: Bearer $PRAXIS_API_KEY"HTTP 200
{ "id": "job_d3d8539613874085ae39b3d14f446d32", "library_id": "lib_ab7c545e85994e108974c89aa2078cf8", "action": "tag", "status": "completed", "total": 1, "done": 1, "failed": 0, "failures": [], "created_at": "2026-11-13T06:17:14.445Z", "finished_at": "2026-11-13T06:17:14.493Z"}Job
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | JobId | 是 | 资源 ID |
| library_id | LibraryId | 是 | 库 ID |
| action | tag / untag / set_context / move / delete / reprocess / "generate" | 是 | 批量操作 |
| status | JobStatus | 是 | 资源状态 |
| type | GenerationType | 否 | 资源或事件类型 |
| operation | GenerationOperation | 否 | — |
| source_asset_id | AssetId | 否 | — |
| progress | number | 否 | — |
| queue_reason | "concurrency" / "provider_throttled" / "provider_queue" | 否 | — |
| queue_position | number | 否 | — |
| total | number | 是 | 任务素材总数 |
| done | number | 是 | 已完成数量;分片响应中表示是否完成 |
| failed | number | 是 | 失败数量 |
| failures | object[] | 是 | — |
| intent | string | 否 | — |
| model | string | 否 | — |
| tier | MediaTier | 否 | — |
| outputs | object[] | 否 | — |
| usage | object | 否 | — |
| created_at | IsoTimestamp | 是 | 创建时间 |
| finished_at | IsoTimestamp / null | 是 | 结束时间;未结束为空 |
| pipeline_run_id | string | 否 | — |
| elements | ElementUse[] | 否 | — |
| result | AlignResult | 否 | 操作结果 |
BatchSelector
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ids | AssetId[] | 是 | 素材 ID 列表 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| expression | string | 是 | 结构化查询表达式;空表达式返回全部素材 |
| exclusions | AssetId[] | 否 | 从选择中排除的素材 ID |
BatchAction
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "tag" / "untag" | 是 | 批量操作 |
| tags | string[] | 是 | 素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "set_context" | 是 | 批量操作 |
| context | object | 是 | 自定义文字键值;PATCH 整体替换,传 {} 清空 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "move" | 是 | 批量操作 |
| asset_folder | string | 是 | 组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "delete" | 是 | 批量操作 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | "reprocess" | 是 | 批量操作 |
| kinds | ProcessingKind[] | 否 | 各项处理状态 |