Home / Docs / API reference
/v1/models
GET /v1/models
Authentication relay key (bearer)
Example request
curl
curl https://api.massrelay.ai/v1/models \
-H "Authorization: Bearer $RELAY_KEY"Python
import os, requests
r = requests.get(
"https://api.massrelay.ai/v1/models",
headers={"Authorization": f"Bearer {os.environ['RELAY_KEY']}"},
)
r.raise_for_status()
print(r.json())TypeScript
const r = await fetch("https://api.massrelay.ai/v1/models", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.RELAY_KEY}` },
});
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`);
console.log(await r.json());Response
| Field | Type | Description |
|---|---|---|
object required | string | The kind of object returned, for example chat.completion. Always "list". |
data required | array of object | The list of items returned. |
data[].id required | string | A model id, or an alias name (after the models). |
data[].object required | string | The kind of object returned, for example chat.completion. Always "model". |
data[].massrelay | object | |
data[].massrelay.provider | string | |
data[].massrelay.custody | string | |
data[].massrelay.family | string | |
data[].massrelay.reasoning_options | object | |
data[].massrelay.price_bands | array | |
data[].massrelay.ownedBy | string | Present only for the workspace's own model. Always "workspace". |
data[].massrelay.inputUsdPerM | number | |
data[].massrelay.outputUsdPerM | number | |
data[].massrelay.alias | boolean | Present on an alias entry. Always true. |
data[].massrelay.startTier | object | |
data[].massrelay.preferOwnModels | boolean |
Example response (shape)
{
"object": "list",
"data": [
{
"id": "<id>",
"object": "model",
"massrelay": {
"provider": "<provider>",
"custody": "<custody>",
"family": "<family>",
"reasoning_options": "<reasoning_options>",
"price_bands": [],
"ownedBy": "workspace",
"inputUsdPerM": 0,
"outputUsdPerM": 0,
"alias": true,
"startTier": "<startTier>",
"preferOwnModels": false
}
}
]
}Common errors
401invalid_api_key403insufficient_scope429over the request rate; read Retry-After
Every error has the same JSON shape; see Errors and Limits.
Full schema (JSON)
Response schema
{
"description": "Served for an L1 key; any other key layer answers 501 not_ported. The massrelay keys listed are those the handler inserts; a key appears only when its source row exists.",
"type": "object",
"required": [
"object",
"data"
],
"properties": {
"object": {
"const": "list"
},
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"object"
],
"properties": {
"id": {
"type": "string",
"description": "A model id, or an alias name (after the models)."
},
"object": {
"const": "model"
},
"massrelay": {
"type": "object",
"additionalProperties": true,
"properties": {
"provider": {
"type": "string"
},
"custody": {
"type": "string"
},
"family": {
"type": "string"
},
"reasoning_options": {},
"price_bands": {
"type": "array"
},
"ownedBy": {
"const": "workspace",
"description": "Present only for the workspace's own model."
},
"inputUsdPerM": {
"type": "number"
},
"outputUsdPerM": {
"type": "number"
},
"alias": {
"const": true,
"description": "Present on an alias entry."
},
"startTier": {},
"preferOwnModels": {
"type": "boolean"
}
}
}
}
}
}
}
}