# phi.jobs

Submit a model job, follow its progress and wait for results.

## phi.jobs.cancel

```python
phi.jobs.cancel(job_id=job_id)
```

| Parameter | Type | Required |
|---|---|---|
| `job_id` | `str` | Required |

## phi.jobs.embeddings

```python
phi.jobs.embeddings(job_id=job_id)
```

Returns `JobEmbeddings`.

| Parameter | Type | Required |
|---|---|---|
| `job_id` | `str` | Required |

### JobEmbeddings fields and schema

```json
{
  "type": "object",
  "required": [
    "job_id",
    "model",
    "model_id",
    "pooling",
    "embeddings"
  ],
  "properties": {
    "embeddings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EmbeddingRow"
      }
    },
    "index_url": {
      "type": "string",
      "default": ""
    },
    "job_id": {
      "type": "string"
    },
    "mask_token": {
      "type": "string",
      "default": ""
    },
    "mask_token_id": {
      "type": "integer",
      "default": -1
    },
    "model": {
      "type": "string"
    },
    "model_id": {
      "type": "string"
    },
    "next_cursor": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "pooling": {
      "type": "string"
    },
    "urls_signed": {
      "default": null,
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "vocab": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "MutationScore": {
      "type": "object",
      "required": [
        "mutation"
      ],
      "properties": {
        "delta_loglik": {
          "default": null,
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "delta_loglik_vs_reference": {
          "default": null,
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "loglik": {
          "default": null,
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "mutation": {
          "type": "string"
        }
      }
    },
    "EmbeddingRow": {
      "type": "object",
      "required": [
        "name",
        "seq_len"
      ],
      "properties": {
        "cached": {
          "type": "boolean",
          "default": false
        },
        "dtype": {
          "type": "string",
          "default": ""
        },
        "embedding_url": {
          "type": "string",
          "default": ""
        },
        "error": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "layers": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "logits_cached": {
          "type": "boolean",
          "default": false
        },
        "logits_dtype": {
          "type": "string",
          "default": ""
        },
        "logits_shape": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "logits_url": {
          "type": "string",
          "default": ""
        },
        "mutations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MutationScore"
          }
        },
        "name": {
          "type": "string"
        },
        "pooling": {
          "type": "string",
          "default": ""
        },
        "reductions": {
          "type": "object",
          "additionalProperties": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "region": {
          "default": null,
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "residues": {
          "type": "string",
          "default": ""
        },
        "seq_len": {
          "type": "integer"
        },
        "shape": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      }
    }
  }
}
```

## phi.jobs.get

```python
phi.jobs.get(job_id=job_id)
```

Returns `Job`.

| Parameter | Type | Required |
|---|---|---|
| `job_id` | `str` | Required |

### Job fields and schema

```json
{
  "type": "object",
  "required": [
    "job_id",
    "job_type",
    "name",
    "status",
    "user_id",
    "estimated_credits",
    "consumed_credits",
    "created_at",
    "completed_at",
    "error",
    "stage",
    "outputs"
  ],
  "properties": {
    "actor_kind": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "actor_ref": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "batch_id": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "consumed_credits": {
      "type": "integer"
    },
    "context": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "error_code": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "estimated_credits": {
      "type": "integer"
    },
    "exit_code": {
      "default": null,
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "input_manifest_uri": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "inputs": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "job_id": {
      "type": "string"
    },
    "job_type": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "outputs": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "params": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "project_id": {
      "default": null,
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "recommended_action": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "stage": {
      "anyOf": [
        {
          "$ref": "#/$defs/JobStage"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "PENDING",
        "RUNNING",
        "COMPLETED",
        "FAILED",
        "CANCELLED",
        "ERROR"
      ]
    },
    "summary": {
      "default": null,
      "anyOf": [
        {
          "$ref": "#/$defs/RunSummary"
        },
        {
          "type": "null"
        }
      ]
    },
    "system_params": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "typical_seconds": {
      "default": null,
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "user_id": {
      "type": "string"
    }
  },
  "$defs": {
    "JobStage": {
      "type": "object",
      "required": [
        "stage",
        "status",
        "started_at",
        "completed_at",
        "error"
      ],
      "properties": {
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "error_code": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "exit_code": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "recommended_action": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "stage": {
          "type": "string"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "PENDING",
            "RUNNING",
            "COMPLETED",
            "FAILED",
            "CANCELLED",
            "ERROR"
          ]
        }
      }
    },
    "RunHeadline": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "type": "string"
        },
        "pass_count": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "value": {
          "type": "number"
        }
      }
    },
    "RunSummary": {
      "type": "object",
      "properties": {
        "duration_seconds": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "headline": {
          "default": null,
          "anyOf": [
            {
              "$ref": "#/$defs/RunHeadline"
            },
            {
              "type": "null"
            }
          ]
        },
        "sample_count": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  }
}
```

## phi.jobs.iter

```python
phi.jobs.iter()
```

Returns `Iterator[Job]`.

