Skip to content
Docs

Use Otium behind a gateway

If your team sends model traffic through a gateway, keep it. Add Otium as one more OpenAI-compatible provider, and send it the work that can wait.

What works

A gateway reaches Otium through the same OpenAI Files and Batch API your own code would use, so batch work passes through unchanged. Otium has no synchronous chat endpoint, on purpose: it is where work goes when nobody is waiting on the answer.

FeatureStatusNotes
BatchesWorksCreate, retrieve, list, cancel and results all go through the standard OpenAI Files and Batch calls.
Batch metadataWorksYour tags come back unchanged, and so does the owner Otari stamps on each batch.
Synchronous chatRefusedOtium runs work that can wait. A chat request gets a 404 with code batch_only that says to send a batch.
Routing and failoverNot to OtiumThey act on synchronous requests. Point those at a provider that answers now.

Configure Otari

Otari is Mozilla AI's open-source gateway. Add Otium as a named instance in its config.yml, then call models as otium:<model>:

config.yml
providers:
  otium:
    provider_type: openai
    api_base: "https://api.getotium.ai/v1"
    api_key: ${OTIUM_API_KEY}
    models: [otium-small, otium-medium]

# Otium's Standard rates, for batches sent with completion_window "24h".
pricing:
  otium:otium-small:
    input_price_per_million: 0.046
    output_price_per_million: 0.23
    cache_read_price_per_million: 0
  otium:otium-medium:
    input_price_per_million: 0.80
    output_price_per_million: 4.00
    cache_read_price_per_million: 0

Otari prices requests from its own config, so these are copies of the rate card as of 2026-10-19. They include a cached-input price of zero, because input served from cache is free on Otium. Without it, Otari would charge cached tokens at the full input rate and show more than we bill.

Otari keeps one price per model, so the config above assumes its default window, 24h (Standard). If you send 7d batches (Remnant), use these prices instead:

config.yml, 7d batches
providers:
  otium:
    provider_type: openai
    api_base: "https://api.getotium.ai/v1"
    api_key: ${OTIUM_API_KEY}
    models: [otium-small, otium-medium]

# Otium's Remnant rates, for batches sent with completion_window "7d".
pricing:
  otium:otium-small:
    input_price_per_million: 0.0345
    output_price_per_million: 0.1725
    cache_read_price_per_million: 0
  otium:otium-medium:
    input_price_per_million: 0.60
    output_price_per_million: 3.00
    cache_read_price_per_million: 0

Send a batch

Use Otari's batch endpoint. Otari writes the input file, uploads it to Otium and creates the batch. completion_window is the deadline, and it sets the price: 24h bills at Standard and 7d at Remnant.

shell
curl https://your-otari.example.com/api/v1/batches \
  -H "Authorization: Bearer $OTARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "otium:otium-small",
    "completion_window": "24h",
    "metadata": {"team": "catalog", "feature": "enrichment"},
    "requests": [
      {"custom_id": "sku-1", "body": {"messages": [{"role": "user", "content": "Tag this product: ..."}]}},
      {"custom_id": "sku-2", "body": {"messages": [{"role": "user", "content": "Tag this product: ..."}]}}
    ]
  }'

Up to 16 metadata pairs are yours. Otari adds otari_user_id to every batch to check who owns it; that key doesn't count toward your 16, and it comes back unchanged when Otari retrieves the batch.

Things to know

  • Failed requests. Like OpenAI, Otium writes failed requests to a separate error file. Otari's results read only the output file, so a request that failed is missing from them rather than shown as an error. Fetch the batch's error_file_id from Otium to see why it failed.
  • The bill of record is ours. Today Otari prices a batch's results by the model each result line names (the model that served it, such as gemma-4-12b-qat-w4a16) under its OpenAI implementation, not by the otium: prices above, so its cost for a batch can be missing or wrong. Your Otium portal shows what was charged.
  • A sync request says why. If a request reaches Otium on Otari's chat path, it fails with a 404 and code batch_only, and the message names the batch endpoints. Nothing is charged.

Other gateways

Any gateway that can send OpenAI batch calls to a custom base URL works the same way: https://api.getotium.ai/v1, an Otium API key, and the Files and Batch endpoints in the API reference. A gateway that only forwards synchronous chat can't send work to Otium.

Get an API key.

Otium is in closed alpha. Leave your email and we’ll send an invite 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.