Skip to content
Reference

Otium Public API

v0.1.0

The public submit surface. Point an OpenAI-compatible client at our base URL, or call the native job endpoints directly.

Authentication

Every endpoint except the health probes takes a bearer token: Authorization: Bearer <api-key>. Create a key in the customer portal under Developers. Keys are scoped to one account — treat them as secrets and rotate them if exposed.

Health

Liveness / readiness probes.

GET /livez No auth

Liveness probe.

Answers only "is this process running". It never consults a dependency, and that is the point: a downed database or payload key store is a readiness condition, not a reason to restart the process. Restarting cannot reach an unreachable vault — it just churns the pod and blocks the rollout that would carry the fix. Unauthenticated.

Responses

StatusMeaning
200The process is running. HealthOK
GET /healthz No auth

Readiness probe.

Reports the observed health of the dependencies that gate every payload path — the database and the payload encryption key store — so a load balancer can route around a degraded instance. Use /livez for liveness. Unauthenticated.

Responses

StatusMeaning
200Healthy. HealthOK
503A gating dependency (database or key store) is unavailable; this instance is degraded. HealthDegraded

Jobs

Otium-native job submission and lookup.

POST /v1/jobs

Submit a job.

Validates, persists, and acknowledges a single inference job, then returns immediately — scheduling and execution happen asynchronously. **Idempotency.** Supply `idempotency_key` to make resubmission safe: a repeat with the same key (per tenant) returns the original job with `200` instead of creating a second. A brand-new job is created with `201`.

Request body SubmitJobRequest

FieldTypeDescription
model (required)stringWhat to run. An intent alias (e.g. `otium-medium`) or an exact catalog model id. Required. An alias is resolved to a concrete model server-side; an unresolvable value is rejected with 400.
otium OtiumIntentOptional intent extension — declare an outcome (task, quality floor, family) rather than only a model. OpenAI-compatible (stock clients ignore it).
tier TierSLA tier. Omit to default to `remnant`.
rushprioritystandardremnant
payload stringSmall inline request body (PoC). Production payloads live in object storage.
idempotency_key stringPer-tenant key making resubmission safe. A repeat returns the original job.
max_attempts integerMax execution attempts before dead-lettering. Non-positive values default to 3.
Default: 3
boundary BoundaryLocks the job to a residency boundary. Empty means unconstrained.
afapaccaeueu-demenasaukus
sensitivity SensitivityData-sensitivity class. Empty defaults to `internal` (trusted-only).
confidentialinternalpublic
max_tokens integerOutput-token ceiling. Bounds the up-front cost estimate the prepaid gate reserves; 0 uses a default ceiling.

Responses

StatusMeaning
200Idempotent replay — the existing job for this idempotency key. Job
201Job created. Job
400Invalid request (bad JSON, missing model, unknown tier or boundary). NativeError
429Per-client-IP submit rate limit exceeded.
503Database unavailable. NativeError
GET /v1/jobs/{id}

Get a job.

Returns a job by id. A tenant may only read its own jobs.

Parameters

ParameterIn · typeDescription
id (required)path · string (uuid)Job id.

Responses

StatusMeaning
200The job. Job
404Not found, or owned by another tenant. NativeError

Files

OpenAI-compatible Files API (batch input upload, output download).

GET /v1/files

List files.

Parameters

ParameterIn · typeDescription
purpose query · stringFilter by purpose. Omit for all of the tenant's files.

Responses

StatusMeaning
200A single page of files (OpenAI list envelope). FileList
POST /v1/files

Upload a batch input file.

Uploads a JSONL batch input file (`purpose=batch`). Each line is a `BatchRequestInput`. OpenAI-compatible. Uploads above the server limit are rejected with `413`.

Request body

Responses

StatusMeaning
200Uploaded file metadata. FileObject
400Unsupported purpose or missing file field. OpenAIError
413File exceeds the maximum upload size. OpenAIError
GET /v1/files/{id}

Get file metadata.

Parameters

ParameterIn · typeDescription
id (required)path · stringFile id (e.g. `file-<uuid>`).

Responses

StatusMeaning
200File metadata. FileObject
404No such file (or owned by another tenant). OpenAIError
DELETE /v1/files/{id}

Delete a file.

Parameters

ParameterIn · typeDescription
id (required)path · stringFile id (e.g. `file-<uuid>`).

Responses

StatusMeaning
200Deletion acknowledgement. FileDeleted
404No such file (or owned by another tenant). OpenAIError
GET /v1/files/{id}/content

Download file content.

Streams the raw JSONL content of a file.

Parameters

ParameterIn · typeDescription
id (required)path · stringFile id (e.g. `file-<uuid>`).

Responses

StatusMeaning
200Raw JSONL content.
404No such file (or owned by another tenant). OpenAIError

Batches

