Skip to main content
Contract preview · API not open yet

The contract, before the API.

This is what we are building, so you can judge it before it exists. Nothing on this page responds yet.

Quickstart

  1. Join the waitlist.
  2. Once it opens, create a key.
  3. Change the address and the key in your client.
Contract preview · API not open yet
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://criterium.pro/v1",
    api_key=os.environ["CRITERIUM_API_KEY"],
)

r = client.chat.completions.create(
    model="criterium/router",
    messages=[
        {"role": "user", "content": "Summarise this invoice."},
    ],
)
print(r.choices[0].message.content)

Only the marked lines would change.

Contract

Shape compatible with the OpenAI ecosystem. It may change until it opens.

Contract preview · API not open yet
MethodRouteWhat it will do
GET/v1/modelsOnly the models that work for your key.
POST/v1/chat/completionsFull response or event stream.

Authentication

One key in a header, with its prefix in plain sight.

Example keycrit_sk_

  • It will be shown only once, when created.
  • We will only store its hash and prefix.
  • Quotas and budget will be per organisation.

Errors

Planned codes, in the OpenAI ecosystem error shape.

Contract preview · API not open yet
StatusCodeWhen
401invalid_api_keyKey missing, mistyped or revoked.
402budget_exceededYour organisation's budget has run out.
404model_not_foundThe model does not exist or is not available to your key.
429rate_limit_exceededYou have exceeded your organisation's quota.
502upstream_errorThe model provider failed.