Dataset orders API

Quote synthetic data from your server, confirm deliberately, and retrieve owned deliveries.

Before you begin

  • Use an API key with orders:write from an account approved for dataset tasks.
  • Read /api/v1/generation/catalog and check ordering for catalog requests or any_model_ordering for pinned-model requests.
  • Choose a compatible source with sufficient prompts available.
  • Review the quote and balance before confirmation.

Routes

Method and pathPurpose
POST /api/v1/dataset-orders/quotesPrice a configuration without reserving credits.
POST /api/v1/dataset-ordersConfirm quote_id with Idempotency-Key and reserve credits.
GET /api/v1/dataset-ordersRead your last 100 orders.
GET /api/v1/dataset-orders/:idRead owned status, progress, receipt, and deliveries.
POST /api/v1/dataset-orders/:id/cancelCancel or request cooperative cancellation.
GET /api/v1/dataset-orders/:id/deliveries/:delivery/files/:nameDownload an owned delivery; byte ranges are supported.

Catalog quote body

Send exactly these six fields for a catalog quote. The response includes quote_id, price_usd, est_tokens, eta_hours, and expires_at. Quotes expire after 24 hours.

Pinned-model quotes replace source with revision and env. They use a public model repository, a full 40-character commit, a catalog environment, and their own validated token and sampling limits. Check any_model_ordering separately.

FieldAccepted value
modelA model id from the generation catalog.
sourceA source id listed under that model.
prompt_countInteger from 1 to 1,000,000, within the source’s remaining prompts.
samples_per_promptInteger from 1 to 64.
max_new_tokensInteger from 16 to 32,768 for catalog orders.
thinkingBoolean; true only when the source supports it.

Pinned-model quote body

When any_model_ordering is pilot, use this mode for a supported public Hugging Face snapshot. The server validates the model architecture and weights at the selected revision before pricing the request.

FieldAccepted value
modelPublic repository identity in org/name form.
revisionFull 40-character lowercase hexadecimal commit revision.
envAn id from the generation catalog envs list.
prompt_countInteger from 1 to 1,000,000, within the environment’s remaining prompts.
samples_per_promptInteger from 1 to 64.
max_new_tokensInteger from 16 to 131,072, subject to model context and deadline checks.
thinkingBoolean; true only when the environment supports it.
samplingOptional temperature in (0, 2], top_p in [0.01, 1], and top_k of -1 or 1–1,000.

Request a quote with native fetch

Run this example with Node.js and RELIQUARY_API_KEY set. It selects a currently listed source and requests a small quote. It stops when ordering is disabled and does not confirm an order.

Quote only · no credit reservation

const origin = 'https://api.reliqua.ai';
const apiKey = process.env.RELIQUARY_API_KEY;
if (!apiKey) throw new Error('Set RELIQUARY_API_KEY to an orders:write key.');
async function request(path, body) {
  const response = await fetch(origin + path, {
    method: body ? 'POST' : 'GET',
    headers: {
      Authorization: 'Bearer ' + apiKey,
      ...(body ? { 'Content-Type': 'application/json' } : {}),
    },
    ...(body ? { body: JSON.stringify(body) } : {}),
  });
  const value = await response.json();
  if (!response.ok) throw new Error(value.error?.message ?? 'Request failed');
  return value;
}
const catalog = await request('/api/v1/generation/catalog');
if (catalog.ordering !== 'pilot') throw new Error('Catalog ordering is disabled.');
const model = catalog.models.find((item) => item.sources.some((source) => source.prompts_available >= 8));
const source = model?.sources.find((item) => item.prompts_available >= 8);
if (!source) throw new Error('No compatible source has eight prompts available.');
const quote = await request('/api/v1/dataset-orders/quotes', {
  model: model.id, source: source.id, prompt_count: 8,
  samples_per_prompt: 1, max_new_tokens: 1024, thinking: false,
});
console.log(JSON.stringify(quote, null, 2));

Confirm, track, and download

After reviewing the quote, POST {"quote_id": "the reviewed quote id"} to /api/v1/dataset-orders with an Idempotency-Key of 16–80 letters, digits, underscores, or hyphens. Retain that key and request body for retries. Confirmation reserves the price and can return 402 when credits are insufficient.

Use the returned order identity for status and delivery reads. progress can be null; status_reason and needs_attention add context. Cancellation of active work can require drain and export before release is known. Read billing for the final receipt, independently of execution status.

Confirmation · reserves the reviewed service credits

const apiKey = process.env.RELIQUARY_API_KEY;
const quoteId = process.env.RELIQUARY_QUOTE_ID;
const requestId = process.env.RELIQUARY_REQUEST_ID;
if (!apiKey || !quoteId || !requestId) {
  throw new Error('Set the API key, reviewed quote id, and retained request id.');
}
const response = await fetch('https://api.reliqua.ai/api/v1/dataset-orders', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer ' + apiKey,
    'Content-Type': 'application/json',
    'Idempotency-Key': requestId,
  },
  body: JSON.stringify({ quote_id: quoteId }),
});
const order = await response.json();
if (!response.ok) throw new Error(order.error?.message ?? 'Confirmation failed');
console.log(JSON.stringify(order, null, 2));

Training Data workspace — Use the same workflow through a browser session.

Errors & retries — Handle quote expiry, duplicate confirmation, and conflicts.