Jobs

Durable asynchronous execution.

GET/v1/jobs

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

limit?integer
Range1 <= value <= 100
Default20
after?string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/jobs"
{  "data": [    {      "completed_at": 0,      "created_at": 0,      "error": {        "property1": null,        "property2": null      },      "expires_at": 0,      "id": "string",      "metadata": {        "property1": "string",        "property2": "string"      },      "object": "job",      "operation": "string",      "progress": {        "property1": null,        "property2": null      },      "result": {        "property1": null,        "property2": null      },      "result_deleted_at": 0,      "started_at": 0,      "status": "queued",      "usage": {        "property1": null,        "property2": null      }    }  ],  "has_more": true,  "last_id": "string",  "object": "list"}
GET/v1/jobs/{jobId}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

jobId*string
Match^job_[a-z0-9]{20}$

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/jobs/string"
{  "completed_at": 0,  "created_at": 0,  "error": {    "property1": null,    "property2": null  },  "expires_at": 0,  "id": "string",  "metadata": {    "property1": "string",    "property2": "string"  },  "object": "job",  "operation": "string",  "progress": {    "property1": null,    "property2": null  },  "result": {    "property1": null,    "property2": null  },  "result_deleted_at": 0,  "started_at": 0,  "status": "queued",  "usage": {    "property1": null,    "property2": null  }}
POST/v1/jobs/{jobId}/cancel

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

jobId*string
Match^job_[a-z0-9]{20}$

Header Parameters

Idempotency-Key?string

A unique key used to safely retry a non-streaming POST request.

Lengthlength <= 255

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/jobs/string/cancel"
{  "completed_at": 0,  "created_at": 0,  "error": {    "property1": null,    "property2": null  },  "expires_at": 0,  "id": "string",  "metadata": {    "property1": "string",    "property2": "string"  },  "object": "job",  "operation": "string",  "progress": {    "property1": null,    "property2": null  },  "result": {    "property1": null,    "property2": null  },  "result_deleted_at": 0,  "started_at": 0,  "status": "queued",  "usage": {    "property1": null,    "property2": null  }}
DELETE/v1/jobs/{jobId}/content

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

jobId*string
Match^job_[a-z0-9]{20}$

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/v1/jobs/string/content"
{  "deleted": true}
GET/v1/jobs/{jobId}/events

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

jobId*string
Match^job_[a-z0-9]{20}$

Header Parameters

Last-Event-ID?string

Response Body

text/event-stream

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/jobs/string/events"
"string"
GET/v1/jobs/{jobId}/steps

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

jobId*string
Match^job_[a-z0-9]{20}$

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/jobs/string/steps"
{  "data": [    {      "completed_at": 0,      "cost_usd": "string",      "created_at": 0,      "error": {        "property1": null,        "property2": null      },      "id": "string",      "job_id": "string",      "key": "string",      "object": "job.step",      "operation": "string",      "output": {        "property1": null,        "property2": null      },      "requested_model": "string",      "resolved_model": "string",      "response": {        "property1": null,        "property2": null      },      "started_at": 0,      "status": "blocked",      "usage": {        "property1": null,        "property2": null      }    }  ],  "has_more": true,  "last_id": "string",  "object": "list"}
GET/v1/jobs/{jobId}/steps/{stepId}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

jobId*string
Match^job_[a-z0-9]{20}$
stepId*string
Match^stp_[a-z0-9]{20}$

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/jobs/string/steps/string"
{  "completed_at": 0,  "cost_usd": "string",  "created_at": 0,  "error": {    "property1": null,    "property2": null  },  "id": "string",  "job_id": "string",  "key": "string",  "object": "job.step",  "operation": "string",  "output": {    "property1": null,    "property2": null  },  "requested_model": "string",  "resolved_model": "string",  "response": {    "property1": null,    "property2": null  },  "started_at": 0,  "status": "blocked",  "usage": {    "property1": null,    "property2": null  }}