| Parameter | Type | Default | Required |
|---|---|---|---|
| `page_size` | `int` | `20` | Optional |
| `job_type` | `JobType \| None` | `None` | Optional |
| `batch_id` | `str \| None` | `None` | Optional |

### Job fields and schema

```json
{
  "type": "object",
  "required": [
    "job_id",
    "job_type",
    "name",
    "status",
    "user_id",
    "estimated_credits",
    "consumed_credits",
    "created_at",
    "completed_at",
    "error",
    "stage",
    "outputs"
  ],
  "properties": {
    "actor_kind": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "actor_ref": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "batch_id": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "consumed_credits": {
      "type": "integer"
    },
    "context": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "error_code": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "estimated_credits": {
      "type": "integer"
    },
    "exit_code": {
      "default": null,
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "input_manifest_uri": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "inputs": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "job_id": {
      "type": "string"
    },
    "job_type": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "outputs": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "params": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "project_id": {
      "default": null,
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "recommended_action": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "stage": {
      "anyOf": [
        {
          "$ref": "#/$defs/JobStage"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "PENDING",
        "RUNNING",
        "COMPLETED",
        "FAILED",
        "CANCELLED",
        "ERROR"
      ]
    },
    "summary": {
      "default": null,
      "anyOf": [
        {
          "$ref": "#/$defs/RunSummary"
        },
        {
          "type": "null"
        }
      ]
    },
    "system_params": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "typical_seconds": {
      "default": null,
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "user_id": {
      "type": "string"
    }
  },
  "$defs": {
    "JobStage": {
      "type": "object",
      "required": [
        "stage",
        "status",
        "started_at",
        "completed_at",
        "error"
      ],
      "properties": {
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "error_code": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "exit_code": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "recommended_action": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "stage": {
          "type": "string"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "PENDING",
            "RUNNING",
            "COMPLETED",
            "FAILED",
            "CANCELLED",
            "ERROR"
          ]
        }
      }
    },
    "RunHeadline": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "type": "string"
        },
        "pass_count": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "value": {
          "type": "number"
        }
      }
    },
    "RunSummary": {
      "type": "object",
      "properties": {
        "duration_seconds": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "headline": {
          "default": null,
          "anyOf": [
            {
              "$ref": "#/$defs/RunHeadline"
            },
            {
              "type": "null"
            }
          ]
        },
        "sample_count": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  }
}
```

## phi.jobs.list

```python
phi.jobs.list()
```

Returns `JobListPage`.

| Parameter | Type | Default | Required |
|---|---|---|---|
| `page` | `int` | `1` | Optional |
| `page_size` | `int` | `20` | Optional |
| `job_type` | `JobType \| None` | `None` | Optional |
| `cursor` | `str \| None` | `None` | Optional |
| `batch_id` | `str \| None` | `None` | Optional |

### JobListPage fields and schema

```json
{
  "type": "object",
  "required": [
    "jobs",
    "total",
    "page",
    "page_size"
  ],
  "properties": {
    "jobs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Job"
      }
    },
    "next_cursor": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "page": {
      "type": "integer"
    },
    "page_size": {
      "type": "integer"
    },
    "total": {
      "type": "integer"
    }
  },
  "$defs": {
    "JobStage": {
      "type": "object",
      "required": [
        "stage",
        "status",
        "started_at",
        "completed_at",
        "error"
      ],
      "properties": {
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "error_code": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "exit_code": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "recommended_action": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "stage": {
          "type": "string"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "PENDING",
            "RUNNING",
            "COMPLETED",
            "FAILED",
            "CANCELLED",
            "ERROR"
          ]
        }
      }
    },
    "RunHeadline": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "type": "string"
        },
        "pass_count": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "value": {
          "type": "number"
        }
      }
    },
    "RunSummary": {
      "type": "object",
      "properties": {
        "duration_seconds": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "headline": {
          "default": null,
          "anyOf": [
            {
              "$ref": "#/$defs/RunHeadline"
            },
            {
              "type": "null"
            }
          ]
        },
        "sample_count": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "Job": {
      "type": "object",
      "required": [
        "job_id",
        "job_type",
        "name",
        "status",
        "user_id",
        "estimated_credits",
        "consumed_credits",
        "created_at",
        "completed_at",
        "error",
        "stage",
        "outputs"
      ],
      "properties": {
        "actor_kind": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "actor_ref": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "batch_id": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "consumed_credits": {
          "type": "integer"
        },
        "context": {
          "default": null,
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "error_code": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "estimated_credits": {
          "type": "integer"
        },
        "exit_code": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_manifest_uri": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "inputs": {
          "default": null,
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "type": "null"
            }
          ]
        },
        "job_id": {
          "type": "string"
        },
        "job_type": {
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "outputs": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "type": "null"
            }
          ]
        },
        "params": {
          "default": null,
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "type": "null"
            }
          ]
        },
        "project_id": {
          "default": null,
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ]
        },
        "recommended_action": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "stage": {
          "anyOf": [
            {
              "$ref": "#/$defs/JobStage"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "PENDING",
            "RUNNING",
            "COMPLETED",
            "FAILED",
            "CANCELLED",
            "ERROR"
          ]
        },
        "summary": {
          "default": null,
          "anyOf": [
            {
              "$ref": "#/$defs/RunSummary"
            },
            {
              "type": "null"
            }
          ]
        },
        "system_params": {
          "default": null,
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "type": "null"
            }
          ]
        },
        "typical_seconds": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "user_id": {
          "type": "string"
        }
      }
    }
  }
}
```