OpenAI-compatible Batch API.

GET /v1/batches

List batches.

Parameters

ParameterIn · typeDescription
limit query · integerMax batches to return. Defaults to the server's page size.

Responses

StatusMeaning
200A single page of batches (OpenAI list envelope). BatchList
POST /v1/batches

Create a batch.

Creates a batch over a previously uploaded input file. OpenAI-compatible. **Completion window → SLA tier.** `completion_window` accepts OpenAI's `24h` (and empty, treated as `24h`), the shorthands `1h` / `6h` / `7d` / `168h`, and Otium's own tier names as an extension — the flexible-deadline knob. **Data residency.** Set `metadata.boundary` (e.g. `us`, `eu`) to lock every job in the batch to a residency boundary.

Request body CreateBatchRequest

FieldTypeDescription
input_file_id (required)stringId of an uploaded file with purpose `batch`, owned by the caller.
endpoint stringThe only endpoint supported today.
/v1/chat/completions
Default: /v1/chat/completions
completion_window stringOpenAI `24h` (default), the shorthands `1h` / `6h` / `7d` / `168h`, or an Otium tier name (`rush`, `priority`, `standard`, `remnant`).
Default: 24h
metadata map of stringUp to 16 string key/value pairs. The reserved key `boundary` locks every job in the batch to a residency boundary.

Responses

StatusMeaning
200The created batch (status `validating`). Batch
400Invalid request (bad JSON, missing input_file_id, unsupported endpoint/window, too much metadata, invalid boundary). OpenAIError
404input_file_id does not exist or is not owned by the caller. OpenAIError
GET /v1/batches/{id}

Get a batch.

Parameters

ParameterIn · typeDescription
id (required)path · stringBatch id (e.g. `batch_<uuid>`).

Responses

StatusMeaning
200The batch. Batch
404No such batch (or owned by another tenant). OpenAIError
POST /v1/batches/{id}/cancel

Cancel a batch.

Requests cancellation: the batch moves to `cancelling`, the processor stops outstanding jobs and finalizes what completed. Idempotent while already `cancelling`. Cancelling a terminal batch is a `409`.

Parameters

ParameterIn · typeDescription
id (required)path · stringBatch id (e.g. `batch_<uuid>`).

Responses

StatusMeaning
200The batch, now `cancelling` (or unchanged if already cancelling). Batch
404No such batch (or owned by another tenant). OpenAIError
409The batch is in a terminal status and cannot be cancelled. OpenAIError

Schemas

The object shapes the endpoints above accept and return.

Tier

SLA tier — the completion window the caller will wait.

rushprioritystandardremnant

Boundary

Data-residency boundary (never a raw cloud region). Empty means unconstrained. Coarse and fine tags coexist (e.g. a region in `eu` may also be in `eu-de`).

afapaccaeueu-demenasaukus

Sensitivity

Data-sensitivity class. Empty defaults to `internal` (trusted-only). Sets the minimum worker trust tier the job may run on. See docs/trust-tiers.md.

confidentialinternalpublic

TrustTier

Minimum worker trust tier required to run the job, derived from its sensitivity at submit. Control-plane-assigned to workers; never self-reported.

known_providerowner_trusteduntrusted

JobStatus

Position in the job lifecycle state machine.

acceptedholdqueuedscheduleddispatchedrunningsucceededfailedinterruptedexpireddead_lettercancelled

BatchStatus

OpenAI batch lifecycle status.

validatingfailedin_progressfinalizingcompletedexpiredcancellingcancelled

SubmitJobRequest

FieldTypeDescription
model (required)stringWhat to run. An intent alias (e.g. `otium-medium`) or an exact catalog model id. Required. An alias is resolved to a concrete model server-side; an unresolvable value is rejected with 400.
otium OtiumIntentOptional intent extension — declare an outcome (task, quality floor, family) rather than only a model. OpenAI-compatible (stock clients ignore it).
tier TierSLA tier. Omit to default to `remnant`.
rushprioritystandardremnant
payload stringSmall inline request body (PoC). Production payloads live in object storage.
idempotency_key stringPer-tenant key making resubmission safe. A repeat returns the original job.
max_attempts integerMax execution attempts before dead-lettering. Non-positive values default to 3.
Default: 3
boundary BoundaryLocks the job to a residency boundary. Empty means unconstrained.
afapaccaeueu-demenasaukus
sensitivity SensitivityData-sensitivity class. Empty defaults to `internal` (trusted-only).
confidentialinternalpublic
max_tokens integerOutput-token ceiling. Bounds the up-front cost estimate the prepaid gate reserves; 0 uses a default ceiling.

OtiumIntent

The optional `otium` selection extension: declare an outcome instead of a model. Rung 1 routes on the `model` alias alone; these fields are carried for the measured router and planner (later rungs) and do not yet change the resolved model.

