Docs·API reference
Models
GET /v1/models lists the models, their status, limits and prices. GET /v1/models/{id} returns one.
HTTP
GET https://platform.xerj.ai/v1/models
GET https://platform.xerj.ai/v1/models/{id}
Authorization: Bearer $XERJ_API_KEYModels today #
| Model | Name | Status | What it does |
|---|---|---|---|
xerj-reader-1 |
XERJ Reader | available | Reads a document and answers with the exact span, Yes/No, or no answer, with a confidence. |
xerj-extract-1 |
XERJ Extract | coming soon | Typed field programs over your document, with evidence for every value. |
The model object #
| Field | Type | Description |
|---|---|---|
id |
string | The id to send as model. |
object |
string | Always "model". |
created |
integer | Unix time, in seconds. |
owned_by |
string | "xerj". |
name |
string | The display name. |
status |
string | "available" or "coming_soon". A model that is coming soon answers requests with 404 model_not_found. |
description |
string | One sentence on what it does. |
capabilities |
array | The endpoints it serves, such as ["answers", "extract"]. |
limits |
object | max_document_chars, max_question_chars, max_fields. |
pricing |
object | currency, input_per_million, output_per_million. |
Example #
curl
curl https://platform.xerj.ai/v1/models \
-H "Authorization: Bearer $XERJ_API_KEY"Python
for m in client.models.list().data:
print(m.id, m.status)
reader = client.models.retrieve("xerj-reader-1")
print(reader.pricing.input_per_million)JavaScript
const list = await client.models.list();
for (const m of list.data) console.log(m.id, m.status);
const reader = await client.models.retrieve("xerj-reader-1");
console.log(reader.pricing.input_per_million);JSON
{
"object": "list",
"data": [
{
"id": "xerj-reader-1",
"object": "model",
"created": 1762732800,
"owned_by": "xerj",
"name": "XERJ Reader",
"status": "available",
"description": "Reads a document and answers with the exact span, Yes/No, or no answer, with a confidence.",
"capabilities": ["answers", "extract"],
"limits": {"max_document_chars": 1000000, "max_question_chars": 300, "max_fields": 20},
"pricing": {"currency": "USD", "input_per_million": 0.01, "output_per_million": 0}
},
{
"id": "xerj-extract-1",
"object": "model",
"name": "XERJ Extract",
"status": "coming_soon"
}
]
}The second entry is shortened here. Read prices from this endpoint rather than copying them into your code.
Errors #
| Status | Code | When |
|---|---|---|
| 404 | model_not_found |
GET /v1/models/{id} with an id that does not exist. |
| 401 | missing_api_key, invalid_api_key, revoked_api_key |
See errors. |