## phi.jobs.submit

Submit a job.

```python
phi.jobs.submit(job_type=job_type)
```

Returns `JobSubmitResponse`.

| Parameter | Type | Default | Required |
|---|---|---|---|
| `job_type` | `JobType` |  | Required |
| `inputs` | `dict[str, Any] \| None` | `None` | Optional |
| `params` | `dict[str, Any] \| None` | `None` | Optional |
| `name` | `str \| None` | `None` | Optional |
| `project_id` | `str \| None` | `None` | Optional |
| `project_name` | `str \| None` | `None` | Optional |
| `dataset_id` | `str \| None` | `None` | Optional |
| `dataset_name` | `str \| None` | `None` | Optional |
| `idempotency_key` | `str \| None` | `None` | Optional |
| `batch_id` | `str \| None` | `None` | Optional |
| `graph` | `dict[str, Any] \| None` | `None` | Optional |
| `context` | `dict[str, Any] \| None` | `None` | Optional |

### JobSubmitResponse fields and schema

```json
{
  "type": "object",
  "required": [
    "job_id",
    "status",
    "job_type",
    "estimated_credits",
    "status_url"
  ],
  "properties": {
    "batch_id": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "estimated_credits": {
      "type": "integer"
    },
    "estimated_seconds": {
      "default": null,
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "job_id": {
      "type": "string"
    },
    "job_type": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "PENDING",
        "RUNNING",
        "COMPLETED",
        "FAILED",
        "CANCELLED",
        "ERROR"
      ]
    },
    "status_url": {
      "type": "string"
    }
  }
}
```

## phi.jobs.wait

```python
phi.jobs.wait(job_id=job_id)
```

Returns `Job`.

| Parameter | Type | Default | Required |
|---|---|---|---|
| `job_id` | `str` |  | Required |
| `interval` | `float` | `5` | Optional |
| `timeout` | `float \| None` | `None` | Optional |
| `on_update` | `Callable[[Job], None] \| None` | `None` | Optional |
| `max_consecutive_errors` | `int` | `5` | Optional |

### Job fields and schema

```json
{
  "type": "object",
  "required": [
    "job_id",
    "job_type",
    "name",
    "status",
    "user_id",
    "estimated_credits",
    "consumed_credits",
    "created_at",
    "completed_at",
    "error",
    "stage",
    "outputs"
  ],
  "properties": {
    "actor_kind": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "actor_ref": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "batch_id": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "consumed_credits": {
      "type": "integer"
    },
    "context": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "error_code": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "estimated_credits": {
      "type": "integer"
    },
    "exit_code": {
      "default": null,
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "input_manifest_uri": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "inputs": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "job_id": {
      "type": "string"
    },
    "job_type": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "outputs": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "params": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "project_id": {
      "default": null,
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "recommended_action": {
      "default": null,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "stage": {
      "anyOf": [
        {
          "$ref": "#/$defs/JobStage"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "PENDING",
        "RUNNING",
        "COMPLETED",
        "FAILED",
        "CANCELLED",
        "ERROR"
      ]
    },
    "summary": {
      "default": null,
      "anyOf": [
        {
          "$ref": "#/$defs/RunSummary"
        },
        {
          "type": "null"
        }
      ]
    },
    "system_params": {
      "default": null,
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "typical_seconds": {
      "default": null,
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "user_id": {
      "type": "string"
    }
  },
  "$defs": {
    "JobStage": {
      "type": "object",
      "required": [
        "stage",
        "status",
        "started_at",
        "completed_at",
        "error"
      ],
      "properties": {
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "error_code": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "exit_code": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "recommended_action": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "stage": {
          "type": "string"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "PENDING",
            "RUNNING",
            "COMPLETED",
            "FAILED",
            "CANCELLED",
            "ERROR"
          ]
        }
      }
    },
    "RunHeadline": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "type": "string"
        },
        "pass_count": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "value": {
          "type": "number"
        }
      }
    },
    "RunSummary": {
      "type": "object",
      "properties": {
        "duration_seconds": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "headline": {
          "default": null,
          "anyOf": [
            {
              "$ref": "#/$defs/RunHeadline"
            },
            {
              "type": "null"
            }
          ]
        },
        "sample_count": {
          "default": null,
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  }
}
```


---
Source: https://dynophi.com/docs/sdk/jobs. From the installed client, phi 0.4.2, 2026-11-23.
