Saved resources API
Create and maintain owned workspace drafts with explicit configuration validation, pagination and revision checks.
Access and purpose
Saved resources are owned configurations. Reading uses a resources:read or resources:write workspace key; creating, replacing or archiving uses resources:write. The same routes also support the workspace's existing session and XSRF transport.
A resources key does not authorize training, generation orders, evaluation orders or provider rentals. Creating or updating a draft also requires the account grant matching its kind. Orders, evaluations and training keys cannot read this API.
A successful save returns launchReady:false with a launchBlocker. It does not reserve credits, allocate compute, start a run or create a provider resource. Use the dedicated execution/order API after its independent capability checks and review.
Authentication — Scopes, browser sessions and key handling.
API overview — Choose discovery, saved configuration or execution APIs.
Routes
Resource IDs in paths contain 1–64 letters, digits or hyphens. PATCH replaces the saved name and configuration; it is not a partial JSON merge. Keep kind unchanged. There is no restore endpoint in this API.
| Method and path | Request | Response |
|---|---|---|
| GET /api/resources | Optional kind, archived=true and cursor. | {resources:[...],nextCursor:string|null} |
| GET /api/resources/:id | Owned resource ID. | {resource:{...}} or 404. |
| POST /api/resources | JSON {kind,name,config}; retained Idempotency-Key recommended. | {resource:{...},launchReady:false,launchBlocker}; 201. |
| PATCH /api/resources/:id | Complete JSON {kind,name,config} and current revision header. | Updated resource, launchReady:false and launchBlocker; 200. |
| DELETE /api/resources/:id | Current revision header. | {resource:{...}} with archived status; 200. |
List and paginate
The default list excludes archived records. archived=true selects archived records instead. kind filters one supported resource kind. Each page contains at most 50 records, newest createdAt first with a stable ID tie-breaker.
If nextCursor is non-null, send it unchanged as the next request's cursor using normal URL encoding. Keep the same kind and archived selection. This API has no limit or offset parameter; do not apply the CPU jobs API's pagination syntax.
GET /api/resources/:id can retrieve an owned archived record directly. An ID belonging to another account is not exposed.
Read owned training drafts
: "${RESOURCES_API_KEY:?Set a resources:read or resources:write key}"
curl --fail-with-body --silent --show-error --max-time 15 \
-H "Authorization: Bearer $RESOURCES_API_KEY" \
'https://api.reliqua.ai/api/resources?kind=training'Resource fields
Create and replace bodies require kind, a non-empty trimmed name of at most 80 characters, and a config object. The encoded JSON configuration must not exceed 24,000 bytes. The account can retain at most 1,000 non-archived resources.
| Field | Meaning |
|---|---|
| id / kind / name | Stable owned identifier, supported resource kind and display name. |
| status | Saved lifecycle state. A draft is not proof of execution. |
| config | The validated kind-specific configuration; retain its schema/version fields. |
| revision | Positive numeric revision. Read the current value before replacing or archiving. |
| createdAt / updatedAt | Integer Unix seconds. |
| providerId | Nullable stored provider reference; saving a draft does not provision a provider. |
| estimatedHourlyUsd | Nullable reference estimate, not a current provider quote or a settled charge. |
Configuration kinds and approval
Configuration is schema-validated, not an arbitrary storage object. Read the current catalog/workflow and retain its versioned identities. An inventory object or GPU offer is not itself a valid saved config.
Example storage draft body; saving does not allocate storage
{
"kind": "storage",
"name": "Private archive draft",
"config": {
"capacityGb": 100,
"region": "eu",
"access": "private"
}
}| kind | Matching approval | Configuration contract |
|---|---|---|
| training | Training | Use a matching approved execution-profile config for launch. Preview schemaVersion 1 briefs and schemaVersion 3 catalog RL configs are draft-only; catalog RL uses submissionMode=draft_only. |
| dataset | Datasets | Versioned source authorization, environment/schema definition, target example/validation bounds, quality policy and budget. Use the dataset workflow's supported schema and catalog source. |
| evaluation | Evaluations | Exactly model, environment and samples; published example-catalog identities and 1–100,000 integer samples. |
| storage | Datasets | Exactly capacityGb (integer 1–10,000), region (us/eu/ap) and access=private. |
| instance | Compute rental | Versioned preview offer/image/GPU/storage config. It saves a preview choice; it does not rent the offer. |
| cluster_quote | Compute rental | Exactly accelerator, quantity (integer 1–1,024), region (us/eu/ap), interconnect (infiniband/ethernet); accelerator must be in the reference offer catalog. |
Training workflow — Compatible saved profiles and explicit execution.
Dataset workflow — Dataset source and format preparation.
Compute workflow — Reference offers and rental availability are separate.
Create without duplicating a draft
Send Content-Type: application/json and an Idempotency-Key containing 16–80 letters, digits, underscores or hyphens. The header is optional in this implementation, but omitting it lets the server generate a new key, so a repeated request can create another draft.
Retain the original key and identical {kind,name,config} for any uncertain retry. A reused key with different content returns 409 idempotency_conflict. A successful create or replay returns the saved resource together with launchReady:false.
Do not use a new key merely because a request timed out. First reconcile your owned list and retry the original action with its original key.
Replace or archive with the reviewed revision
Read the resource, review the saved values and send its current positive numeric revision in X-Resource-Revision. If-Match with the same unquoted numeric value is also accepted; X-Resource-Revision takes precedence if both are supplied.
PATCH sends the complete {kind,name,config} body and only updates a draft. DELETE archives an eligible draft or submitted configuration. A successful change increments revision. Neither action cancels a training task or deletes a provider instance.
A missing or invalid revision returns 428 revision_required. A stale revision, unavailable record or ineligible state returns 409 draft_conflict. Reload and review the current state before changing it; do not overwrite using a guessed revision.
These saved-resource revisions are JSON numbers. CPU job controls use their own string revision/body contract; that format is not interchangeable.
Headers and complete replacement body
PATCH /api/resources/<owned-resource-id>
Authorization: Bearer <resources:write key>
Content-Type: application/json
X-Resource-Revision: 3
{"kind":"storage","name":"Private archive draft","config":{"capacityGb":200,"region":"eu","access":"private"}}Errors and retries
Responses are private JSON with Cache-Control: no-store. The shared error shape is {error:{code,message}}. Retry transient reads with bounded backoff; preserve original creation keys and review revision conflicts instead of blindly replaying a mutation.
| Status / code | Meaning |
|---|---|
| 400 invalid_kind / invalid_cursor | Correct the list filter or use the server-returned cursor unchanged. |
| 400 invalid_resource / invalid_resource_config / invalid_key | Correct the required fields, kind-specific schema or creation key. |
| 401 authentication_required | Supply a valid resources key or the existing browser session. |
| 403 insufficient_scope / pilot_access_required | Use the resources scope and the account approval matching this resource kind. |
| 403 invalid_origin / invalid_xsrf | Refresh the native browser session transport for a session mutation. |
| 404 not_found | No readable resource with this ID belongs to the account. |
| 409 idempotency_conflict / quota_reached / draft_conflict | Reconcile the original request, resource count, current state and revision. |
| 413 config_too_large | Reduce config below its 24,000-byte encoded JSON limit. |
| 428 revision_required | Read and supply the current numeric revision before replacing or archiving. |
Errors and safe retries — HTTP failures, uncertain results and revision conflicts.
Training API — Use separate training scopes to upload, quote or explicitly launch.