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
- Join the waitlist.
- Once it opens, create a key.
- Change the address and the key in your client.
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.
| Method | Route | What it will do |
|---|---|---|
| GET | /v1/models | Only the models that work for your key. |
| POST | /v1/chat/completions | Full 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.
| Status | Code | When |
|---|---|---|
| 401 | invalid_api_key | Key missing, mistyped or revoked. |
| 402 | budget_exceeded | Your organisation's budget has run out. |
| 404 | model_not_found | The model does not exist or is not available to your key. |
| 429 | rate_limit_exceeded | You have exceeded your organisation's quota. |
| 502 | upstream_error | The model provider failed. |