FieldTypeDescription
task stringThe task kind, e.g. extract | classify | summarize | generate | chat.
quality stringThe quality floor — the cheapest execution that meets it, e.g. good | high | best.
family stringModel-family constraint — auto (default) | qwen | gemma | glm | an exact model id.

Job

The durable record of one unit of deferred inference work.

FieldTypeDescription
id (required)string (uuid)
idempotency_key string
tenant (required)string
product stringThe sellable SKU the job was submitted under (billing keys on it). Empty for pre-product jobs.
model (required)stringThe concrete model the job runs on (dispatch/provisioning key on it).
status (required)JobStatus
acceptedholdqueuedscheduleddispatchedrunningsucceededfailedinterruptedexpireddead_lettercancelled
tier (required)Tier
rushprioritystandardremnant
deadline (required)string (date-time)SLA deadline; the job expires if not completed by this time.
boundary Boundary
afapaccaeueu-demenasaukus
sensitivity Sensitivity
confidentialinternalpublic
required_trust TrustTier
known_providerowner_trusteduntrusted
run_id stringWorkflow run this job is an attempt of. Empty for an ordinary job. A workflow job is scheduled, leased and executed by exactly the same path as any other; these two fields are only how a completion finds its graph node.
node_key stringWorkflow node this job is an attempt of. Empty for an ordinary job.
attempts (required)integer
max_attempts (required)integer
last_error stringCategory/summary of the last failure. Never contains payload content.
payload string
result string
input_ref stringObject-storage key for the input when not stored inline.
result_ref stringObject-storage key for the result when not stored inline.
leased_by stringWorker id holding the job while running.
lease_expires_at string (date-time)
created_at (required)string (date-time)
updated_at string (date-time)
queued_at string (date-time)
scheduled_at string (date-time)
started_at string (date-time)
finished_at string (date-time)
input_tokens integer
output_tokens integer
cached_tokens integer
cost_usd number
estimated_cost_usd number

FileObject

OpenAI representation of an uploaded or generated file.

FieldTypeDescription
id (required)string
object (required)string
file
bytes (required)integer (int64)
created_at (required)integer (int64)Creation time, Unix seconds.
filename (required)string
purpose (required)string
batchbatch_output

FileList

FieldTypeDescription
object (required)string
list
data (required)array of FileObject
has_more boolean

FileDeleted

FieldTypeDescription
id (required)string
object (required)string
file
deleted (required)boolean

CreateBatchRequest

FieldTypeDescription
input_file_id (required)stringId of an uploaded file with purpose `batch`, owned by the caller.
endpoint stringThe only endpoint supported today.
/v1/chat/completions
Default: /v1/chat/completions
completion_window stringOpenAI `24h` (default), the shorthands `1h` / `6h` / `7d` / `168h`, or an Otium tier name (`rush`, `priority`, `standard`, `remnant`).
Default: 24h
metadata map of stringUp to 16 string key/value pairs. The reserved key `boundary` locks every job in the batch to a residency boundary.

Batch

OpenAI representation of a batch. Unset timestamps serialize as null.

FieldTypeDescription
id (required)string
object (required)string
batch
endpoint (required)string
errors BatchErrorList
input_file_id (required)string
completion_window (required)string
status (required)BatchStatus
validatingfailedin_progressfinalizingcompletedexpiredcancellingcancelled
output_file_id string
error_file_id string
created_at (required)integer (int64)Unix seconds.
in_progress_at integer (int64), nullable
expires_at integer (int64), nullable
finalizing_at integer (int64), nullable
completed_at integer (int64), nullable
failed_at integer (int64), nullable
expired_at integer (int64), nullable
cancelling_at integer (int64), nullable
cancelled_at integer (int64), nullable
request_counts (required)RequestCounts
metadata map of string

BatchList

FieldTypeDescription
object (required)string
list
data (required)array of Batch
has_more boolean

RequestCounts

Per-batch progress tally.

FieldTypeDescription
total (required)integer
completed (required)integer
failed (required)integer

BatchErrorList

Non-fatal errors discovered during validation.

FieldTypeDescription
object (required)string
list
data (required)array of BatchError

HealthOK

FieldTypeDescription
status (required)string
ok

HealthDegraded

FieldTypeDescription
status (required)string
degraded
database (required)string
down

NativeError

Native-surface error envelope (`POST /v1/jobs`, `GET /v1/jobs/{id}`).

FieldTypeDescription
error (required)string

OpenAIError

OpenAI-compatible error envelope used by the Files and Batch endpoints.

FieldTypeDescription
error (required)object

Send your first batch.

Otium is in closed alpha. Leave your email and we’ll send an invite with an API key when a spot opens.

No credit card, no spam — one email when your invite is ready.

Closed alpha — onboarding is gated while we calibrate. Already invited? Sign in.