Events

Use job events when you want live progress updates without repeated polling.

The job events endpoint opens a server-sent events stream for one job in the API key workspace. It is useful for scripts, services, and notebook runners that want progress updates while a job is running.

Open an event stream

GET /api/v1/jobs/{jobId}/events requires the jobs:read scope.

The response uses:

  • Content-Type: text/event-stream
  • Cache-Control: private, no-cache, no-transform
  • Connection: keep-alive

Event data

Events contain job status updates generated from the same job state used by the status endpoint. Clients should parse each event payload as job status data and stop listening after a terminal status.

Treat these statuses as terminal in client workflows:

  • COMPLETED
  • FAILED
  • TIMEOUT
  • CANCELLED
  • BUDGET_EXCEEDED

Code examples

Browser EventSource does not support custom Authorization headers. For server-side JavaScript, use fetch and read the stream.

curl -N \
  -H "Authorization: Bearer $PROTEINIQ_API_KEY" \
  "https://proteiniq.io/api/v1/jobs/job_123/events"

Polling fallback

Use GET /api/v1/jobs/{jobId}/status when your runtime cannot keep a streaming connection open. Polling every few seconds is usually enough for command-line and notebook workflows.

Bash
curl -s \
  -H "Authorization: Bearer $PROTEINIQ_API_KEY" \
  "https://proteiniq.io/api/v1/jobs/job_123/status"