Skip to content
Most AI tasks no longer need a frontier model Read launch post

Jobs

A job runs one operation over a list of items in the background. You submit the items, get a job id back at once, and collect the results when the job finishes. Use one when you have more items than you want to push through real-time calls and can wait for the answer.

A job starts as soon as you submit it; there is no scheduling. This page covers encode jobs over items you send with the request, the kind the console creates.

  1. In the console sidebar, open Jobs under Jobs & data.
  2. Click Create job.
  3. Pick a Model. Operation has one choice, Encode, so the list shows encode models.
  4. Under Items, enter one text per line. Blank lines are dropped.
  5. Click Submit job.

The table lists your organization’s 100 most recent jobs, newest first, including the ones submitted through the API. Click a row to open Job detail: its state, progress, Preflight estimate and Settled spend, and one row per chunk with its result reference. A Queued or Running job has a Cancel button there.

The console doesn’t show the embeddings. Fetch them with the SDK or the API, as below.

Your API key needs the Batch jobs scope. The new-key dialog selects Inference only, so also select Batch jobs under Scopes when you create the key on the API keys page. Without it, every /v1/jobs call returns 403 with the code INSUFFICIENT_SCOPE.

import os
from sie_sdk import SIEClient
client = SIEClient("https://api.superlinked.com", api_key=os.environ["SIE_API_KEY"])
job = client.jobs.submit(
operation="encode",
model="BAAI/bge-m3",
source=["first document", "second document"],
)
print(job["id"], job["state"]) # state is "queued"
status = client.jobs.wait(job["id"], poll_s=30)
print(status["state"])
results = client.jobs.results(job["id"])
for item in results["items"]:
print(item["success"], item["dims"])

wait polls until the job reaches a final state and gives up after 600 seconds by default (timeout_s in Python, timeoutMs in TypeScript). A job on a model that isn’t loaded waits for the model first, so even a small job can take a minute or more; raise the timeout for larger jobs.

results works only on a finished job; it reads every chunk and puts each embedding in the item’s dense field, a NumPy array in Python. Items that failed have success set to false and an error.

All four calls take your API key as Authorization: Bearer <key> on https://api.superlinked.com.

CallWhat it does
POST /v1/jobsSubmit a job. The body is {"operation": "encode", "model": "BAAI/bge-m3", "items": [{"text": "first document"}, {"id": "doc-2", "text": "second document"}]}. Returns 201 with the job id, "state": "queued", total_items, chunks and preflight.estimated_credits.
GET /v1/jobs/{id}The job’s state, completed_items, spend, and output.chunks with one result ref per chunk.
GET /v1/jobsYour organization’s jobs, newest first, as {"object": "list", "data": [...]}. limit (default 100, at most 1000) and offset page through them.
POST /v1/jobs/{id}/cancelCancel a queued or running job.

Each finished chunk’s ref is a signed URL. Fetch it with a plain GET and no Authorization header; it returns that chunk’s results as MessagePack. A ref expires after 15 minutes, so call GET /v1/jobs/{id} again for fresh ones.

StateMeaning
QueuedAccepted and waiting to start.
RunningChunks are being processed.
SucceededEvery chunk finished.
FailedAt least one chunk did not succeed. Items that did succeed still have results, and they are billed.
SuspendedStopped because your organization’s account was suspended, for example when its credit balance ran out.
CanceledYou canceled it. Chunks that had already finished keep their results and their charge.

The API returns the state in lower case: queued, running, succeeded, failed, suspended or cancelled. Note the spelling of cancelled.

Cancel only works on a queued or running job. Canceling a job that already ended returns 409, except a job that is already canceled, which returns 200.

A job takes up to 100,000 items, and the request body can be up to 64 MiB. Above either, the submit returns 413. SIE splits the items into chunks of up to 100 and runs several chunks at once.

Submitting, polling and listing all count against the batch jobs rate limit of each key, so poll every few seconds, not in a tight loop. Rate limits has the figures.

The items inside a job don’t need the loop from Retries over HTTP: a chunk whose model is still loading is retried for up to 5 minutes before it fails. The submit call is different. If it times out, list your jobs before you send it again; it may have gone through, and a second submit creates a second job.

When you submit, SIE reserves an estimate of the job’s cost from your credit balance (preflight.estimated_credits). If the balance can’t cover it, the submit returns 402 with the code INSUFFICIENT_CREDITS and nothing runs. Each chunk is then charged for what it used, and whatever the job didn’t use goes back to your balance when it ends. A job uses the same per-model prices as a real-time call; see pricing.

Talk to us

Tell us about your use case and we'll get back to you shortly.